From 83d32bad76e4ea753535ba3f04870ab29c6c2063 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Tue, 27 Oct 2026 14:17:10 +0100 Subject: [PATCH 1/5] Report error on step execution Signed-off-by: Franck LECUYER --- .../orchestrator/StepExecutionService.java | 18 ++++++++ .../monitor/worker/server/reports.properties | 1 + .../worker/server/reports_fr.properties | 1 + .../StepExecutionServiceTest.java | 7 ++- .../worker/server/utils/TestUtils.java | 43 +++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionService.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionService.java index 6a8791a2..76964796 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionService.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionService.java @@ -6,6 +6,9 @@ */ package org.gridsuite.monitor.worker.server.orchestrator; +import com.powsybl.commons.PowsyblException; +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; import lombok.RequiredArgsConstructor; import org.gridsuite.monitor.commons.types.messaging.ProcessExecutionStep; import org.gridsuite.monitor.commons.types.processconfig.ProcessConfig; @@ -31,6 +34,20 @@ public class StepExecutionService implements StepExecutor { private final Notificator notificationService; private final ReportRestClient reportRestClient; + private void handleException(ReportNode reportNode, Exception e) { + boolean isApplicationException = PowsyblException.class.isAssignableFrom(e.getClass()); + if (!isApplicationException && LOGGER.isErrorEnabled()) { + LOGGER.error(e.toString(), e); + } + String errorMessage = isApplicationException ? e.getMessage() : "Technical error: " + e; + + reportNode.newReportNode() + .withMessageTemplate("monitor.worker.server.step.error") + .withUntypedValue("errorMessage", errorMessage) + .withSeverity(TypedValue.ERROR_SEVERITY) + .add(); + } + @Override public void executeStep(StepWithContext stepWithContext) { ProcessStepExecutionContext context = stepWithContext.stepExecutionContext(); @@ -41,6 +58,7 @@ public void executeStep(StepWithContext stepWithCon stepWithContext.step().execute(context); } catch (Exception e) { status = StepStatus.FAILED; + handleException(context.getReportNode(), e); throw e; } finally { sendReportSafely(context); diff --git a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties index 056a52eb..d6dabc15 100644 --- a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties +++ b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties @@ -6,4 +6,5 @@ monitor.worker.server.process = Process execution id : ${executionId} monitor.worker.server.securityanalysis.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error.VoltageLevelsWithWrongIscValuesSummarize = Some voltage levels have wrong isc values, isc min must be <= isc max: ${voltageLevels} +monitor.worker.server.step.error = ${errorMessage} monitor.worker.server.stepType = ${stepType} diff --git a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties index 056a52eb..d6dabc15 100644 --- a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties +++ b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties @@ -6,4 +6,5 @@ monitor.worker.server.process = Process execution id : ${executionId} monitor.worker.server.securityanalysis.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error.VoltageLevelsWithWrongIscValuesSummarize = Some voltage levels have wrong isc values, isc min must be <= isc max: ${voltageLevels} +monitor.worker.server.step.error = ${errorMessage} monitor.worker.server.stepType = ${stepType} diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java index bbaa5eb6..8a52394e 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java @@ -18,6 +18,7 @@ import org.gridsuite.monitor.worker.server.core.process.ProcessStep; import org.gridsuite.monitor.worker.server.core.process.ProcessStepType; import org.gridsuite.monitor.worker.server.messaging.NotificationService; +import org.gridsuite.monitor.worker.server.utils.TestUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -30,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @@ -118,7 +120,7 @@ void executeStepShouldCompleteSuccessfullyWhenReportSendingFails() { } @Test - void executeStepShouldSendFailedStatusWhenExceptionThrown() { + void executeStepShouldSendFailedStatusAndReportErrorWhenExceptionThrown() { UUID executionId = UUID.randomUUID(); UUID processReportId = UUID.randomUUID(); int stepOrder = 2; @@ -132,6 +134,9 @@ void executeStepShouldSendFailedStatusWhenExceptionThrown() { RuntimeException.class, () -> stepExecutionService.executeStep(stepWithContext) ); + + assertTrue(TestUtils.assertMessageFoundFromReporter("Technical error: java.lang.RuntimeException: Step execution failed", "monitor.worker.server.step.error", context.getReportNode())); + assertEquals("Step execution failed", thrownException.getMessage()); verify(notificationService, times(2)).updateStepStatus(eq(executionId), eq(ProcessType.SECURITY_ANALYSIS), any(ProcessExecutionStep.class)); InOrder inOrder = inOrder(notificationService); diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java new file mode 100644 index 00000000..3c851100 --- /dev/null +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2026, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package org.gridsuite.monitor.worker.server.utils; + +import com.powsybl.commons.report.ReportNode; +import org.apache.commons.text.StringSubstitutor; + +/** + * @author Franck Lecuyer + */ +public final class TestUtils { + private TestUtils() { + throw new IllegalCallerException("Utility class"); + } + + public static boolean assertMessageFoundFromReporter(String expectedMessage, String reportKey, ReportNode reporterModel) { + StringSubstitutor reporterSubstitutor = new StringSubstitutor(reporterModel.getValues()); + return containsMessage(expectedMessage, reportKey, reporterModel, reporterSubstitutor); + } + + private static boolean containsMessage(String expectedMessage, String reportKey, ReportNode reporter, StringSubstitutor reporterSubstitutor) { + for (ReportNode child : reporter.getChildren()) { + if (reportKey.equals(child.getMessageKey()) && expectedMessage.equals(formatReportMessage(child, reporterSubstitutor))) { + return true; + } + StringSubstitutor childSubstitutor = new StringSubstitutor(child.getValues()); + if (containsMessage(expectedMessage, reportKey, child, childSubstitutor)) { + return true; + } + } + return false; + } + + private static String formatReportMessage(ReportNode report, StringSubstitutor reporterSubstitutor) { + String reportMessage = new StringSubstitutor(report.getValues()).replace(report.getMessageTemplate()); + return reporterSubstitutor.replace(reportMessage).trim(); + } +} + From 74530301264b62fe5ed5d34b64b5a72d7106890f Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Wed, 28 Oct 2026 14:25:46 +0100 Subject: [PATCH 2/5] clean try catch exception in computing step Signed-off-by: Thang PHAM --- .../steps/LoadflowRunComputationStep.java | 28 +++++---------- .../SecurityAnalysisRunComputationStep.java | 29 ++++++--------- .../steps/ShortCircuitRunComputationStep.java | 36 +++++++------------ 3 files changed, 32 insertions(+), 61 deletions(-) diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/loadflow/steps/LoadflowRunComputationStep.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/loadflow/steps/LoadflowRunComputationStep.java index 639bbcad..13f04ce9 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/loadflow/steps/LoadflowRunComputationStep.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/loadflow/steps/LoadflowRunComputationStep.java @@ -7,7 +7,6 @@ package org.gridsuite.monitor.worker.server.process.loadflow.steps; import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.report.TypedValue; import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; @@ -45,24 +44,15 @@ public void execute(ProcessStepExecutionContext context) { ReportNode reportNode = context.getReportNode(); - try { - LoadFlowParametersInfos parametersInfos = loadflowRestClient.getParameters(context.getConfig().loadflowParametersUuid()); - LoadFlowParameters loadflowParameters = LoadFlowParametersService.buildParameters(parametersInfos); - LoadFlowRunParameters runParameters = new LoadFlowRunParameters() - .setParameters(loadflowParameters) - .setReportNode(reportNode); - LoadFlowResult result = LoadFlow.find(parametersInfos.getProvider()).run(context.getNetwork(), runParameters); + LoadFlowParametersInfos parametersInfos = loadflowRestClient.getParameters(context.getConfig().loadflowParametersUuid()); + LoadFlowParameters loadflowParameters = LoadFlowParametersService.buildParameters(parametersInfos); + LoadFlowRunParameters runParameters = new LoadFlowRunParameters() + .setParameters(loadflowParameters) + .setReportNode(reportNode); + LoadFlowResult result = LoadFlow.find(parametersInfos.getProvider()).run(context.getNetwork(), runParameters); - UUID resultUuid = loadflowRestClient.saveResult(result); - ResultInfos resultInfos = new ResultInfos(resultUuid, ResultType.LOADFLOW); - context.setResultInfos(resultInfos); - } catch (Exception e) { - reportNode.newReportNode() - .withMessageTemplate("monitor.worker.server.loadflow.step.error") - .withUntypedValue("errorMessage", e.getMessage()) - .withSeverity(TypedValue.ERROR_SEVERITY) - .add(); - throw e; - } + UUID resultUuid = loadflowRestClient.saveResult(result); + ResultInfos resultInfos = new ResultInfos(resultUuid, ResultType.LOADFLOW); + context.setResultInfos(resultInfos); } } diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/securityanalysis/steps/SecurityAnalysisRunComputationStep.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/securityanalysis/steps/SecurityAnalysisRunComputationStep.java index 78b3bbea..b53e265b 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/securityanalysis/steps/SecurityAnalysisRunComputationStep.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/securityanalysis/steps/SecurityAnalysisRunComputationStep.java @@ -7,7 +7,6 @@ package org.gridsuite.monitor.worker.server.process.securityanalysis.steps; import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.report.TypedValue; import com.powsybl.security.SecurityAnalysis; import com.powsybl.security.SecurityAnalysisReport; import com.powsybl.security.SecurityAnalysisRunParameters; @@ -21,6 +20,7 @@ import org.gridsuite.monitor.worker.server.process.securityanalysis.SecurityAnalysisStepType; import org.gridsuite.monitor.worker.server.services.SecurityAnalysisParametersService; import org.springframework.stereotype.Component; + import java.util.Objects; import java.util.UUID; @@ -46,25 +46,16 @@ public void execute(ProcessStepExecutionContext context) ReportNode reportNode = context.getReportNode(); - try { - SecurityAnalysisInputData inputData = securityAnalysisParametersService.buildSecurityAnalysisInputData( - context.getConfig().securityAnalysisParametersUuid(), context.getConfig().loadflowParametersUuid(), context.getNetwork()); + SecurityAnalysisInputData inputData = securityAnalysisParametersService.buildSecurityAnalysisInputData( + context.getConfig().securityAnalysisParametersUuid(), context.getConfig().loadflowParametersUuid(), context.getNetwork()); - SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() - .setSecurityAnalysisParameters(inputData.securityAnalysisParameters()) - .setReportNode(reportNode); - SecurityAnalysisReport saReport = SecurityAnalysis.find(inputData.provider()).run(context.getNetwork(), inputData.contingencies(), runParameters); + SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters() + .setSecurityAnalysisParameters(inputData.securityAnalysisParameters()) + .setReportNode(reportNode); + SecurityAnalysisReport saReport = SecurityAnalysis.find(inputData.provider()).run(context.getNetwork(), inputData.contingencies(), runParameters); - ResultInfos resultInfos = new ResultInfos(UUID.randomUUID(), ResultType.SECURITY_ANALYSIS); - securityAnalysisRestClient.saveResult(resultInfos.resultUUID(), saReport.getResult()); - context.setResultInfos(resultInfos); - } catch (Exception e) { - reportNode.newReportNode() - .withMessageTemplate("monitor.worker.server.securityanalysis.step.error") - .withUntypedValue("errorMessage", e.getMessage()) - .withSeverity(TypedValue.ERROR_SEVERITY) - .add(); - throw e; - } + ResultInfos resultInfos = new ResultInfos(UUID.randomUUID(), ResultType.SECURITY_ANALYSIS); + securityAnalysisRestClient.saveResult(resultInfos.resultUUID(), saReport.getResult()); + context.setResultInfos(resultInfos); } } diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStep.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStep.java index 8978d73a..b2aae789 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStep.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStep.java @@ -7,10 +7,11 @@ package org.gridsuite.monitor.worker.server.process.shortcircuit.steps; import com.powsybl.commons.PowsyblException; -import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.report.TypedValue; import com.powsybl.computation.local.LocalComputationManager; -import com.powsybl.shortcircuit.*; +import com.powsybl.shortcircuit.Fault; +import com.powsybl.shortcircuit.ShortCircuitAnalysis; +import com.powsybl.shortcircuit.ShortCircuitAnalysisResult; +import com.powsybl.shortcircuit.ShortCircuitParameters; import lombok.Getter; import org.gridsuite.monitor.commons.types.processconfig.ShortCircuitConfig; import org.gridsuite.monitor.commons.types.result.ResultInfos; @@ -66,27 +67,16 @@ public ShortCircuitRunComputationStep( public void execute(ProcessStepExecutionContext context) { Objects.requireNonNull(context.getNetwork()); - ReportNode reportNode = context.getReportNode(); + ShortCircuitParametersInfos parametersInfos = shortCircuitRestClient.getParameters(context.getConfig().shortCircuitParametersUuid()); + // TODO: in shortcircuit-server, retrieved parameters are post processed before being passed to the short-circuit calculation - try { - ShortCircuitParametersInfos parametersInfos = shortCircuitRestClient.getParameters(context.getConfig().shortCircuitParametersUuid()); - // TODO: in shortcircuit-server, retrieved parameters are post processed before being passed to the short-circuit calculation - - String provider = parametersInfos.getProvider() != null ? parametersInfos.getProvider() : getDefaultProvider(); - Map specificParameters = parametersInfos.getSpecificParametersPerProvider().get(provider); - ShortCircuitParameters commonParameters = shortCircuitParametersService.buildParameters(parametersInfos, provider, specificParameters); - if (context.getDebugFileLocation() == null) { - runComputation(context, provider, commonParameters, specificParameters); - } else { - runComputationWithDebug(context, provider, commonParameters, specificParameters); - } - } catch (Exception e) { - reportNode.newReportNode() - .withMessageTemplate("monitor.worker.server.shortcircuit.step.error") - .withUntypedValue("errorMessage", e.getMessage()) - .withSeverity(TypedValue.ERROR_SEVERITY) - .add(); - throw e; + String provider = parametersInfos.getProvider() != null ? parametersInfos.getProvider() : getDefaultProvider(); + Map specificParameters = parametersInfos.getSpecificParametersPerProvider().get(provider); + ShortCircuitParameters commonParameters = shortCircuitParametersService.buildParameters(parametersInfos, provider, specificParameters); + if (context.getDebugFileLocation() == null) { + runComputation(context, provider, commonParameters, specificParameters); + } else { + runComputationWithDebug(context, provider, commonParameters, specificParameters); } } From a3dfcfdf4d9f5c38936df132f0dae389fc1ed788 Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Wed, 28 Oct 2026 14:37:31 +0100 Subject: [PATCH 3/5] clean test Signed-off-by: Thang PHAM --- .../steps/ShortCircuitRunComputationStepTest.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java index b6dd1237..4ed83d17 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java @@ -82,12 +82,6 @@ void setUp() { when(stepContext.getConfig()).thenReturn(config); when(config.shortCircuitParametersUuid()).thenReturn(PARAMS_UUID); - - ReportNode reportNode = ReportNode.newRootReportNode() - .withResourceBundles("i18n.reports") - .withMessageTemplate("test") - .build(); - when(stepContext.getReportNode()).thenReturn(reportNode); } @Test From deb099cdab27f67a127a784bccb64b74486709bb Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Wed, 28 Oct 2026 14:41:01 +0100 Subject: [PATCH 4/5] clean test 2 Signed-off-by: Thang PHAM --- .../steps/ShortCircuitRunComputationStepTest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java index 4ed83d17..cee8915f 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/process/shortcircuit/steps/ShortCircuitRunComputationStepTest.java @@ -6,7 +6,6 @@ */ package org.gridsuite.monitor.worker.server.process.shortcircuit.steps; -import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import com.powsybl.shortcircuit.Fault; @@ -40,10 +39,7 @@ import java.util.Map; import java.util.UUID; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; From f0b67bbfc0d3dc79d6fb4984b54530f1c4f75168 Mon Sep 17 00:00:00 2001 From: Franck LECUYER Date: Fri, 30 Oct 2026 10:57:44 +0100 Subject: [PATCH 5/5] Remove no more used report keys Renaming TestUtils to ReportTestUtils Signed-off-by: Franck LECUYER --- .../org/gridsuite/monitor/worker/server/reports.properties | 3 --- .../org/gridsuite/monitor/worker/server/reports_fr.properties | 3 --- .../worker/server/orchestrator/StepExecutionServiceTest.java | 4 ++-- .../server/utils/{TestUtils.java => ReportTestUtils.java} | 4 ++-- 4 files changed, 4 insertions(+), 10 deletions(-) rename monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/{TestUtils.java => ReportTestUtils.java} (96%) diff --git a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties index d6dabc15..70b545fe 100644 --- a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties +++ b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports.properties @@ -1,10 +1,7 @@ monitor.worker.server.importCase = Import Case : ${caseName} -monitor.worker.server.loadflow.step.error = ${errorMessage} monitor.worker.server.modifications.error = Some network composite modifications are missing : ${uuids} monitor.worker.server.modifications.not.applied = Some network composite modifications are not applied intentionally (see process-config) : ${uuids} monitor.worker.server.process = Process execution id : ${executionId} -monitor.worker.server.securityanalysis.step.error = ${errorMessage} -monitor.worker.server.shortcircuit.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error.VoltageLevelsWithWrongIscValuesSummarize = Some voltage levels have wrong isc values, isc min must be <= isc max: ${voltageLevels} monitor.worker.server.step.error = ${errorMessage} monitor.worker.server.stepType = ${stepType} diff --git a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties index d6dabc15..70b545fe 100644 --- a/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties +++ b/monitor-worker-server/src/main/resources/org/gridsuite/monitor/worker/server/reports_fr.properties @@ -1,10 +1,7 @@ monitor.worker.server.importCase = Import Case : ${caseName} -monitor.worker.server.loadflow.step.error = ${errorMessage} monitor.worker.server.modifications.error = Some network composite modifications are missing : ${uuids} monitor.worker.server.modifications.not.applied = Some network composite modifications are not applied intentionally (see process-config) : ${uuids} monitor.worker.server.process = Process execution id : ${executionId} -monitor.worker.server.securityanalysis.step.error = ${errorMessage} -monitor.worker.server.shortcircuit.step.error = ${errorMessage} monitor.worker.server.shortcircuit.step.error.VoltageLevelsWithWrongIscValuesSummarize = Some voltage levels have wrong isc values, isc min must be <= isc max: ${voltageLevels} monitor.worker.server.step.error = ${errorMessage} monitor.worker.server.stepType = ${stepType} diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java index b77bb1f7..e8090e75 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/orchestrator/StepExecutionServiceTest.java @@ -19,7 +19,7 @@ import org.gridsuite.monitor.worker.server.core.process.ProcessStep; import org.gridsuite.monitor.worker.server.core.process.ProcessStepType; import org.gridsuite.monitor.worker.server.messaging.NotificationService; -import org.gridsuite.monitor.worker.server.utils.TestUtils; +import org.gridsuite.monitor.worker.server.utils.ReportTestUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -137,7 +137,7 @@ void executeStepShouldSendFailedStatusAndReportErrorWhenExceptionThrown() { () -> stepExecutionService.executeStep(stepWithContext) ); - assertTrue(TestUtils.assertMessageFoundFromReporter("Technical error: java.lang.RuntimeException: Step execution failed", "monitor.worker.server.step.error", context.getReportNode())); + assertTrue(ReportTestUtils.assertMessageFoundFromReporter("Technical error: java.lang.RuntimeException: Step execution failed", "monitor.worker.server.step.error", context.getReportNode())); assertEquals("Step execution failed", thrownException.getMessage()); verify(notificationService, times(2)).updateStepStatus(eq(executionId), eq(ProcessType.SECURITY_ANALYSIS), any(ProcessExecutionStep.class)); diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/ReportTestUtils.java similarity index 96% rename from monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java rename to monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/ReportTestUtils.java index 3c851100..a5d28591 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/TestUtils.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/utils/ReportTestUtils.java @@ -12,8 +12,8 @@ /** * @author Franck Lecuyer */ -public final class TestUtils { - private TestUtils() { +public final class ReportTestUtils { + private ReportTestUtils() { throw new IllegalCallerException("Utility class"); }