KEYCLOAK-10246 Fix MultipleRealmsTest on undertow

This commit is contained in:
mposolda 2019-05-17 21:28:37 +02:00 committed by Marek Posolda
parent 80932c07a2
commit 4ced3b0aee

View file

@ -118,14 +118,17 @@ public class MultipleRealmsTest extends AbstractTestRealmKeycloakTest {
UserModel user1 = currentSession.users().getUserByUsername("user1", realm1);
UserModel user1a = currentSession.users().getUserByUsername("user1", realm2);
UserManager um = new UserManager(session);
UserManager um = new UserManager(currentSession);
if (user1 != null) {
um.removeUser(realm1, user1);
}
if (user1a != null) {
um.removeUser(realm2, user1a);
}
});
KeycloakModelUtils.runJobInTransaction(session.getKeycloakSessionFactory(), (KeycloakSession sessionTestUser3) -> {
KeycloakSession currentSession = sessionTestUser3;
currentSession.realms().removeRealm("id1");
currentSession.realms().removeRealm("id2");
});