aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-05-23 10:19:51 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-05-24 15:06:42 +0200
commit5d0455588bf6343bb7d6d29217142a3827b3ebf4 (patch)
tree803a1a42e8474f027fe0469344e9ca77a16a2379 /server
parent3ead665e2f3ce5de27445424d5aa7b05561156ee (diff)
downloadsonarqube-5d0455588bf6343bb7d6d29217142a3827b3ebf4.tar.gz
sonarqube-5d0455588bf6343bb7d6d29217142a3827b3ebf4.zip
SONAR-8913 Replace "snapshotDate" by "analysisDate" in api/navigation/component
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java5
-rw-r--r--server/sonar-server/src/main/resources/org/sonar/server/ui/ws/component-example.json2
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_component_info_when_snapshot.json2
3 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
index c761ba3a480..2f216ef4e4b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
@@ -38,7 +38,6 @@ import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService.NewAction;
import org.sonar.api.server.ws.WebService.NewController;
-import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.text.JsonWriter;
import org.sonar.api.web.UserRole;
import org.sonar.api.web.page.Page;
@@ -64,6 +63,7 @@ import org.sonar.server.ui.PageRepository;
import org.sonar.server.user.UserSession;
import static org.sonar.api.measures.CoreMetrics.QUALITY_PROFILES_KEY;
+import static org.sonar.api.utils.DateUtils.formatDateTime;
import static org.sonar.api.web.UserRole.ADMIN;
import static org.sonar.api.web.UserRole.USER;
import static org.sonar.db.permission.OrganizationPermission.ADMINISTER_QUALITY_GATES;
@@ -181,7 +181,8 @@ public class ComponentAction implements NavigationWsAction {
List<Page> pages = pageRepository.getComponentPages(false, component.qualifier());
writeExtensions(json, component, pages);
if (analysis != null) {
- json.prop("version", analysis.getVersion()).prop("snapshotDate", DateUtils.formatDateTime(new Date(analysis.getCreatedAt())));
+ json.prop("version", analysis.getVersion())
+ .prop("analysisDate", formatDateTime(new Date(analysis.getCreatedAt())));
}
}
diff --git a/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/component-example.json b/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/component-example.json
index b9275d0bd22..b6968301a3c 100644
--- a/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/component-example.json
+++ b/server/sonar-server/src/main/resources/org/sonar/server/ui/ws/component-example.json
@@ -6,7 +6,7 @@
"description": "Open source platform for continuous inspection of code quality",
"isFavorite": true,
"version": "6.3",
- "snapshotDate": "2016-12-06T11:44:00+0200",
+ "analysisDate": "2016-12-06T11:44:00+0200",
"extensions": [
{
"key": "my_plugin/first_page",
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_component_info_when_snapshot.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_component_info_when_snapshot.json
index 1303f9901d9..ffc0a989a93 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_component_info_when_snapshot.json
+++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_component_info_when_snapshot.json
@@ -5,7 +5,7 @@
"name": "Polop",
"description": "test project",
"isFavorite": false,
- "snapshotDate": "2015-04-22T11:44:00+0200",
+ "analysisDate": "2015-04-22T11:44:00+0200",
"version": "3.14",
"breadcrumbs": [
{