diff --git a/testsuite/model/src/test/java/org/keycloak/testsuite/model/infinispan/EmbeddedInfinispanSplitBrainTest.java b/testsuite/model/src/test/java/org/keycloak/testsuite/model/infinispan/EmbeddedInfinispanSplitBrainTest.java index ee66d39ff9..dd47190404 100644 --- a/testsuite/model/src/test/java/org/keycloak/testsuite/model/infinispan/EmbeddedInfinispanSplitBrainTest.java +++ b/testsuite/model/src/test/java/org/keycloak/testsuite/model/infinispan/EmbeddedInfinispanSplitBrainTest.java @@ -45,6 +45,7 @@ public class EmbeddedInfinispanSplitBrainTest extends KeycloakModelTest { @Override public void createEnvironment(KeycloakSession s) { RealmModel realm = createRealm(s, "test"); + s.getContext().setRealm(realm); realm.setDefaultRole(s.roles().addRealmRole(realm, Constants.DEFAULT_ROLES_ROLE_PREFIX + "-" + realm.getName())); this.realmId = realm.getId(); s.users().addUser(realm, "user1").setEmail("user1@localhost");