aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-telemetry/src
diff options
context:
space:
mode:
authorJulien Camus <julien.camus@sonarsource.com>2024-12-17 17:37:43 +0100
committerSteve Marion <steve.marion@sonarsource.com>2024-12-18 11:13:24 +0100
commit108e25bce0062be83ab15c587aecfa1e51ba5cf1 (patch)
tree8102236ce649305a1d270a56cc284d5d12a4c31c /server/sonar-telemetry/src
parent16e6a0469c02298a8b5c478313dd68c93705922e (diff)
downloadsonarqube-108e25bce0062be83ab15c587aecfa1e51ba5cf1.tar.gz
sonarqube-108e25bce0062be83ab15c587aecfa1e51ba5cf1.zip
SONAR-24004 Replace lambda with method reference
Diffstat (limited to 'server/sonar-telemetry/src')
-rw-r--r--server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java
index f521c3cf7d4..3cd96a10039 100644
--- a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java
+++ b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java
@@ -51,8 +51,8 @@ public class QualityProfileDataProviderIT {
QProfileDto qProfile1 = createQualityProfile(false, null);
dbTester.qualityProfiles().setAsDefault(qProfile1);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.isDefault(), p -> p.isBuiltIn(), p -> p.builtInParent(),
- p -> p.rulesActivatedCount(), p -> p.rulesDeactivatedCount(), p -> p.rulesOverriddenCount())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::isDefault, TelemetryData.QualityProfile::isBuiltIn, TelemetryData.QualityProfile::builtInParent,
+ TelemetryData.QualityProfile::rulesActivatedCount, TelemetryData.QualityProfile::rulesDeactivatedCount, TelemetryData.QualityProfile::rulesOverriddenCount)
.containsExactlyInAnyOrder(tuple(qProfile1.getKee(), true, false, false, null, null, null));
}
@@ -64,8 +64,8 @@ public class QualityProfileDataProviderIT {
dbTester.qualityProfiles().setAsDefault(childProfile);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.isDefault(), p -> p.isBuiltIn(), p -> p.builtInParent(),
- p -> p.rulesActivatedCount(), p -> p.rulesDeactivatedCount(), p -> p.rulesOverriddenCount())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::isDefault, TelemetryData.QualityProfile::isBuiltIn, TelemetryData.QualityProfile::builtInParent,
+ TelemetryData.QualityProfile::rulesActivatedCount, TelemetryData.QualityProfile::rulesDeactivatedCount, TelemetryData.QualityProfile::rulesOverriddenCount)
.containsExactlyInAnyOrder(
tuple(rootProfile.getKee(), false, false, false, null, null, null),
tuple(childProfile.getKee(), true, false, false, null, null, null));
@@ -82,11 +82,10 @@ public class QualityProfileDataProviderIT {
dbTester.qualityProfiles().associateWithProject(projectData.getProjectDto(), associatedProfile);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.isDefault())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::isDefault)
.containsExactlyInAnyOrder(
tuple(associatedProfile.getKee(), false),
- tuple(unassociatedProfile.getKee(), false)
- );
+ tuple(unassociatedProfile.getKee(), false));
}
@Test
@@ -101,11 +100,10 @@ public class QualityProfileDataProviderIT {
dbTester.qualityProfiles().setAsDefault(rootBuiltinProfile, childProfile, grandChildProfile);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.isBuiltIn(), p -> p.builtInParent())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::isBuiltIn, TelemetryData.QualityProfile::builtInParent)
.containsExactlyInAnyOrder(tuple(rootBuiltinProfile.getKee(), true, null),
tuple(childProfile.getKee(), false, true),
- tuple(grandChildProfile.getKee(), false, true)
- );
+ tuple(grandChildProfile.getKee(), false, true));
}
@Test
@@ -122,11 +120,11 @@ public class QualityProfileDataProviderIT {
dbTester.qualityProfiles().setAsDefault(childProfile);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.rulesActivatedCount(), p -> p.rulesDeactivatedCount(), p -> p.rulesOverriddenCount())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::rulesActivatedCount, TelemetryData.QualityProfile::rulesDeactivatedCount,
+ TelemetryData.QualityProfile::rulesOverriddenCount)
.containsExactlyInAnyOrder(
tuple(rootBuiltinProfile.getKee(), null, null, null),
- tuple(childProfile.getKee(), 1, 1, 0)
- );
+ tuple(childProfile.getKee(), 1, 1, 0));
}
@Test
@@ -138,7 +136,6 @@ public class QualityProfileDataProviderIT {
RuleDto rule = dbTester.rules().insert();
RuleParamDto initialRuleParam = dbTester.rules().insertRuleParam(rule, p -> p.setName("key").setDefaultValue("initial"));
-
ActiveRuleDto activeRuleDto = dbTester.qualityProfiles().activateRule(rootBuiltinProfile, rule);
dbTester.getDbClient().activeRuleDao().insertParam(dbTester.getSession(), activeRuleDto, newParam(activeRuleDto, initialRuleParam, "key", "value"));
@@ -150,7 +147,8 @@ public class QualityProfileDataProviderIT {
dbTester.qualityProfiles().setAsDefault(childProfile);
Assertions.assertThat(underTest.retrieveQualityProfilesData())
- .extracting(p -> p.uuid(), p -> p.rulesActivatedCount(), p -> p.rulesDeactivatedCount(), p -> p.rulesOverriddenCount())
+ .extracting(TelemetryData.QualityProfile::uuid, TelemetryData.QualityProfile::rulesActivatedCount, TelemetryData.QualityProfile::rulesDeactivatedCount,
+ TelemetryData.QualityProfile::rulesOverriddenCount)
.containsExactlyInAnyOrder(
tuple(rootBuiltinProfile.getKee(), null, null, null),
tuple(childProfile.getKee(), 0, 0, 1));