From e966fe912fcd305085e15f06f79ad4f86cbe0e7e Mon Sep 17 00:00:00 2001 From: Anis Touri Date: Tue, 11 Jun 2024 10:43:32 +0200 Subject: [PATCH] fix log id (#580) Signed-off-by: TOURI ANIS --- .../gridsuite/study/server/service/StudyService.java | 2 +- .../study/server/service/ReportServiceTest.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gridsuite/study/server/service/StudyService.java b/src/main/java/org/gridsuite/study/server/service/StudyService.java index 874d1d70c..eb096a7d5 100644 --- a/src/main/java/org/gridsuite/study/server/service/StudyService.java +++ b/src/main/java/org/gridsuite/study/server/service/StudyService.java @@ -1674,7 +1674,7 @@ private List getSubReporters(UUID nodeUuid, UUID reportUuid, String .addAll(subReporter.getChildren())); return subReportersByNode.keySet().stream().map(nodeId -> { ReportNode newSubReporter = ReportNode.newRootReportNode().withMessageTemplate(nodeId, nodeId) - .withUntypedValue("id", reportUuid.toString()).build(); + .withUntypedValue("subReportId", reportUuid.toString()).build(); subReportersByNode.get(nodeId).forEach(child -> insertReportNode(newSubReporter, child)); return newSubReporter; }).collect(Collectors.toList()); diff --git a/src/test/java/org/gridsuite/study/server/service/ReportServiceTest.java b/src/test/java/org/gridsuite/study/server/service/ReportServiceTest.java index c4790d986..e14a8cfbf 100644 --- a/src/test/java/org/gridsuite/study/server/service/ReportServiceTest.java +++ b/src/test/java/org/gridsuite/study/server/service/ReportServiceTest.java @@ -99,6 +99,8 @@ public class ReportServiceTest { private static final String STUDY_UPDATE_DESTINATION = "study.update"; + private static final String SUB_REPORT_ID = "subReportId"; + private static final long TIMEOUT = 1000; private void cleanDB() { @@ -301,25 +303,25 @@ private ReportNode getNodeReport(String reportUuid, String nodeUuid) { private ReportNode getNodeSimpleReport(String reportUuid, String nodeUuid) { ReportNode reporter = ReportNode.newRootReportNode().withMessageTemplate(reportUuid, reportUuid).build(); reporter.newReportNode().withMessageTemplate(nodeUuid, nodeUuid) - .withUntypedValue("id", reportUuid).add(); + .withUntypedValue(SUB_REPORT_ID, reportUuid).add(); return reporter; } private ReportNode getRootNodeSimpleReport(String reportUuid) { ReportNode reporter = ReportNode.newRootReportNode().withMessageTemplate(reportUuid, reportUuid).build(); reporter.newReportNode().withMessageTemplate("Root", "Root") - .withUntypedValue("id", reportUuid).add(); + .withUntypedValue(SUB_REPORT_ID, reportUuid).add(); return reporter; } private ReportNode getNodeMultipleReport(String reportUuid, String nodeUuid) { ReportNode reporter = ReportNode.newRootReportNode().withMessageTemplate(reportUuid, reportUuid).build(); ReportNode subReporter = ReportNode.newRootReportNode().withMessageTemplate(MODIFICATION_NODE_UUID.toString(), MODIFICATION_NODE_UUID.toString()) - .withUntypedValue("id", reportUuid).build(); + .withUntypedValue(SUB_REPORT_ID, reportUuid).build(); subReporter.newReportNode().withMessageTemplate("test" + nodeUuid, "test" + nodeUuid).add(); addChildReportNode(reporter, subReporter); addChildReportNode(reporter, ReportNode.newRootReportNode().withMessageTemplate(nodeUuid, nodeUuid) - .withUntypedValue("id", reportUuid).build()); + .withUntypedValue(SUB_REPORT_ID, reportUuid).build()); return reporter; } }