Skip to content

Commit

Permalink
fix log id (#580)
Browse files Browse the repository at this point in the history
Signed-off-by: TOURI ANIS <anis-1.touri@rte-france.com>
  • Loading branch information
anistouri authored Jun 11, 2024
1 parent 1b55f69 commit e966fe9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ private List<ReportNode> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}
}

0 comments on commit e966fe9

Please sign in to comment.