diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2019-09-03 15:59:11 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2019-09-05 10:03:19 +0200 |
commit | dae4decaa165461d2cdd52860e93fc6c2dd0f493 (patch) | |
tree | c0390097f8c018e8bdf49709ff1788efa21b8822 /src/test | |
parent | 3091d1bb8bfdb695942afdac41a5fa7c79a8ebc8 (diff) | |
download | sonar-scanner-cli-dae4decaa165461d2cdd52860e93fc6c2dd0f493.tar.gz sonar-scanner-cli-dae4decaa165461d2cdd52860e93fc6c2dd0f493.zip |
SQSCANNER-61 Consider 'project.settings' if set using SONARQUBE_SCANNER_PARAMS4.1.0.1829
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/sonarsource/scanner/cli/ConfTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java index a966b50..1dbbbec 100644 --- a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java @@ -316,4 +316,19 @@ public class ConfTest { properties = conf.properties(); assertThat(properties.get("sonar.prop")).isEqualTo("expected"); } + + // SQSCANNER-61 + @Test + public void should_load_project_settings_using_env() throws Exception { + Path home = Paths.get(getClass().getResource("ConfTest/shouldOverrideProjectSettingsPath/").toURI()); + args.setProperty("project.home", home.toAbsolutePath().toString()); + + Properties properties = conf.properties(); + assertThat(properties.get("sonar.prop")).isEqualTo("default"); + + env.put("SONARQUBE_SCANNER_PARAMS", "{\"project.settings\" : \"" + home.resolve("conf/sq-project.properties").toAbsolutePath().toString() + "\"}"); + + properties = conf.properties(); + assertThat(properties.get("sonar.prop")).isEqualTo("expected"); + } } |