Skip to content

Commit

Permalink
Test properties containing a double-quote alone with q/dev/io.quarkus…
Browse files Browse the repository at this point in the history
….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.
  • Loading branch information
yrodiere committed Oct 4, 2022
1 parent a034d9f commit a301634
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.
* <p>
* 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"));
}
}

0 comments on commit a301634

Please sign in to comment.