diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java index 6db22c54691..5ecc227a1a7 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/QuarkusPropertiesDistTest.java @@ -22,9 +22,11 @@ import io.restassured.RestAssured; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Tag; 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.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import org.keycloak.it.junit5.extension.BeforeStartDistribution; import org.keycloak.it.junit5.extension.CLIResult; @@ -44,6 +46,7 @@ import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.OPTI @DistributionTest(reInstall = DistributionTest.ReInstall.NEVER) @RawDistOnly(reason = "Containers are immutable") +@Tag(DistributionTest.WIN) @TestMethodOrder(OrderAnnotation.class) public class QuarkusPropertiesDistTest { @@ -68,19 +71,38 @@ public class QuarkusPropertiesDistTest { @Test @Launch({"-Dquarkus.log.handler.console.\"console-2\".enable=false", "start", "--http-enabled=true", "--hostname-strict=false"}) + @DisabledOnOs(value = { OS.WINDOWS }) @Order(3) void testIgnoreQuarkusSystemPropertiesAtStart(CLIResult cliResult) { cliResult.assertMessage("Keycloak is the best"); } + @Test + @Launch({"-Dquarkus.log.handler.console.\\\"console-2\\\".enable=false", "start", "--http-enabled=true", "--hostname-strict=false"}) + @EnabledOnOs(value = { OS.WINDOWS }, disabledReason = "Different handling of quotes within arguments on Windows") + @Order(3) + void testIgnoreQuarkusSystemPropertiesAtStartWin(CLIResult cliResult) { + cliResult.assertMessage("Keycloak is the best"); + } + @Test @Launch({"-Dquarkus.log.handler.console.\"console-2\".enable=false", "build"}) + @DisabledOnOs(value = { OS.WINDOWS }) @Order(4) void testIgnoreQuarkusSystemPropertyAtBuild(CLIResult cliResult) { cliResult.assertMessage("Keycloak is the best"); cliResult.assertBuild(); } + @Test + @Launch({"-Dquarkus.log.handler.console.\\\"console-2\\\".enable=false", "build"}) + @EnabledOnOs(value = { OS.WINDOWS }, disabledReason = "Different handling of quotes within arguments on Windows") + @Order(4) + void testIgnoreQuarkusSystemPropertyAtBuildWin(CLIResult cliResult) { + cliResult.assertMessage("Keycloak is the best"); + cliResult.assertBuild(); + } + @DryRun @Test @BeforeStartDistribution(UpdateConsoleHandlerFromKeycloakConf.class) @@ -145,11 +167,21 @@ public class QuarkusPropertiesDistTest { @Test @Launch({ "start", "--http-enabled=true", "--hostname-strict=false", "--config-keystore=/invalid/path", "--config-keystore-password=secret" }) + @DisabledOnOs(value = { OS.WINDOWS }) @Order(11) void testInvalidSmallRyeKeyStorePathProperty(CLIResult cliResult) { cliResult.assertError("java.lang.IllegalArgumentException: config-keystore path does not exist: /invalid/path"); } + @Test + @Launch({ "start", "--http-enabled=true", "--hostname-strict=false", "--config-keystore=C:\\invalid\\path", + "--config-keystore-password=secret" }) + @EnabledOnOs(value = { OS.WINDOWS }, disabledReason = "Windows uses a different path separator.") + @Order(11) + void testInvalidSmallRyeKeyStorePathPropertyWin(CLIResult cliResult) { + cliResult.assertError("java.lang.IllegalArgumentException: config-keystore path does not exist: C:\\invalid\\path"); + } + @Test @Launch({ "start", "--http-enabled=true", "--hostname-strict=false", "--config-keystore=../../../../src/test/resources/keystore", "--config-keystore-password=secret" }) @@ -173,7 +205,7 @@ public class QuarkusPropertiesDistTest { @Test @BeforeStartDistribution(ForceRebuild.class) - @DisabledOnOs(value = { OS.LINUX, OS.MAC }, disabledReason = "Windows uses a different path separator.") + @EnabledOnOs(value = { OS.WINDOWS }, disabledReason = "Windows uses a different path separator.") @Launch({ "start", "--http-enabled=true", "--hostname-strict=false", "--https-certificate-file=C:\\tmp\\kc\\bin\\..\\conf/server.crt.pem", "--https-certificate-key-file=C:\\tmp\\kc\\bin\\..\\conf/server.key.pem" })