aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-05-19 09:22:50 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-05-19 09:22:56 +0200
commitb1dbf8af3052f1da11714e36f2a92dd31776be1c (patch)
treee718d8556a677c8f7713cca93e9377d14773dc5e
parent90f751a88686cb2f55c7d440572d9aa44c7083af (diff)
downloadsonarqube-b1dbf8af3052f1da11714e36f2a92dd31776be1c.tar.gz
sonarqube-b1dbf8af3052f1da11714e36f2a92dd31776be1c.zip
SONAR-7637 WS api/issues/search 'createdAt' facet compute from GTM instead of to GMT
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index 6102b9b1900..e4308332dc1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -475,7 +475,7 @@ public class IssueIndex extends BaseIndex {
bucketSize = DateHistogram.Interval.MONTH;
}
- int offsetInSeconds = system.getDefaultTimeZone().getRawOffset() / 1_000;
+ int offsetInSeconds = -system.getDefaultTimeZone().getRawOffset() / 1_000;
AggregationBuilder dateHistogram = AggregationBuilders.dateHistogram(CREATED_AT)
.field(IssueIndexDefinition.FIELD_ISSUE_FUNC_CREATED_AT)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
index f70375960f7..b684a2ec4a6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
@@ -84,7 +84,7 @@ public class IssueIndexTest {
issueAuthorizationIndexer = new IssueAuthorizationIndexer(null, tester.client());
viewIndexer = new ViewIndexer(null, tester.client());
System2 system = mock(System2.class);
- when(system.getDefaultTimeZone()).thenReturn(TimeZone.getTimeZone("GMT+1:00"));
+ when(system.getDefaultTimeZone()).thenReturn(TimeZone.getTimeZone("GMT-1:00"));
when(system.now()).thenReturn(System.currentTimeMillis());
index = new IssueIndex(tester.client(), system, userSessionRule);