From 1fb4fa71017a200b11e5234db82885eb88b72499 Mon Sep 17 00:00:00 2001 From: Alain Kermis Date: Fri, 27 Sep 2024 12:13:01 +0200 Subject: [PATCH] SONAR-23207 Fix telemetry metrics for Cpp autoconfig --- .../it/java/org/sonar/db/project/ProjectDaoIT.java | 6 +++--- .../resources/org/sonar/db/project/ProjectMapper.xml | 12 +++++++----- .../ProjectCppAutoconfigTelemetryProviderIT.java | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectDaoIT.java b/server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectDaoIT.java index 6209b00b976..3f4003019cf 100644 --- a/server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectDaoIT.java +++ b/server/sonar-db-dao/src/it/java/org/sonar/db/project/ProjectDaoIT.java @@ -488,17 +488,17 @@ class ProjectDaoIT { .collect(Collectors.toSet()); } - private Consumer configureLiveMeasure(String language, MetricDto metric, ProjectDto project, ComponentDto componentDto) { + private Consumer configureLiveMeasure(String language, MetricDto metric, ComponentDto componentDto) { return liveMeasure -> liveMeasure .setMetricUuid(metric.getUuid()) .setComponentUuid(componentDto.uuid()) - .setProjectUuid(project.getUuid()) + .setProjectUuid(componentDto.uuid()) .setData(language + "=" + random.nextInt(10)); } private Consumer insertLiveMeasure(String language, MetricDto metric) { return (projectData) -> db.measures().insertLiveMeasure(projectData.getMainBranchComponent(), metric, - configureLiveMeasure(language, metric, projectData.getProjectDto(), projectData.getMainBranchComponent())); + configureLiveMeasure(language, metric, projectData.getMainBranchComponent())); } private void insertProjectsLiveMeasures(String language, Set projects) { diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml index abfd58f2f88..575a4356117 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectMapper.xml @@ -129,15 +129,15 @@