From 176ac3404ab08ba62e9e5f93949a1c1a924d28b2 Mon Sep 17 00:00:00 2001 From: Ryan Emerson Date: Thu, 1 Aug 2024 12:14:47 +0100 Subject: [PATCH] EmbeddedInfinispanSplitBrainTest fails with "IllegalState Session not bound to a realm" Closes #31828 Signed-off-by: Ryan Emerson --- .../model/infinispan/EmbeddedInfinispanSplitBrainTest.java | 1 + 1 file changed, 1 insertion(+) 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");