From f57dd2a4817faa40cfc955a2ce256c2a5410780f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20Ko=CC=88bler?= Date: Mon, 29 Apr 2024 20:08:55 +0200 Subject: [PATCH] handle default version --- .../testcontainers/keycloak/ExtendableKeycloakContainer.java | 3 ++- .../dasniko/testcontainers/keycloak/KeycloakContainerTest.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java b/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java index 49aac5b..b89f861 100644 --- a/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java +++ b/src/main/java/dasniko/testcontainers/keycloak/ExtendableKeycloakContainer.java @@ -508,7 +508,8 @@ public Duration getStartupTimeout() { } public String getKeycloakDefaultVersion() { - return KEYCLOAK_VERSION; + //noinspection ConstantValue + return KEYCLOAK_VERSION.equals("nightly") ? "999.0.0-SNAPSHOT" : KEYCLOAK_VERSION; } private boolean isNotBlank(String s) { diff --git a/src/test/java/dasniko/testcontainers/keycloak/KeycloakContainerTest.java b/src/test/java/dasniko/testcontainers/keycloak/KeycloakContainerTest.java index c52df24..4bffbe4 100644 --- a/src/test/java/dasniko/testcontainers/keycloak/KeycloakContainerTest.java +++ b/src/test/java/dasniko/testcontainers/keycloak/KeycloakContainerTest.java @@ -176,8 +176,7 @@ private void checkKeycloakContainerInternals(KeycloakContainer keycloak) { Keycloak keycloakAdminClient = keycloak.getKeycloakAdminClient(); ServerInfoRepresentation serverInfo = keycloakAdminClient.serverInfo().getInfo(); assertThat(serverInfo, notNullValue()); - assertThat(serverInfo.getSystemInfo().getVersion(), startsWith("999.0.0-SNAPSHOT")); -// assertThat(serverInfo.getSystemInfo().getVersion(), startsWith(keycloak.getKeycloakDefaultVersion())); + assertThat(serverInfo.getSystemInfo().getVersion(), startsWith(keycloak.getKeycloakDefaultVersion())); } private String getMetricsUrl(KeycloakContainer keycloak) {