From: Teryk Bellahsene Date: Thu, 26 Nov 2015 13:38:34 +0000 (+0100) Subject: Improve Dateutils code coverage X-Git-Tag: 5.3-RC1~152 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e8c98eb49ac4798b12cdba1ce07af96187c96ed;p=sonarqube.git Improve Dateutils code coverage --- diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java index d2ac50d6ea8..da9e66eca7e 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java @@ -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");