From 0478598a4348f4d167ed48d6efb6000195395b85 Mon Sep 17 00:00:00 2001 From: Alain Kermis Date: Wed, 24 Jul 2024 11:55:46 +0200 Subject: [PATCH] SONAR-22479 Fixing issues --- .../ProjectCppAutoconfigTelemetryProviderIT.java | 14 ++++++++------ .../ProjectCppAutoconfigTelemetryProvider.java | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/sonar-webserver/src/it/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProviderIT.java b/server/sonar-webserver/src/it/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProviderIT.java index ee6c1f578e9..666965be5cc 100644 --- a/server/sonar-webserver/src/it/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProviderIT.java +++ b/server/sonar-webserver/src/it/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProviderIT.java @@ -88,9 +88,10 @@ class ProjectCppAutoconfigTelemetryProviderIT { Map actualResult = underTest.getUuidValues(); - assertThat(actualResult).hasSize(2); - assertThat(actualResult).containsExactlyInAnyOrderEntriesOf(Map.of(project1.getProjectDto().getUuid(), "AUTOCONFIG", - project2.getProjectDto().getUuid(), "AUTOCONFIG")); + assertThat(actualResult).hasSize(2) + .containsExactlyInAnyOrderEntriesOf( + Map.of(project1.getProjectDto().getUuid(), "AUTOCONFIG", project2.getProjectDto().getUuid(), "AUTOCONFIG") + ); } @Test @@ -116,9 +117,10 @@ class ProjectCppAutoconfigTelemetryProviderIT { Map actualResult = underTest.getUuidValues(); - assertThat(actualResult).hasSize(2); - assertThat(actualResult).containsExactlyInAnyOrderEntriesOf(Map.of(project1.getProjectDto().getUuid(), "BW_DEPRECATED", - project2.getProjectDto().getUuid(), "COMPDB")); + assertThat(actualResult).hasSize(2) + .containsExactlyInAnyOrderEntriesOf( + Map.of(project1.getProjectDto().getUuid(), "BW_DEPRECATED", project2.getProjectDto().getUuid(), "COMPDB") + ); } private Consumer configureLiveMeasure(String language, MetricDto metric, ProjectDto project, ComponentDto componentDto) { diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProvider.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProvider.java index 6473c1238e2..64f5130a359 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProvider.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProvider.java @@ -65,7 +65,7 @@ public class ProjectCppAutoconfigTelemetryProvider implements TelemetryDataProvi public Map getUuidValues() { Map cppConfigTypePerProjectUuid = new HashMap<>(); try (DbSession dbSession = dbClient.openSession(true)) { - //TODO in the feature ideally languages should be defined in the codebase as enums, using strings is error-prone + // In the future ideally languages should be defined in the codebase as enums, using strings is error-prone List cppProjects = dbClient.projectDao().selectProjectsByLanguage(dbSession, Set.of("cpp", "c")); for (ProjectDto cppProject : cppProjects) { CppConfigType cppConfigType = getCppConfigType(cppProject, dbSession); -- 2.39.5