diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/sonarsource/scanner/cli/MainTest.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java index 06adc9d..450d0a7 100644 --- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java @@ -29,6 +29,7 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.sonarsource.scanner.api.EmbeddedScanner; +import org.sonarsource.scanner.api.ScanProperties; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Matchers.any; @@ -150,6 +151,23 @@ public class MainTest { inOrder.verify(runnerFactory, times(1)).create(p); inOrder.verify(exit, times(1)).exit(Exit.SUCCESS); } + + @Test + public void should_skip() throws IOException { + Properties p = new Properties(); + p.setProperty(ScanProperties.SKIP, "true"); + when(conf.properties()).thenReturn(p); + + Main main = new Main(exit, cli, conf, runnerFactory, logs); + main.execute(); + + verify(logs).info("SonarQube Scanner analysis skipped"); + InOrder inOrder = Mockito.inOrder(exit, runnerFactory); + + inOrder.verify(exit, times(1)).exit(Exit.SUCCESS); + inOrder.verify(runnerFactory, times(1)).create(p); + inOrder.verify(exit, times(1)).exit(Exit.SUCCESS); + } @Test public void shouldLogServerVersion() throws IOException { |