diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-03-17 10:00:17 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-03-17 10:00:17 +0100 |
commit | 707572f2a6702c04d4941d2cb41382ef9853284d (patch) | |
tree | d69d8f28c700c3244b02c144ff663ff4512f4c38 /sonar-batch/src | |
parent | 7f32a128f3997c0fe8fa32b3462129faace2c154 (diff) | |
download | sonarqube-707572f2a6702c04d4941d2cb41382ef9853284d.tar.gz sonarqube-707572f2a6702c04d4941d2cb41382ef9853284d.zip |
Revert "Remove use of DateUtils.truncate since it is not efficient"
This reverts commit 46e1d76cc3814518f23b65132e5a8f083bb707a5.
Diffstat (limited to 'sonar-batch/src')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java b/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java index 5ac780e3883..7ffa9905721 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/issue/ModuleIssuesTest.java @@ -19,6 +19,7 @@ */ package org.sonar.batch.issue; +import org.apache.commons.lang.time.DateUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -39,6 +40,7 @@ import org.sonar.api.rules.Violation; import org.sonar.api.utils.Duration; import org.sonar.api.utils.MessageException; +import java.util.Calendar; import java.util.Date; import static org.assertj.core.api.Assertions.assertThat; @@ -152,7 +154,7 @@ public class ModuleIssuesTest { ArgumentCaptor<DefaultIssue> argument = ArgumentCaptor.forClass(DefaultIssue.class); verify(cache).put(argument.capture()); assertThat(argument.getValue().severity()).isEqualTo(Severity.CRITICAL); - assertThat(argument.getValue().creationDate()).isEqualTo(analysisDate); + assertThat(argument.getValue().creationDate()).isEqualTo(DateUtils.truncate(analysisDate, Calendar.SECOND)); } @Test @@ -171,7 +173,7 @@ public class ModuleIssuesTest { ArgumentCaptor<DefaultIssue> argument = ArgumentCaptor.forClass(DefaultIssue.class); verify(cache).put(argument.capture()); assertThat(argument.getValue().severity()).isEqualTo(Severity.INFO); - assertThat(argument.getValue().creationDate()).isEqualTo(analysisDate); + assertThat(argument.getValue().creationDate()).isEqualTo(DateUtils.truncate(analysisDate, Calendar.SECOND)); } @Test |