Skip to content

Commit

Permalink
Remove multiple severity per report (#656)
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Marcellin <[email protected]>
  • Loading branch information
Meklo authored Dec 17, 2024
1 parent 2737564 commit f0b9870
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/gridsuite/study/server/dto/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public record Report(
UUID id,
UUID parentId,
String message,
List<StudyConstants.Severity> severities,
StudyConstants.Severity severity,
List<Report> subReports
) { }
3 changes: 1 addition & 2 deletions src/main/java/org/gridsuite/study/server/dto/ReportLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

import org.gridsuite.study.server.StudyConstants;

import java.util.Set;
import java.util.UUID;

/**
* @author Abdelsalem Hedhili <abdelsalem.hedhili at rte-france.com>
*/
public record ReportLog(String message, Set<StudyConstants.Severity> severity, UUID parentId) {
public record ReportLog(String message, StudyConstants.Severity severity, UUID parentId) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class NetworkModificationTest {

private static final String MODIFICATION_UUID = "796719f5-bd31-48be-be46-ef7b96951e32";

private static final Report REPORT_TEST = Report.builder().id(UUID.randomUUID()).message("test").severities(List.of(StudyConstants.Severity.WARN)).build();
private static final Report REPORT_TEST = Report.builder().id(UUID.randomUUID()).message("test").severity(StudyConstants.Severity.WARN).build();

private static final String TEST_FILE = "testCase.xiidm";

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/gridsuite/study/server/StudyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ class StudyTest {
private static final NetworkInfos NETWORK_INFOS = new NetworkInfos(NETWORK_UUID, "20140116_0830_2D4_UX1_pst");
private static final NetworkInfos NOT_EXISTING_NETWORK_INFOS = new NetworkInfos(NOT_EXISTING_NETWORK_UUID, "not_existing_network_id");
private static final UUID REPORT_UUID = UUID.randomUUID();
private static final Report REPORT_TEST = Report.builder().id(REPORT_UUID).message("test").severities(List.of(StudyConstants.Severity.WARN)).build();
private static final Report REPORT_TEST = Report.builder().id(REPORT_UUID).message("test").severity(StudyConstants.Severity.WARN).build();
private static final UUID REPORT_LOG_PARENT_UUID = UUID.randomUUID();
private static final UUID REPORT_ID = UUID.randomUUID();
private static final List<ReportLog> REPORT_LOGS = List.of(new ReportLog("test", Set.of(StudyConstants.Severity.WARN), REPORT_LOG_PARENT_UUID));
private static final List<ReportLog> REPORT_LOGS = List.of(new ReportLog("test", StudyConstants.Severity.WARN, REPORT_LOG_PARENT_UUID));
private static final String VARIANT_ID = "variant_1";
private static final String POST = "POST";
private static final String DELETE = "DELETE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public MatcherReport(Report report) {

@Override
public boolean matchesSafely(Report m) {
return Objects.equals(reference.message(), m.message()) && Objects.equals(reference.severities(), m.severities());
return Objects.equals(reference.message(), m.message()) && Objects.equals(reference.severity(), m.severity());
}

@Override
Expand Down

0 comments on commit f0b9870

Please sign in to comment.