aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/sonarsource/scanner/cli
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-05-07 17:39:21 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2024-05-13 09:37:44 +0200
commit9e72835bb09a703c7bb91ba387fef09f881d5418 (patch)
tree5c2bd132588cdfc824bd550a052c297e7569ed09 /src/test/java/org/sonarsource/scanner/cli
parentf2df80dbd277ffa97d2d43f8e44368944d3e1e4b (diff)
downloadsonar-scanner-cli-9e72835bb09a703c7bb91ba387fef09f881d5418.tar.gz
sonar-scanner-cli-9e72835bb09a703c7bb91ba387fef09f881d5418.zip
Log improvements
Diffstat (limited to 'src/test/java/org/sonarsource/scanner/cli')
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/MainTest.java2
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/StatsTest.java3
2 files changed, 2 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 7b6ccfd..48b2ed3 100644
--- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
@@ -61,6 +61,7 @@ class MainTest {
void setUp() {
when(scannerEngineBootstrapperFactory.create(any(Properties.class), any(String.class))).thenReturn(bootstrapper);
when(bootstrapper.bootstrap()).thenReturn(engine);
+ when(engine.analyze(any())).thenReturn(true);
when(conf.properties()).thenReturn(properties);
}
@@ -223,7 +224,6 @@ class MainTest {
inOrder.verify(exit, times(1)).exit(Exit.SUCCESS);
inOrder.verify(scannerEngineBootstrapperFactory, times(1)).create(p, "");
- inOrder.verify(exit, times(1)).exit(Exit.SUCCESS);
}
@Test
diff --git a/src/test/java/org/sonarsource/scanner/cli/StatsTest.java b/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
index 4895640..174acbc 100644
--- a/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/StatsTest.java
@@ -34,9 +34,8 @@ class StatsTest {
void shouldPrintStats() {
new Stats().start().stop();
- assertThat(logTester.logs(Level.INFO)).hasSize(2);
+ assertThat(logTester.logs(Level.INFO)).hasSize(1);
assertThat(logTester.logs(Level.INFO).get(0)).startsWith("Total time: ");
- assertThat(logTester.logs(Level.INFO).get(1)).startsWith("Final Memory: ");
}
@Test