From d9376179e8d3fe1534f0c0d3ef3f04db78d4d85e Mon Sep 17 00:00:00 2001 From: Mark Rekveld Date: Mon, 28 Sep 2020 13:21:48 +0200 Subject: SQSCANNER-67 - Warn on duplicate property definitions (#89) --- src/test/java/org/sonarsource/scanner/cli/CliTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test/java/org') diff --git a/src/test/java/org/sonarsource/scanner/cli/CliTest.java b/src/test/java/org/sonarsource/scanner/cli/CliTest.java index 5a81e11..2c49c34 100644 --- a/src/test/java/org/sonarsource/scanner/cli/CliTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/CliTest.java @@ -47,6 +47,14 @@ public class CliTest { assertThat(cli.properties().get("boolean")).isEqualTo("true"); } + @Test + public void should_warn_on_duplicate_properties() { + logs = mock(Logs.class); + cli = new Cli(exit, logs); + cli.parse(new String[] {"-D", "foo=bar", "--define", "foo=baz"}); + verify(logs).warn("Property 'foo' with value 'bar' is overridden with value 'baz'"); + } + @Test public void should_fail_on_missing_prop() { logs = mock(Logs.class); -- cgit v1.2.3