diff --git a/integration-tests/src/test/java/io/apicurio/tests/auth/SimpleAuthIT.java b/integration-tests/src/test/java/io/apicurio/tests/auth/SimpleAuthIT.java index 7976a4dbce..fc3b7b434c 100644 --- a/integration-tests/src/test/java/io/apicurio/tests/auth/SimpleAuthIT.java +++ b/integration-tests/src/test/java/io/apicurio/tests/auth/SimpleAuthIT.java @@ -25,6 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; @Tag(Constants.AUTH) @TestProfile(AuthTestProfile.class) @@ -64,7 +65,7 @@ public void testWrongCreds() throws Exception { var exception = Assertions.assertThrows(Exception.class, () -> { client.groups().byGroupId("foo").artifacts().get(); }); - assertNotAuthorized(exception); + assertTrue(exception.getMessage().contains("unauthorized")); } @Test diff --git a/integration-tests/src/test/resources/infra/auth/keycloak.yml b/integration-tests/src/test/resources/infra/auth/keycloak.yml index 07b7fe5924..0f3c95fbbe 100644 --- a/integration-tests/src/test/resources/infra/auth/keycloak.yml +++ b/integration-tests/src/test/resources/infra/auth/keycloak.yml @@ -3183,8 +3183,6 @@ spec: value: "8090" - name: KC_HOSTNAME_STRICT_BACKCHANNEL value: "false" - - name: KC_HTTP_RELATIVE_PATH - value: "/auth" - name: KC_HTTP_PORT value: "8090" ports: @@ -3211,7 +3209,16 @@ metadata: spec: selector: app: keycloak-deployment + type: LoadBalancer + sessionAffinity: None + externalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + allocateLoadBalancerNodePorts: true + internalTrafficPolicy: Cluster ports: - protocol: TCP port: 8090 targetPort: 8090 + nodePort: 32587 diff --git a/utils/tests/src/main/java/io/apicurio/registry/utils/tests/KeycloakTestContainerManager.java b/utils/tests/src/main/java/io/apicurio/registry/utils/tests/KeycloakTestContainerManager.java index 7b9d384b92..3a46f31871 100644 --- a/utils/tests/src/main/java/io/apicurio/registry/utils/tests/KeycloakTestContainerManager.java +++ b/utils/tests/src/main/java/io/apicurio/registry/utils/tests/KeycloakTestContainerManager.java @@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.utility.DockerImageName; import java.util.HashMap; import java.util.Map; @@ -25,12 +26,12 @@ public class KeycloakTestContainerManager implements QuarkusTestResourceLifecycl @Override public Map start() { - server = new KeycloakContainer().withNetwork(Network.SHARED).withRealmImportFile("/realm.json"); + server = new KeycloakContainer( + DockerImageName.parse("quay.io/keycloak/keycloak").withTag("18.0.1").toString()) + .withNetwork(Network.SHARED).withRealmImportFile("/realm.json"); server.start(); - server.waitingFor(Wait.forLogMessage( - ".*[org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode.*", - 1)); + server.waitingFor(Wait.forLogMessage(".*io.quarkus] (main) Keycloak 18.0.1 on JVM.*", 1)); Map props = new HashMap<>();