Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multiple severity per report #656

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading