From 1affe1fe830e4e17e50fdf9d801ce4b499a3bdb0 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 8 Mar 2016 18:42:05 +0100 Subject: SONARUNNER-152 Scanner does not log Server version --- src/test/java/org/sonarsource/scanner/cli/MainTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/test/java') diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java index e2fd69c..1936ca8 100644 --- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java @@ -150,6 +150,18 @@ public class MainTest { inOrder.verify(shutdown, times(1)).exit(Exit.SUCCESS); } + @Test + public void shouldLogServerVersion() throws IOException { + when(runner.serverVersion()).thenReturn("5.5"); + Properties p = new Properties(); + when(cli.isDisplayVersionOnly()).thenReturn(true); + when(conf.properties()).thenReturn(p); + + Main main = new Main(shutdown, cli, conf, runnerFactory, logs); + main.execute(); + verify(logs).info("SonarQube server 5.5"); + } + @Test public void should_configure_logging() throws IOException { Properties p = new Properties(); -- cgit v1.2.3