From 12d4837fa9180b7b59394cbe80b31f6c5b65ec8b Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 6 Oct 2021 13:21:34 +0200 Subject: [PATCH] KEYCLOAK-19484_BasicSamlTest --- .../quarkus/src/main/content/conf/keycloak.properties | 5 ++++- .../containers/KeycloakQuarkusServerDeployableContainer.java | 5 ++++- .../test/java/org/keycloak/testsuite/saml/BasicSamlTest.java | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/testsuite/integration-arquillian/servers/auth-server/quarkus/src/main/content/conf/keycloak.properties b/testsuite/integration-arquillian/servers/auth-server/quarkus/src/main/content/conf/keycloak.properties index 0a90e8f97e..d60d4e34dc 100644 --- a/testsuite/integration-arquillian/servers/auth-server/quarkus/src/main/content/conf/keycloak.properties +++ b/testsuite/integration-arquillian/servers/auth-server/quarkus/src/main/content/conf/keycloak.properties @@ -37,4 +37,7 @@ spi.password-policy.password-blacklist.blacklists-path=${kc.home.dir:}/dependenc spi.connections-http-client.default.reuse-connections=false # set max-length of event representation stored so the db can handle it -spi.events-store.jpa.max-detail-length=2000 \ No newline at end of file +spi.events-store.jpa.max-detail-length=2000 + +# set known protocol ports for basicsamltest +spi.login-protocol.saml.known-protocols=http=${auth.server.http.port:},https=${auth.server.https.port:} 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 22a45136a4..76b6236e16 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 @@ -180,10 +180,13 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta commands.add("--debug"); commands.add(System.getProperty("auth.server.debug.port", "5005")); } - commands.add("--http-port=" + configuration.getBindHttpPort()); commands.add("--https-port=" + configuration.getBindHttpsPort()); + //for setting the spi.login-protocol.saml.known-protocols values correctly in keycloak.properties + commands.add("-Dauth.server.http.port=" + configuration.getBindHttpPort()); + commands.add("-Dauth.server.https.port=" + configuration.getBindHttpsPort()); + if (configuration.getRoute() != null) { commands.add("-Djboss.node.name=" + configuration.getRoute()); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/BasicSamlTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/BasicSamlTest.java index faa43b3bb4..f2d5b9005f 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/BasicSamlTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/BasicSamlTest.java @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.keycloak.saml.common.constants.JBossSAMLURIConstants.NAMEID_FORMAT_TRANSIENT; import static org.keycloak.saml.common.constants.JBossSAMLURIConstants.PROTOCOL_NSURI; import static org.keycloak.testsuite.util.ServerURLs.AUTH_SERVER_PORT; @@ -167,7 +167,7 @@ public class BasicSamlTest extends AbstractSamlTest { } @Test - @AuthServerContainerExclude({AuthServer.REMOTE, AuthServer.QUARKUS}) + @AuthServerContainerExclude({AuthServer.REMOTE}) public void testNoPortInDestination() throws Exception { // note that this test relies on settings of the login-protocol.saml.knownProtocols configuration option testWithOverriddenPort(-1, Response.Status.OK, containsString("login"));