From 4ced3b0aee8d1cc2769bd6a91c7996d540ab636d Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 17 May 2019 21:28:37 +0200 Subject: [PATCH] KEYCLOAK-10246 Fix MultipleRealmsTest on undertow --- .../org/keycloak/testsuite/model/MultipleRealmsTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/MultipleRealmsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/MultipleRealmsTest.java index bb0b7108ec..14dad74d16 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/MultipleRealmsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/model/MultipleRealmsTest.java @@ -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"); });