]> source.dussan.org Git - sonarqube.git/commitdiff
Improve Dateutils code coverage
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 26 Nov 2015 13:38:34 +0000 (14:38 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 26 Nov 2015 13:38:34 +0000 (14:38 +0100)
sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java

index d2ac50d6ea8b72804eb77928317fd71a10f5256e..da9e66eca7e1d7d75d043d3e7213a89391b89f5e 100644 (file)
@@ -102,6 +102,12 @@ public class DateUtilsTest {
     assertThat(DateUtils.formatDateTime(new Date()).length()).isGreaterThan(20);
   }
 
+  @Test
+  public void shouldFormatDateTime_with_long() {
+    assertThat(DateUtils.formatDateTime(System.currentTimeMillis())).startsWith("20");
+    assertThat(DateUtils.formatDateTime(System.currentTimeMillis()).length()).isGreaterThan(20);
+  }
+
   @Test
   public void format_date_time_null_safe() {
     assertThat(DateUtils.formatDateTimeNullSafe(new Date())).startsWith("20");