Clean LDAP between test method executions

Closes #22602

Signed-off-by: Michal Hajas <mhajas@redhat.com>
This commit is contained in:
Michal Hajas 2023-08-22 12:33:49 +02:00 committed by Pedro Igor
parent 07a4bc4db1
commit 94089bd492

View file

@ -100,6 +100,12 @@ public class UserSyncTest extends KeycloakModelTest {
@Override @Override
public void cleanEnvironment(KeycloakSession s) { public void cleanEnvironment(KeycloakSession s) {
final RealmModel realm = s.realms().getRealm(realmId);
ComponentModel ldapModel = LDAPTestUtils.getLdapProviderModel(realm);
LDAPStorageProvider ldapFedProvider = LDAPTestUtils.getLdapProvider(s, ldapModel);
LDAPTestUtils.removeAllLDAPUsers(ldapFedProvider, realm);
s.realms().removeRealm(realmId); s.realms().removeRealm(realmId);
} }