diff --git a/integration-tests/keycloak-authorization/pom.xml b/integration-tests/keycloak-authorization/pom.xml index f3bc5eb0f4533a..ec13d8ad4a4a8a 100644 --- a/integration-tests/keycloak-authorization/pom.xml +++ b/integration-tests/keycloak-authorization/pom.xml @@ -15,7 +15,6 @@ http://localhost:8180/auth - 15.3 @@ -116,37 +115,20 @@ htmlunit test - - org.openjdk.nashorn - nashorn-core - ${nashorn-core.version} - - - - src/test/resources - true - - maven-surefire-plugin true - - ${keycloak.image.version} - maven-failsafe-plugin true - - ${keycloak.image.version} - @@ -160,23 +142,6 @@ - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies-quarkus - process-test-resources - - copy-dependencies - - - ${project.build.testOutputDirectory} - nashorn-core,asm,asm-util,asm-commons - - - - diff --git a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/KeycloakLifecycleManager.java b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/KeycloakLifecycleManager.java index a1690b84672873..1598e8f63d3f32 100644 --- a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/KeycloakLifecycleManager.java +++ b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/KeycloakLifecycleManager.java @@ -31,7 +31,6 @@ import org.keycloak.util.JsonSerialization; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.images.builder.ImageFromDockerfile; import org.testcontainers.images.builder.Transferable; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; @@ -45,22 +44,16 @@ public class KeycloakLifecycleManager implements QuarkusTestResourceLifecycleMan protected static String KEYCLOAK_SERVER_URL; private static final String KEYCLOAK_REALM = "quarkus"; private static final String KEYCLOAK_SERVICE_CLIENT = "quarkus-service-app"; - private static final String KEYCLOAK_IMAGE = System.getProperty("keycloak.docker.image"); + private static final String KEYCLOAK_VERSION = System.getProperty("keycloak.version"); @SuppressWarnings("resource") @Override public Map start() { - try { - keycloak = new GenericContainer<>( - new ImageFromDockerfile().withDockerfile(Paths.get(getClass().getResource("/Dockerfile").toURI())) - .withBuildArg("KEYCLOAK_IMAGE", KEYCLOAK_IMAGE)) - .withExposedPorts(8080) - .withEnv("KEYCLOAK_ADMIN", "admin") - .withEnv("KEYCLOAK_ADMIN_PASSWORD", "admin") - .waitingFor(Wait.forLogMessage(".*Keycloak.*started.*", 1)); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } + keycloak = new GenericContainer<>("quay.io/keycloak/keycloak:" + KEYCLOAK_VERSION) + .withExposedPorts(8080) + .withEnv("KEYCLOAK_ADMIN", "admin") + .withEnv("KEYCLOAK_ADMIN_PASSWORD", "admin") + .waitingFor(Wait.forLogMessage(".*Keycloak.*started.*", 1)); keycloak = keycloak .withCopyToContainer(Transferable.of(createPoliciesJar().toByteArray()), "/opt/keycloak/providers/policies.jar") @@ -172,19 +165,6 @@ private static String getAdminAccessToken() { .as(AccessTokenResponse.class).getToken(); } - private static ClientRepresentation createServiceClient(String clientId) { - ClientRepresentation client = new ClientRepresentation(); - - client.setClientId(clientId); - client.setPublicClient(false); - client.setSecret("secret"); - client.setDirectAccessGrantsEnabled(true); - client.setServiceAccountsEnabled(true); - client.setEnabled(true); - - return client; - } - private static ClientRepresentation createClient(String clientId) { ClientRepresentation client = new ClientRepresentation(); diff --git a/integration-tests/keycloak-authorization/src/test/resources/Dockerfile b/integration-tests/keycloak-authorization/src/test/resources/Dockerfile deleted file mode 100644 index 7e12d7f27db4f1..00000000000000 --- a/integration-tests/keycloak-authorization/src/test/resources/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM ${keycloak.docker.image} as builder - -COPY ./*.jar /opt/keycloak/providers/ - -FROM ${keycloak.docker.image} -COPY --from=builder /opt/keycloak/ /opt/keycloak/ - -ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]