aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-26 14:38:34 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-11-26 14:38:34 +0100
commit6e8c98eb49ac4798b12cdba1ce07af96187c96ed (patch)
tree6de5bcc4b105849f0b8ba94fa24575eb4dd049d1 /sonar-plugin-api/src
parentdf6056565d26a3defd654702f79d2ef3340fc466 (diff)
downloadsonarqube-6e8c98eb49ac4798b12cdba1ce07af96187c96ed.tar.gz
sonarqube-6e8c98eb49ac4798b12cdba1ce07af96187c96ed.zip
Improve Dateutils code coverage
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java6
1 files changed, 6 insertions, 0 deletions
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
@@ -103,6 +103,12 @@ public class DateUtilsTest {
}
@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");
assertThat(DateUtils.formatDateTimeNullSafe(new Date()).length()).isGreaterThan(20);