diff options
Diffstat (limited to 'src/test/java/org/sonarsource/scanner/cli/MainTest.java')
-rw-r--r-- | src/test/java/org/sonarsource/scanner/cli/MainTest.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java index 3b5b07e..85f233c 100644 --- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java @@ -300,23 +300,36 @@ public class MainTest { } @Test + public void should_set_bootstrap_start_time_in_millis() { + Properties analysisProps = execute("sonar.scanner.bootstrapStartTime", "1714137496104"); + assertThat(analysisProps.getProperty("sonar.scanner.bootstrapStartTime")).isEqualTo("1714137496104"); + } + + @Test public void should_configure_logging_debug() { Properties analysisProps = testLogging("sonar.log.level", "DEBUG"); assertThat(analysisProps.getProperty("sonar.log.level")).isEqualTo("DEBUG"); } private Properties testLogging(String propKey, String propValue) { + Properties actualProps = execute(propKey, propValue); + + // Logger used for callback should have debug enabled + verify(logs).setDebugEnabled(true); + + return actualProps; + } + + private Properties execute(String propKey, String propValue) { Properties p = new Properties(); p.put(propKey, propValue); + when(conf.properties()).thenReturn(p); when(cli.getInvokedFrom()).thenReturn(""); Main main = new Main(exit, cli, conf, scannerFactory, logs); main.execute(); - // Logger used for callback should have debug enabled - verify(logs).setDebugEnabled(true); - ArgumentCaptor<Properties> propertiesCapture = ArgumentCaptor.forClass(Properties.class); verify(scanner).execute((Map) propertiesCapture.capture()); |