Skip to content

Commit 7c8ff26

Browse files
yrodieregsmet
authored andcommitted
Test properties containing a double-quote alone with q/dev/io.quarkus.quarkus-vertx-http/config
In particular the environment variable `__INTELLIJ_COMMAND_HISTFILE__`, translated to `%.intellij.command.histfile.`, seems to be giving that page a hard time. (cherry picked from commit a301634)
1 parent d57a215 commit 7c8ff26

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package io.quarkus.vertx.http.devconsole;
2+
3+
import org.hamcrest.Matchers;
4+
import org.junit.jupiter.api.Test;
5+
import org.junit.jupiter.api.extension.RegisterExtension;
6+
7+
import io.quarkus.test.QuarkusDevModeTest;
8+
import io.restassured.RestAssured;
9+
10+
/**
11+
* Tests that a system property such as {@code %.intellij.command.histfile."}
12+
* doesn't lead to an exception because {@code "} is incorrectly seen as a quoted property.
13+
* <p>
14+
* Originally the bug stemmed from an environment property {@code __INTELLIJ_COMMAND_HISTFILE__}
15+
* which was (weirdly) interpreted as {@code %.intellij.command.histfile."},
16+
* but it's much easier to test system properties (which are mutable)
17+
* than environment properties.
18+
*/
19+
public class DevConsoleConfigMisinterpretedDoubleUnderscoreTest {
20+
21+
@RegisterExtension
22+
static final QuarkusDevModeTest config = new QuarkusDevModeTest()
23+
.setBuildSystemProperty("%.intellij.command.histfile.\"", "foo")
24+
.withEmptyApplication();
25+
26+
@Test
27+
public void testNoFailure() {
28+
RestAssured.get("q/dev/io.quarkus.quarkus-vertx-http/config")
29+
.then()
30+
.statusCode(200).body(Matchers.containsString("Config Editor"));
31+
}
32+
}

0 commit comments

Comments
 (0)