aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorZipeng WU <zipeng.wu@sonarsource.com>2023-01-10 11:51:59 +0100
committersonartech <sonartech@sonarsource.com>2023-01-12 20:02:51 +0000
commitc6a817468bcd71129f9da2b453a5a91af62df570 (patch)
tree0b20f3dd739bcb89c0e802c2d51724cbe8a7e70e /server/sonar-db-dao
parent2b61542b6a77fdfb62ff5a815856d3babee28a1a (diff)
downloadsonarqube-c6a817468bcd71129f9da2b453a5a91af62df570.tar.gz
sonarqube-c6a817468bcd71129f9da2b453a5a91af62df570.zip
[NO-JIRA] Use record for data classes
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/event/EventPurgeData.java13
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/event/EventComponentChangeDaoTest.java2
2 files changed, 2 insertions, 13 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/event/EventPurgeData.java b/server/sonar-db-dao/src/main/java/org/sonar/db/event/EventPurgeData.java
index 1c448a4b49f..29988891dec 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/event/EventPurgeData.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/event/EventPurgeData.java
@@ -21,20 +21,9 @@ package org.sonar.db.event;
import static java.util.Objects.requireNonNull;
-public final class EventPurgeData {
- private final String componentUuid;
- private final String analysisUuid;
-
+public record EventPurgeData(String componentUuid, String analysisUuid) {
public EventPurgeData(String componentUuid, String analysisUuid) {
this.componentUuid = requireNonNull(componentUuid);
this.analysisUuid = requireNonNull(analysisUuid);
}
-
- public String getComponentUuid() {
- return componentUuid;
- }
-
- public String getAnalysisUuid() {
- return analysisUuid;
- }
}
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventComponentChangeDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventComponentChangeDaoTest.java
index 161735abc46..97a521409b5 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventComponentChangeDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventComponentChangeDaoTest.java
@@ -276,7 +276,7 @@ public class EventComponentChangeDaoTest {
Arrays.stream(event1Dtos).forEach(dto -> underTest.insert(dbSession, dto, doesNotMatter));
Arrays.stream(event2Dtos).forEach(dto -> underTest.insert(dbSession, dto, doesNotMatter));
- assertThat(underTest.selectByAnalysisUuids(dbSession, singletonList(doesNotMatter.getAnalysisUuid())))
+ assertThat(underTest.selectByAnalysisUuids(dbSession, singletonList(doesNotMatter.analysisUuid())))
.extracting(
EventComponentChangeDto::getUuid,
EventComponentChangeDto::getEventUuid,