diff options
author | Anita Stanisz <106669481+anita-stanisz-sonarsource@users.noreply.github.com> | 2024-11-25 14:43:25 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-29 20:03:07 +0000 |
commit | 2c496d7199d58ce76f1ec513220bde1127c68358 (patch) | |
tree | 22522442144f79bfd4cc70563dcaf3d16e3ad5b3 /server/sonar-telemetry/src | |
parent | b85729ae76a2b00d324f8f2460cdc47579582594 (diff) | |
download | sonarqube-2c496d7199d58ce76f1ec513220bde1127c68358.tar.gz sonarqube-2c496d7199d58ce76f1ec513220bde1127c68358.zip |
SONAR-23619 Update get_ai_code_assurance endpoint (#12342)
Diffstat (limited to 'server/sonar-telemetry/src')
2 files changed, 4 insertions, 4 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 93b375711a4..6580a0fd8b4 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 @@ -184,7 +184,7 @@ class TelemetryDataLoaderImplIT { MetricDto nclocDistrib = db.measures().insertMetric(m -> m.setKey(NCLOC_LANGUAGE_DISTRIBUTION_KEY)); ProjectData projectData1 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setContainsAiCode(true)); - when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData1.getProjectDto().getContainsAiCode())).thenReturn(true); + when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData1.getProjectDto())).thenReturn(true); ComponentDto mainBranch1 = projectData1.getMainBranchComponent(); var branch1 = db.components().insertProjectBranch(mainBranch1, branchDto -> branchDto.setKey("reference")); @@ -203,7 +203,7 @@ class TelemetryDataLoaderImplIT { db.measures().insertMeasure(branch2, m -> m.addValue(technicalDebtDto.getKey(), 7d)); ProjectData projectData2 = db.components().insertPrivateProject(ComponentDbTester.defaults(), projectDto -> projectDto.setContainsAiCode(false)); - when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData2.getProjectDto().getContainsAiCode())).thenReturn(false); + when(aiCodeAssuranceVerifier.isAiCodeAssured(projectData2.getProjectDto())).thenReturn(false); ComponentDto mainBranch2 = projectData2.getMainBranchComponent(); db.measures().insertMeasure(mainBranch2, m -> m.addValue(lines.getKey(), 200d)); @@ -544,7 +544,7 @@ class TelemetryDataLoaderImplIT { }, projectDto -> projectDto.setContainsAiCode(expected)).getProjectDto(); - when(aiCodeAssuranceVerifier.isAiCodeAssured(project1.getContainsAiCode())).thenReturn(expected); + when(aiCodeAssuranceVerifier.isAiCodeAssured(project1)).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 7d346f0d094..2d4e54bfe0d 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.getContainsAiCode())) + .setIsAiCodeAssured(aiCodeAssuranceVerifier.isAiCodeAssured(project)) .build(); projectStatistics.add(stats); } |