aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlain Kermis <alain.kermis@sonarsource.com>2024-07-24 11:55:46 +0200
committersonartech <sonartech@sonarsource.com>2024-07-24 20:02:49 +0000
commit0478598a4348f4d167ed48d6efb6000195395b85 (patch)
tree96cc9529959750bc9979b81e027ea6c017229c64 /server
parent1aab9733b140b305ce114a58ac756809fc5fe107 (diff)
downloadsonarqube-0478598a4348f4d167ed48d6efb6000195395b85.tar.gz
sonarqube-0478598a4348f4d167ed48d6efb6000195395b85.zip
SONAR-22479 Fixing issues
Diffstat (limited to 'server')
-rw-r--r--server/sonar-webserver/src/it/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProviderIT.java14
-rw-r--r--server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/ProjectCppAutoconfigTelemetryProvider.java2
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<String, String> 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<String, String> 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<LiveMeasureDto> 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<String, String> getUuidValues() {
Map<String, String> 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<ProjectDto> cppProjects = dbClient.projectDao().selectProjectsByLanguage(dbSession, Set.of("cpp", "c"));
for (ProjectDto cppProject : cppProjects) {
CppConfigType cppConfigType = getCppConfigType(cppProject, dbSession);