]> source.dussan.org Git - sonarqube.git/commitdiff
Use DateUtils.parseDateTime instead of DateUtils.parseDate in test to fix timezone...
authorJulien Lancelot <julien.lancelot@gmail.com>
Mon, 19 Aug 2013 08:33:48 +0000 (10:33 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Mon, 19 Aug 2013 08:33:48 +0000 (10:33 +0200)
sonar-batch/src/test/java/org/sonar/batch/scan/DeprecatedJsonReportTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/JsonReportTest.java

index 2bd6062a195d8b5b50be3ce52c799594158f2870..00af2f5e558424819452b8b9ad503512233914e3 100644 (file)
@@ -85,7 +85,7 @@ public class DeprecatedJsonReportTest {
     issue.setRuleKey(RuleKey.of("squid", "AvoidCycles"));
     issue.setSeverity(Severity.INFO);
     issue.setResolution(Issue.RESOLUTION_FALSE_POSITIVE);
-    issue.setCreationDate(DateUtils.parseDate("2013-01-30"));
+    issue.setCreationDate(DateUtils.parseDateTime("2013-01-30T00:00:00+0000"));
     issue.setNew(true);
     when(ruleI18nManager.getName("squid", "AvoidCycles", Locale.getDefault())).thenReturn("Avoid Cycles");
     doReturn(Arrays.asList(issue)).when(deprecatedJsonReport).getIssues(resource);
@@ -110,7 +110,7 @@ public class DeprecatedJsonReportTest {
     issue.setSeverity(Severity.INFO);
     issue.setResolution(null);
     issue.setNew(false);
-    issue.setCreationDate(DateUtils.parseDate("2013-01-30"));
+    issue.setCreationDate(DateUtils.parseDateTime("2013-01-30T00:00:00+0000"));
     when(ruleI18nManager.getName("squid", "AvoidCycles", Locale.getDefault())).thenReturn("Avoid Cycles");
     doReturn(Arrays.asList(issue)).when(deprecatedJsonReport).getIssues(resource);
 
index 71cf7d91048c738fe6c462100aabb4551ec334ed..ce265bcfce2a5ed7e9d1e91ba82d29b2a882cbc3 100644 (file)
@@ -97,8 +97,8 @@ public class JsonReportTest {
         .setEffortToFix(3.14)
         .setReporter("julien")
         .setAssignee("simon")
-        .setCreationDate(DateUtils.parseDate("2013-04-24"))
-        .setUpdateDate(DateUtils.parseDate("2013-04-25"))
+        .setCreationDate(DateUtils.parseDateTime("2013-04-24T00:00:00+0000"))
+        .setUpdateDate(DateUtils.parseDateTime("2013-04-25T00:00:00+0000"))
         .setNew(false);
     when(ruleI18nManager.getName("squid", "AvoidCycles", Locale.getDefault())).thenReturn("Avoid Cycles");
     when(jsonReport.getIssues()).thenReturn(Lists.<DefaultIssue> newArrayList(issue));
@@ -118,9 +118,9 @@ public class JsonReportTest {
         .setRuleKey(RuleKey.of("squid", "AvoidCycles"))
         .setStatus(Issue.STATUS_CLOSED)
         .setResolution(Issue.RESOLUTION_FIXED)
-        .setCreationDate(DateUtils.parseDate("2013-04-24"))
-        .setUpdateDate(DateUtils.parseDate("2013-04-25"))
-        .setCloseDate(DateUtils.parseDate("2013-04-26"))
+        .setCreationDate(DateUtils.parseDateTime("2013-04-24T00:00:00+0000"))
+        .setUpdateDate(DateUtils.parseDateTime("2013-04-25T00:00:00+0000"))
+        .setCloseDate(DateUtils.parseDateTime("2013-04-26T00:00:00+0000"))
         .setNew(false);
     when(ruleI18nManager.getName("squid", "AvoidCycles", Locale.getDefault())).thenReturn("Avoid Cycles");
     when(jsonReport.getIssues()).thenReturn(Lists.<DefaultIssue> newArrayList(issue));