diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java index 774f37e1a1..6a75210d66 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusServerDeployableContainer.java @@ -54,7 +54,7 @@ import org.keycloak.testsuite.arquillian.SuiteContext; public class KeycloakQuarkusServerDeployableContainer implements DeployableContainer { private static final int DEFAULT_SHUTDOWN_TIMEOUT_SECONDS = 10; - private static final String AUTH_SERVER_QUARKUS_MAP_STORAGE_PROFILE = "auth.server.quarkus.mapStorage.profile"; + private static final String AUTH_SERVER_QUARKUS_MAP_STORAGE_PROFILE = "auth.server.quarkus.mapStorage.profile.config"; private static final Logger log = Logger.getLogger(KeycloakQuarkusServerDeployableContainer.class); @@ -247,6 +247,14 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta String mapStorageProfile = System.getProperty(AUTH_SERVER_QUARKUS_MAP_STORAGE_PROFILE); if (mapStorageProfile != null) { + // We need to drop optimized flag because --storage is build option therefore startup requires re-augmentation + commands.removeIf("--optimized"::equals); + + // As config is re-augmented on startup we need to also add --http-relative-path as ant build from + // integration-arquillian/servers/auth-server/quarkus/ant/configure.xml is replaced by build invoked on + // startup when we add new build option below + commands.add("--http-relative-path=/auth"); + switch (mapStorageProfile) { case "chm": commands.add("--storage=" + mapStorageProfile); @@ -256,6 +264,7 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta commands.add("--db-username=" + System.getProperty("keycloak.map.storage.connectionsJpa.url")); commands.add("--db-password=" + System.getProperty("keycloak.map.storage.connectionsJpa.user")); commands.add("--db-url=" + System.getProperty("keycloak.map.storage.connectionsJpa.password")); + break; case "hotrod": commands.add("--storage=" + mapStorageProfile); // TODO: URL / username / password diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java index 9387b93962..e0893f3fa1 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/PermissionsTest.java @@ -366,17 +366,21 @@ public class PermissionsTest extends AbstractKeycloakTest { response.set(realm.partialImport(new PartialImportRepresentation())); } }, Resource.REALM, true); - invoke(new Invocation() { - public void invoke(RealmResource realm) { - realm.clearRealmCache(); - } - }, Resource.REALM, true); - invoke(new Invocation() { - public void invoke(RealmResource realm) { - realm.clearUserCache(); - } - }, Resource.REALM, true); + if (isJpaRealmProvider()) { + // Caching is disabled with the new store, we need to skip these invocations + invoke(new Invocation() { + public void invoke(RealmResource realm) { + realm.clearRealmCache(); + } + }, Resource.REALM, true); + invoke(new Invocation() { + public void invoke(RealmResource realm) { + realm.clearUserCache(); + } + }, Resource.REALM, true); + + } // Delete realm invoke(new Invocation() { public void invoke(RealmResource realm) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java index c9bf040a35..9d21c29191 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java @@ -64,9 +64,11 @@ public class ServerInfoTest extends AbstractKeycloakTest { assertNotNull(info.getSystemInfo().getServerTime()); assertNotNull(info.getSystemInfo().getUptime()); - Map jpaProviders = info.getProviders().get("connectionsJpa").getProviders(); - ProviderRepresentation jpaProvider = jpaProviders.values().iterator().next(); - log.infof("JPA Connections provider info: %s", jpaProvider.getOperationalInfo()); + if (isJpaRealmProvider()) { + Map jpaProviders = info.getProviders().get("connectionsJpa").getProviders(); + ProviderRepresentation jpaProvider = jpaProviders.values().iterator().next(); + log.infof("JPA Connections provider info: %s", jpaProvider.getOperationalInfo()); + } } @Override diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java index 54ba3653b4..e85f4c81f6 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/domainextension/CustomExtensionTest.java @@ -17,10 +17,13 @@ package org.keycloak.testsuite.domainextension; +import org.junit.BeforeClass; import org.junit.Test; +import org.keycloak.common.Profile; import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.testsuite.AbstractKeycloakTest; import org.keycloak.testsuite.Assert; +import org.keycloak.testsuite.ProfileAssume; import org.keycloak.testsuite.arquillian.annotation.AuthServerContainerExclude; import org.keycloak.testsuite.client.resources.TestExampleCompanyResource; import org.keycloak.testsuite.util.RealmBuilder; @@ -47,6 +50,11 @@ public class CustomExtensionTest extends AbstractKeycloakTest { testRealms.add(foo); } + @BeforeClass + public static void checkNotMapStorage() { + ProfileAssume.assumeFeatureDisabled(Profile.Feature.MAP_STORAGE); + } + @Test public void testDomainExtension() throws Exception { companyResource().createCompany("foo", buildCompany("foo-company")); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java index be9dba6bb0..6b0cc9ede4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/script/DeployedScriptAuthenticatorTest.java @@ -190,7 +190,11 @@ public class DeployedScriptAuthenticatorTest extends AbstractFlowTest { loginPage.login("user", "password"); - events.expectLogin().user("user").detail(Details.USERNAME, "user").assertEvent(); + events.expectLogin().user(okayUser()).detail(Details.USERNAME, "user").assertEvent(); + } + + private UserRepresentation okayUser() { + return adminClient.realm(TEST_REALM_NAME).users().search("user", true).get(0); } /**