aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/sonarsource/scanner/cli/CliTest.java
diff options
context:
space:
mode:
authormickael-caro-sonarsource <mickael.caro@sonarsource.com>2020-06-22 13:27:00 +0200
committerGitHub <noreply@github.com>2020-06-22 13:27:00 +0200
commit38398d7c11f3ef6866d834017e4b2d2c1c6409b7 (patch)
treee2ce87af64650d888233bec4130fd2214a8f4192 /src/test/java/org/sonarsource/scanner/cli/CliTest.java
parent90a36e384448c3f3b419ddfbab3071e00392d267 (diff)
downloadsonar-scanner-cli-38398d7c11f3ef6866d834017e4b2d2c1c6409b7.tar.gz
sonar-scanner-cli-38398d7c11f3ef6866d834017e4b2d2c1c6409b7.zip
SQSCANNER-65 Add a new flag to get the Scanner that invoked the CLI a… (#84)
* SQSCANNER-65 Add a new flag to get the Scanner that invoked the CLI and its version from the invocation commandLine
Diffstat (limited to 'src/test/java/org/sonarsource/scanner/cli/CliTest.java')
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/CliTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/CliTest.java b/src/test/java/org/sonarsource/scanner/cli/CliTest.java
index f7e2b88..252fe74 100644
--- a/src/test/java/org/sonarsource/scanner/cli/CliTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/CliTest.java
@@ -111,6 +111,19 @@ public class CliTest {
}
@Test
+ public void should_parse_from_argument() {
+ cli.parse(new String[] {"--from=ScannerMSBuild/4.8"});
+ assertThat(cli.getInvokedFrom()).isNotEmpty();
+ assertThat(cli.getInvokedFrom()).isEqualTo("ScannerMSBuild/4.8");
+ }
+
+ @Test
+ public void from_argument_is_only_from_let_value_empty() {
+ cli.parse(new String[] {"--from="});
+ assertThat(cli.getInvokedFrom()).isEmpty();
+ }
+
+ @Test
public void should_disable_debug_mode_and_stacktrace_log_by_default() {
cli.parse(new String[0]);
assertThat(cli.isDebugEnabled()).isFalse();