aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-telemetry/src
diff options
context:
space:
mode:
authorAnita Stanisz <106669481+anita-stanisz-sonarsource@users.noreply.github.com>2024-11-22 11:08:07 +0100
committersonartech <sonartech@sonarsource.com>2024-11-29 20:03:07 +0000
commitdfe8c0a21bd4b817b18a212ee4f59ed4ad0e05a7 (patch)
treebd40e0b222a3a13bea83bdffe4dd68930bd65c01 /server/sonar-telemetry/src
parentef4ed37bdfa1b2591a6d1b1df259384bf0270713 (diff)
downloadsonarqube-dfe8c0a21bd4b817b18a212ee4f59ed4ad0e05a7.tar.gz
sonarqube-dfe8c0a21bd4b817b18a212ee4f59ed4ad0e05a7.zip
SONAR-23619 Rename ai_code_assurance_column (#12320)
Diffstat (limited to 'server/sonar-telemetry/src')
-rw-r--r--server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java12
-rw-r--r--server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java2
2 files changed, 7 insertions, 7 deletions
diff --git a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java
index 21da1debbaf..93b375711a4 100644
--- a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java
+++ b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java
@@ -183,8 +183,8 @@ class TelemetryDataLoaderImplIT {
MetricDto coverage = db.measures().insertMetric(m -> m.setKey(COVERAGE_KEY));
MetricDto nclocDistrib = db.measures().insertMetric(m -> m.setKey(NCLOC_LANGUAGE_DISTRIBUTION_KEY));
- ProjectData projectData1 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setAiCodeAssurance(true));
- when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData1.getProjectDto().getAiCodeAssurance())).thenReturn(true);
+ ProjectData projectData1 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setContainsAiCode(true));
+ when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData1.getProjectDto().getContainsAiCode())).thenReturn(true);
ComponentDto mainBranch1 = projectData1.getMainBranchComponent();
var branch1 = db.components().insertProjectBranch(mainBranch1, branchDto -> branchDto.setKey("reference"));
@@ -202,8 +202,8 @@ class TelemetryDataLoaderImplIT {
db.measures().insertMeasure(branch1, m -> m.addValue(technicalDebtDto.getKey(), 6d));
db.measures().insertMeasure(branch2, m -> m.addValue(technicalDebtDto.getKey(), 7d));
- ProjectData projectData2 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setAiCodeAssurance(false));
- when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData2.getProjectDto().getAiCodeAssurance())).thenReturn(false);
+ ProjectData projectData2 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setContainsAiCode(false));
+ when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData2.getProjectDto().getContainsAiCode())).thenReturn(false);
ComponentDto mainBranch2 = projectData2.getMainBranchComponent();
db.measures().insertMeasure(mainBranch2, m -> m.addValue(lines.getKey(), 200d));
@@ -542,9 +542,9 @@ class TelemetryDataLoaderImplIT {
void load_shouldContainCorrectAiCodeAssuranceField(boolean expected) {
ProjectDto project1 = db.components().insertPublicProject(componentDto -> {
},
- projectDto -> projectDto.setAiCodeAssurance(expected)).getProjectDto();
+ projectDto -> projectDto.setContainsAiCode(expected)).getProjectDto();
- when(aiCodeAssuranceVerifier.isAiCodeAssured(project1.getAiCodeAssurance())).thenReturn(expected);
+ when(aiCodeAssuranceVerifier.isAiCodeAssured(project1.getContainsAiCode())).thenReturn(expected);
TelemetryData data = communityUnderTest.load();
diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java
index c133c57afb0..7d346f0d094 100644
--- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java
+++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java
@@ -334,7 +334,7 @@ public class TelemetryDataLoaderImpl implements TelemetryDataLoader {
.setExternalSecurityReportExportedAt(securityReportExportedAtByProjectUuid.get(projectUuid))
.setCreationMethod(project.getCreationMethod())
.setMonorepo(resolveMonorepo(almAndUrlAndMonorepoByProject, projectUuid))
- .setIsAiCodeAssured(aiCodeAssuranceVerifier.isAiCodeAssured(project.getAiCodeAssurance()))
+ .setIsAiCodeAssured(aiCodeAssuranceVerifier.isAiCodeAssured(project.getContainsAiCode()))
.build();
projectStatistics.add(stats);
}