diff options
author | Alain Kermis <alain.kermis@sonarsource.com> | 2023-07-20 16:03:24 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-07-21 20:03:17 +0000 |
commit | 13f4b6670e24e6395138219f1a8e05873858997a (patch) | |
tree | 4345642b8d38405811e96a57f3e7e512426b4450 /server/sonar-webserver-core | |
parent | 5af64e5d3a4e5188f0e5c6c7ebf8adab4d3b0cbe (diff) | |
download | sonarqube-13f4b6670e24e6395138219f1a8e05873858997a.tar.gz sonarqube-13f4b6670e24e6395138219f1a8e05873858997a.zip |
SONAR-7698 Rename snapshots column build_date to analysis_date
Diffstat (limited to 'server/sonar-webserver-core')
2 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/telemetry/TelemetryDataLoaderImpl.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/telemetry/TelemetryDataLoaderImpl.java index 969e44fadc9..b8b1fdeabab 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/telemetry/TelemetryDataLoaderImpl.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/telemetry/TelemetryDataLoaderImpl.java @@ -316,7 +316,7 @@ public class TelemetryDataLoaderImpl implements TelemetryDataLoader { List<String> branchUuids = branchesWithLargestNcloc.stream().map(ProjectLocDistributionDto::branchUuid).toList(); Map<String, Long> latestSnapshotMap = dbClient.snapshotDao().selectLastAnalysesByRootComponentUuids(dbSession, branchUuids) .stream() - .collect(toMap(SnapshotDto::getRootComponentUuid, SnapshotDto::getBuildDate)); + .collect(toMap(SnapshotDto::getRootComponentUuid, SnapshotDto::getAnalysisDate)); data.setProjects(buildProjectsList(branchesWithLargestNcloc, latestSnapshotMap)); } diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java index 8e6040a6ce1..0bcc269bd82 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryDataLoaderImplTest.java @@ -185,8 +185,8 @@ public class TelemetryDataLoaderImplTest { db.measures().insertLiveMeasure(mainBranch2, coverage, m -> m.setValue(80d)); db.measures().insertLiveMeasure(mainBranch2, nclocDistrib, m -> m.setValue(null).setData("java=180;js=20")); - SnapshotDto project1Analysis = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setBuildDate(analysisDate)); - SnapshotDto project2Analysis = db.components().insertSnapshot(mainBranch2, t -> t.setLast(true).setBuildDate(analysisDate)); + SnapshotDto project1Analysis = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setAnalysisDate(analysisDate)); + SnapshotDto project2Analysis = db.components().insertSnapshot(mainBranch2, t -> t.setLast(true).setAnalysisDate(analysisDate)); db.measures().insertMeasure(mainBranch1, project1Analysis, nclocDistrib, m -> m.setData("java=70;js=30;kotlin=10")); db.measures().insertMeasure(mainBranch2, project2Analysis, nclocDistrib, m -> m.setData("java=180;js=20")); @@ -294,9 +294,9 @@ public class TelemetryDataLoaderImplTest { ProjectData projectData2 = db.components().insertPrivateProject(); ComponentDto mainBranch2 = projectData2.getMainBranchComponent(); - SnapshotDto project1Analysis1 = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setBuildDate(analysisDate)); - SnapshotDto project1Analysis2 = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setBuildDate(analysisDate)); - SnapshotDto project2Analysis = db.components().insertSnapshot(mainBranch2, t -> t.setLast(true).setBuildDate(analysisDate)); + SnapshotDto project1Analysis1 = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setAnalysisDate(analysisDate)); + SnapshotDto project1Analysis2 = db.components().insertSnapshot(mainBranch1, t -> t.setLast(true).setAnalysisDate(analysisDate)); + SnapshotDto project2Analysis = db.components().insertSnapshot(mainBranch2, t -> t.setLast(true).setAnalysisDate(analysisDate)); db.measures().insertMeasure(mainBranch1, project1Analysis1, qg, pm -> pm.setData("OK")); db.measures().insertMeasure(mainBranch1, project1Analysis2, qg, pm -> pm.setData("ERROR")); db.measures().insertMeasure(mainBranch2, project2Analysis, qg, pm -> pm.setData("ERROR")); |