diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/devconsole/DevConsoleConfigMisinterpretedDoubleUnderscoreTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/devconsole/DevConsoleConfigMisinterpretedDoubleUnderscoreTest.java new file mode 100644 index 0000000000000..519d8d758578a --- /dev/null +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/devconsole/DevConsoleConfigMisinterpretedDoubleUnderscoreTest.java @@ -0,0 +1,32 @@ +package io.quarkus.vertx.http.devconsole; + +import org.hamcrest.Matchers; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusDevModeTest; +import io.restassured.RestAssured; + +/** + * Tests that a system property such as {@code %.intellij.command.histfile."} + * doesn't lead to an exception because {@code "} is incorrectly seen as a quoted property. + *
+ * Originally the bug stemmed from an environment property {@code __INTELLIJ_COMMAND_HISTFILE__} + * which was (weirdly) interpreted as {@code %.intellij.command.histfile."}, + * but it's much easier to test system properties (which are mutable) + * than environment properties. + */ +public class DevConsoleConfigMisinterpretedDoubleUnderscoreTest { + + @RegisterExtension + static final QuarkusDevModeTest config = new QuarkusDevModeTest() + .setBuildSystemProperty("%.intellij.command.histfile.\"", "foo") + .withEmptyApplication(); + + @Test + public void testNoFailure() { + RestAssured.get("q/dev/io.quarkus.quarkus-vertx-http/config") + .then() + .statusCode(200).body(Matchers.containsString("Config Editor")); + } +}