From c6a817468bcd71129f9da2b453a5a91af62df570 Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Tue, 10 Jan 2023 11:51:59 +0100 Subject: [NO-JIRA] Use record for data classes --- .../src/main/java/org/sonar/db/event/EventPurgeData.java | 13 +------------ .../org/sonar/db/event/EventComponentChangeDaoTest.java | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'server/sonar-db-dao') 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, -- cgit v1.2.3