]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Improve coverage
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 16 Sep 2016 12:19:57 +0000 (14:19 +0200)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 16 Sep 2016 12:19:57 +0000 (14:19 +0200)
src/test/java/org/sonarsource/scanner/cli/LogsTest.java

index cc8ab382d4578433a0f9f869d7ab9b070d37a676..bda9d28fc466fc079d2a9843f919d200f50353ed 100644 (file)
@@ -51,6 +51,21 @@ public class LogsTest {
     verify(stdOut).println("INFO: info");
     verifyNoMoreInteractions(stdOut, stdErr);
   }
+  
+  @Test
+  public void testWarn() {
+    logs.warn("warn");
+    verify(stdErr).println("WARN: warn");
+    verifyNoMoreInteractions(stdOut, stdErr);
+  }
+  
+  @Test
+  public void testWarnWithTimestamp() {
+    logs.setDebugEnabled(true);
+    logs.warn("warn");
+    verify(stdErr).println(Matchers.matches("\\d\\d:\\d\\d:\\d\\d.\\d\\d\\d WARN: warn"));
+    verifyNoMoreInteractions(stdOut, stdErr);
+  }
 
   @Test
   public void testError() {