From bb1284704d303b8af2e477f636b11e1c7d7f7aa3 Mon Sep 17 00:00:00 2001 From: Peter Zaoral Date: Wed, 22 May 2024 19:19:57 +0200 Subject: [PATCH] Enhance StartDevCommandDistTest to detect problems with URI scheme on Windows (#29593) * added a test - a Windows drive letter within URI can cause issues Related-to: #29329 Signed-off-by: Peter Zaoral --- .../it/cli/dist/StartDevCommandDistTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartDevCommandDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartDevCommandDistTest.java index 8fe62b7333..eb17db8c5b 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartDevCommandDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/StartDevCommandDistTest.java @@ -22,9 +22,16 @@ import io.quarkus.test.junit.main.LaunchResult; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.OS; import org.keycloak.it.junit5.extension.CLIResult; import org.keycloak.it.junit5.extension.DistributionTest; import org.keycloak.it.junit5.extension.RawDistOnly; +import org.keycloak.it.utils.KeycloakDistribution; + +import java.nio.file.Paths; + +import static org.junit.jupiter.api.Assertions.assertTrue; @DistributionTest @RawDistOnly(reason = "Containers are immutable") @@ -68,4 +75,15 @@ public class StartDevCommandDistTest { cliResult.assertStartedDevMode(); } + @Test + @DisabledOnOs(value = { OS.LINUX, OS.MAC }, disabledReason = "A drive letter in URI can cause a problem.") + void testConfigKeystoreAbsolutePath(KeycloakDistribution dist) { + CLIResult cliResult = dist.run("start-dev", "--config-keystore=" + Paths.get("src/test/resources/keystore").toAbsolutePath().normalize(), + "--config-keystore-password=secret"); + assertTrue(cliResult.getOutput().contains("DEBUG [org.hibernate")); + assertTrue(cliResult.getOutput().contains("DEBUG [org.keycloak")); + assertTrue(cliResult.getOutput().contains("Listening on:")); + cliResult.assertStartedDevMode(); + } + }