diff --git a/monitor-commons/pom.xml b/monitor-commons/pom.xml index a09e1147..5d8bb2cf 100644 --- a/monitor-commons/pom.xml +++ b/monitor-commons/pom.xml @@ -23,5 +23,16 @@ com.fasterxml.jackson.core jackson-annotations + + com.powsybl + powsybl-commons + + + + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/dto/ReportInfos.java b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/ReportInfos.java similarity index 90% rename from monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/dto/ReportInfos.java rename to monitor-commons/src/main/java/org/gridsuite/monitor/commons/ReportInfos.java index d12c59f7..2251372d 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/dto/ReportInfos.java +++ b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/ReportInfos.java @@ -4,7 +4,7 @@ * 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.dto; +package org.gridsuite.monitor.commons; import com.powsybl.commons.report.ReportNode; diff --git a/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/AbstractStepExecutor.java b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/AbstractStepExecutor.java new file mode 100644 index 00000000..4ea0db2a --- /dev/null +++ b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/AbstractStepExecutor.java @@ -0,0 +1,118 @@ +/** + * 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.commons.steps; + +import org.gridsuite.monitor.commons.ProcessExecutionStep; +import org.gridsuite.monitor.commons.ReportInfos; +import org.gridsuite.monitor.commons.ResultInfos; +import org.gridsuite.monitor.commons.StepStatus; + +import java.time.Instant; +import java.util.UUID; + +/** + * @author Mohamed Ben-rejeb + */ +public abstract class AbstractStepExecutor { + + protected final StepStatusPublisher stepStatusPublisher; + protected final ReportPublisher reportPublisher; + + protected AbstractStepExecutor(StepStatusPublisher stepStatusPublisher, ReportPublisher reportPublisher) { + this.stepStatusPublisher = stepStatusPublisher; + this.reportPublisher = reportPublisher; + } + + public void skipStep( + UUID processExecutionId, + UUID stepExecutionId, + String stepTypeName, + int stepOrder, + Instant startedAt + ) { + ProcessExecutionStep executionStep = ProcessExecutionStep.builder() + .id(stepExecutionId) + .stepType(stepTypeName) + .stepOrder(stepOrder) + .status(StepStatus.SKIPPED) + .startedAt(startedAt) + .completedAt(Instant.now()) + .build(); + stepStatusPublisher.updateStepStatus(processExecutionId, executionStep); + } + + public void executeStep( + UUID processExecutionId, + UUID stepExecutionId, + String stepTypeName, + int stepOrder, + Instant startedAt, + UUID reportUuid, + ReportInfos reportInfos, + ResultInfos resultInfos, + Runnable stepExecution + ) { + ProcessExecutionStep executionStep = ProcessExecutionStep.builder() + .id(stepExecutionId) + .stepType(stepTypeName) + .stepOrder(stepOrder) + .status(StepStatus.RUNNING) + .reportId(reportUuid) + .startedAt(startedAt) + .build(); + stepStatusPublisher.updateStepStatus(processExecutionId, executionStep); + + try { + stepExecution.run(); + reportPublisher.sendReport(reportInfos); + updateStepStatus( + processExecutionId, + stepExecutionId, + stepTypeName, + stepOrder, + startedAt, + reportUuid, + resultInfos, + StepStatus.COMPLETED); + } catch (Exception e) { + updateStepStatus( + processExecutionId, + stepExecutionId, + stepTypeName, + stepOrder, + startedAt, + reportUuid, + resultInfos, + StepStatus.FAILED); + throw e; + } + } + + private void updateStepStatus( + UUID processExecutionId, + UUID stepExecutionId, + String stepTypeName, + int stepOrder, + Instant startedAt, + UUID reportUuid, + ResultInfos resultInfos, + StepStatus status + ) { + ProcessExecutionStep updated = ProcessExecutionStep.builder() + .id(stepExecutionId) + .stepType(stepTypeName) + .stepOrder(stepOrder) + .status(status) + .resultId(resultInfos != null ? resultInfos.resultUUID() : null) + .resultType(resultInfos != null ? resultInfos.resultType() : null) + .reportId(reportUuid) + .startedAt(startedAt) + .completedAt(Instant.now()) + .build(); + stepStatusPublisher.updateStepStatus(processExecutionId, updated); + } +} diff --git a/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/ReportPublisher.java b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/ReportPublisher.java new file mode 100644 index 00000000..8d6e250a --- /dev/null +++ b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/ReportPublisher.java @@ -0,0 +1,19 @@ +/** + * 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.commons.steps; + +import org.gridsuite.monitor.commons.ReportInfos; + +/** + * @author Mohamed Ben-rejeb + */ +@FunctionalInterface +public interface ReportPublisher { + + void sendReport(ReportInfos reportInfos); + +} diff --git a/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/StepStatusPublisher.java b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/StepStatusPublisher.java new file mode 100644 index 00000000..622903b1 --- /dev/null +++ b/monitor-commons/src/main/java/org/gridsuite/monitor/commons/steps/StepStatusPublisher.java @@ -0,0 +1,20 @@ +/** + * 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.commons.steps; + +import org.gridsuite.monitor.commons.ProcessExecutionStep; + +import java.util.UUID; + +/** + * @author Mohamed Ben-rejeb + */ +@FunctionalInterface +public interface StepStatusPublisher { + + void updateStepStatus(UUID executionId, ProcessExecutionStep processExecutionStep); +} diff --git a/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/ReportPublisherTest.java b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/ReportPublisherTest.java new file mode 100644 index 00000000..526cbf20 --- /dev/null +++ b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/ReportPublisherTest.java @@ -0,0 +1,33 @@ +/** + * 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.commons.steps; + +import com.powsybl.commons.report.ReportNode; +import org.gridsuite.monitor.commons.ReportInfos; +import org.junit.jupiter.api.Test; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; + +import static org.junit.jupiter.api.Assertions.assertSame; + +/** + * @author Mohamed Ben-rejeb + */ +class ReportPublisherTest { + + @Test + void sendReportShouldForwardReportInfosToImplementation() { + AtomicReference published = new AtomicReference<>(); + ReportPublisher reportPublisher = published::set; + ReportInfos reportInfos = new ReportInfos(UUID.randomUUID(), ReportNode.NO_OP); + + reportPublisher.sendReport(reportInfos); + + assertSame(reportInfos, published.get()); + } +} diff --git a/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepExecutorTest.java b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepExecutorTest.java new file mode 100644 index 00000000..fbfd4ada --- /dev/null +++ b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepExecutorTest.java @@ -0,0 +1,248 @@ +/** + * 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.commons.steps; + +import org.gridsuite.monitor.commons.ProcessExecutionStep; +import org.gridsuite.monitor.commons.ReportInfos; +import org.gridsuite.monitor.commons.ResultInfos; +import org.gridsuite.monitor.commons.ResultType; +import org.gridsuite.monitor.commons.StepStatus; +import org.junit.jupiter.api.Test; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Mohamed Ben-rejeb + */ +class StepExecutorTest { + + @Test + void skipStepShouldPublishSkippedStatus() { + TestStepExecutor executor = new TestStepExecutor(); + UUID processExecutionId = UUID.randomUUID(); + UUID stepExecutionId = UUID.randomUUID(); + Instant startedAt = Instant.now(); + + executor.skipStep(processExecutionId, stepExecutionId, "LOAD_NETWORK", 1, startedAt); + + assertEquals( + 1, + executor.publishedSteps() + .size()); + PublishedStep published = executor.publishedSteps() + .get(0); + assertEquals(processExecutionId, published.processExecutionId()); + assertEquals( + stepExecutionId, + published.step() + .getId()); + assertEquals( + "LOAD_NETWORK", + published.step() + .getStepType()); + assertEquals( + 1, + published.step() + .getStepOrder()); + assertEquals( + StepStatus.SKIPPED, + published.step() + .getStatus()); + assertNull(published.step() + .getResultId()); + assertNull(published.step() + .getResultType()); + assertNull(published.step() + .getReportId()); + assertEquals( + startedAt, + published.step() + .getStartedAt()); + assertNotNull(published.step() + .getCompletedAt()); + assertTrue(executor.publishedReports() + .isEmpty()); + } + + @Test + void executeStepShouldPublishRunningThenCompletedAndSendReport() { + TestStepExecutor executor = new TestStepExecutor(); + UUID processExecutionId = UUID.randomUUID(); + UUID stepExecutionId = UUID.randomUUID(); + UUID reportId = UUID.randomUUID(); + UUID resultId = UUID.randomUUID(); + Instant startedAt = Instant.now(); + + ResultInfos resultInfos = new ResultInfos(resultId, ResultType.SECURITY_ANALYSIS); + ReportInfos reportInfos = new ReportInfos(reportId, null); + AtomicInteger executionCount = new AtomicInteger(0); + + executor.executeStep( + processExecutionId, + stepExecutionId, + "RUN_SECURITY_ANALYSIS", + 2, + startedAt, + reportId, + reportInfos, + resultInfos, + executionCount::incrementAndGet); + + assertEquals(1, executionCount.get()); + assertEquals(List.of(reportInfos), executor.publishedReports()); + assertEquals( + 2, + executor.publishedSteps() + .size()); + + PublishedStep running = executor.publishedSteps() + .get(0); + assertEquals(processExecutionId, running.processExecutionId()); + assertEquals( + StepStatus.RUNNING, + running.step() + .getStatus()); + assertEquals( + reportId, + running.step() + .getReportId()); + assertNull(running.step() + .getCompletedAt()); + + PublishedStep completed = executor.publishedSteps() + .get(1); + assertEquals(processExecutionId, completed.processExecutionId()); + assertEquals( + StepStatus.COMPLETED, + completed.step() + .getStatus()); + assertEquals( + resultId, + completed.step() + .getResultId()); + assertEquals( + ResultType.SECURITY_ANALYSIS, + completed.step() + .getResultType()); + assertEquals( + reportId, + completed.step() + .getReportId()); + assertNotNull(completed.step() + .getCompletedAt()); + } + + @Test + void executeStepShouldPublishFailedStatusAndRethrowWhenStepThrows() { + TestStepExecutor executor = new TestStepExecutor(); + UUID processExecutionId = UUID.randomUUID(); + UUID stepExecutionId = UUID.randomUUID(); + UUID reportId = UUID.randomUUID(); + Instant startedAt = Instant.now(); + + ReportInfos reportInfos = new ReportInfos(reportId, null); + RuntimeException failure = new RuntimeException("exp"); + + Runnable failingExecution = () -> { + throw failure; + }; + + RuntimeException thrown = assertThrows( + RuntimeException.class, () -> executeFailingStep( + executor, + processExecutionId, + stepExecutionId, + startedAt, + reportId, + reportInfos, + failingExecution)); + + assertSame(failure, thrown); + assertTrue(executor.publishedReports() + .isEmpty()); + assertEquals( + 2, + executor.publishedSteps() + .size()); + + PublishedStep running = executor.publishedSteps() + .get(0); + assertEquals( + StepStatus.RUNNING, + running.step() + .getStatus()); + + PublishedStep failed = executor.publishedSteps() + .get(1); + assertEquals( + StepStatus.FAILED, + failed.step() + .getStatus()); + assertNull(failed.step() + .getResultId()); + assertNull(failed.step() + .getResultType()); + assertNotNull(failed.step() + .getCompletedAt()); + } + + private static final class TestStepExecutor extends AbstractStepExecutor { + + private final List publishedSteps; + private final List publishedReports; + + private TestStepExecutor() { + this(new ArrayList<>(), new ArrayList<>()); + } + + private TestStepExecutor(List publishedSteps, List publishedReports) { + super( + (executionId, processExecutionStep) -> publishedSteps.add(new PublishedStep( + executionId, + processExecutionStep)), publishedReports::add); + this.publishedSteps = publishedSteps; + this.publishedReports = publishedReports; + } + + List publishedSteps() { + return publishedSteps; + } + + List publishedReports() { + return publishedReports; + } + } + + private static void executeFailingStep( + TestStepExecutor executor, + UUID processExecutionId, + UUID stepExecutionId, + Instant startedAt, + UUID reportId, + ReportInfos reportInfos, + Runnable failingExecution + ) { + executor.executeStep( + processExecutionId, + stepExecutionId, + "FAILING_STEP", + 3, + startedAt, + reportId, + reportInfos, + null, + failingExecution); + } + + private record PublishedStep(UUID processExecutionId, ProcessExecutionStep step) { } +} diff --git a/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepStatusPublisherTest.java b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepStatusPublisherTest.java new file mode 100644 index 00000000..a2f3a857 --- /dev/null +++ b/monitor-commons/src/test/java/org/gridsuite/monitor/commons/steps/StepStatusPublisherTest.java @@ -0,0 +1,40 @@ +/** + * 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.commons.steps; + +import org.gridsuite.monitor.commons.ProcessExecutionStep; +import org.junit.jupiter.api.Test; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; + +/** + * @author Mohamed Ben-rejeb + */ +class StepStatusPublisherTest { + + @Test + void updateStepStatusShouldForwardExecutionIdAndStepToImplementation() { + AtomicReference publishedExecutionId = new AtomicReference<>(); + AtomicReference publishedStep = new AtomicReference<>(); + StepStatusPublisher stepStatusPublisher = (executionId, processExecutionStep) -> { + publishedExecutionId.set(executionId); + publishedStep.set(processExecutionStep); + }; + + UUID executionId = UUID.randomUUID(); + ProcessExecutionStep step = ProcessExecutionStep.builder().stepType("step").build(); + + stepStatusPublisher.updateStepStatus(executionId, step); + + assertEquals(executionId, publishedExecutionId.get()); + assertSame(step, publishedStep.get()); + } +} diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/core/ProcessStepExecutionContext.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/core/ProcessStepExecutionContext.java index 698832d3..2fc77989 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/core/ProcessStepExecutionContext.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/core/ProcessStepExecutionContext.java @@ -11,8 +11,8 @@ import lombok.Getter; import lombok.Setter; import org.gridsuite.monitor.commons.ProcessConfig; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.commons.ResultInfos; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import java.time.Instant; import java.util.UUID; diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/ReportService.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/ReportService.java index 8bbeb857..6d7c3b4a 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/ReportService.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/ReportService.java @@ -11,7 +11,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.commons.report.ReportNode; import lombok.Setter; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; +import org.gridsuite.monitor.commons.ReportInfos; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.http.HttpEntity; diff --git a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/StepExecutionService.java b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/StepExecutionService.java index bac5754b..e9baac9e 100644 --- a/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/StepExecutionService.java +++ b/monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/services/StepExecutionService.java @@ -6,71 +6,44 @@ */ package org.gridsuite.monitor.worker.server.services; -import lombok.RequiredArgsConstructor; import org.gridsuite.monitor.commons.ProcessConfig; -import org.gridsuite.monitor.commons.ProcessExecutionStep; -import org.gridsuite.monitor.commons.StepStatus; +import org.gridsuite.monitor.commons.steps.AbstractStepExecutor; import org.gridsuite.monitor.worker.server.core.ProcessStep; import org.gridsuite.monitor.worker.server.core.ProcessStepExecutionContext; import org.springframework.stereotype.Service; -import java.time.Instant; +import java.util.Objects; /** * @author Antoine Bouhours */ @Service -@RequiredArgsConstructor -public class StepExecutionService { +public class StepExecutionService extends AbstractStepExecutor { - private final NotificationService notificationService; - private final ReportService reportService; + public StepExecutionService(NotificationService notificationService, ReportService reportService) { + super(notificationService::updateStepStatus, reportService::sendReport); + } - public void skipStep(ProcessStepExecutionContext context, ProcessStep step) { - ProcessExecutionStep executionStep = ProcessExecutionStep.builder() - .id(context.getStepExecutionId()) - .stepType(step.getType().getName()) - .stepOrder(context.getStepOrder()) - .status(StepStatus.SKIPPED) - .startedAt(context.getStartedAt()) - .completedAt(Instant.now()) - .build(); - notificationService.updateStepStatus(context.getProcessExecutionId(), executionStep); + public void skipStep(ProcessStepExecutionContext context, ProcessStep step) { + skipStep(context.getProcessExecutionId(), + context.getStepExecutionId(), + step.getType().getName(), + context.getStepOrder(), + context.getStartedAt() + ); } public void executeStep(ProcessStepExecutionContext context, ProcessStep step) { - ProcessExecutionStep executionStep = ProcessExecutionStep.builder() - .id(context.getStepExecutionId()) - .stepType(step.getType().getName()) - .stepOrder(context.getStepOrder()) - .status(StepStatus.RUNNING) - .reportId(context.getReportInfos().reportUuid()) - .startedAt(context.getStartedAt()) - .build(); - notificationService.updateStepStatus(context.getProcessExecutionId(), executionStep); - - try { - step.execute(context); - reportService.sendReport(context.getReportInfos()); - updateStepStatus(context, StepStatus.COMPLETED, step); - } catch (Exception e) { - updateStepStatus(context, StepStatus.FAILED, step); - throw e; - } + executeStep(context.getProcessExecutionId(), + context.getStepExecutionId(), + step.getType().getName(), + context.getStepOrder(), + context.getStartedAt(), + Objects.requireNonNull(context.getReportInfos()).reportUuid(), + context.getReportInfos(), + context.getResultInfos(), + () -> step.execute(context) + ); } - private void updateStepStatus(ProcessStepExecutionContext context, StepStatus status, ProcessStep step) { - ProcessExecutionStep updated = ProcessExecutionStep.builder() - .id(context.getStepExecutionId()) - .stepType(step.getType().getName()) - .stepOrder(context.getStepOrder()) - .status(status) - .resultId(context.getResultInfos() != null ? context.getResultInfos().resultUUID() : null) - .resultType(context.getResultInfos() != null ? context.getResultInfos().resultType() : null) - .reportId(context.getReportInfos().reportUuid()) - .startedAt(context.getStartedAt()) - .completedAt(Instant.now()) - .build(); - notificationService.updateStepStatus(context.getProcessExecutionId(), updated); - } } diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java index 0e5be278..5c4f3bd5 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java @@ -14,8 +14,8 @@ import org.gridsuite.modification.dto.ModificationInfos; import org.gridsuite.modification.dto.OperationType; import org.gridsuite.monitor.commons.ModifyingProcessConfig; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.worker.server.core.ProcessStepExecutionContext; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import org.gridsuite.monitor.worker.server.services.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/LoadNetworkStepTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/LoadNetworkStepTest.java index 607f3339..6216c080 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/LoadNetworkStepTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/LoadNetworkStepTest.java @@ -10,8 +10,8 @@ import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.gridsuite.monitor.commons.ProcessConfig; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.worker.server.core.ProcessStepExecutionContext; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import org.gridsuite.monitor.worker.server.services.NetworkConversionService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/securityanalysis/steps/SecurityAnalysisRunComputationStepTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/securityanalysis/steps/SecurityAnalysisRunComputationStepTest.java index fd07eb36..78b2f9e2 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/securityanalysis/steps/SecurityAnalysisRunComputationStepTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/securityanalysis/steps/SecurityAnalysisRunComputationStepTest.java @@ -10,10 +10,10 @@ import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import com.powsybl.security.SecurityAnalysisResult; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.commons.ResultType; import org.gridsuite.monitor.commons.SecurityAnalysisConfig; import org.gridsuite.monitor.worker.server.core.ProcessStepExecutionContext; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import org.gridsuite.monitor.worker.server.services.SecurityAnalysisService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/ReportServiceTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/ReportServiceTest.java index 73811849..fde96cc2 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/ReportServiceTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/ReportServiceTest.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.powsybl.commons.report.ReportNode; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.worker.server.config.MonitorWorkerConfig; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/StepExecutionServiceTest.java b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/StepExecutionServiceTest.java index c437cd38..16c2b0e0 100644 --- a/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/StepExecutionServiceTest.java +++ b/monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/services/StepExecutionServiceTest.java @@ -9,11 +9,11 @@ import com.powsybl.commons.report.ReportNode; import org.gridsuite.monitor.commons.ProcessConfig; import org.gridsuite.monitor.commons.ProcessExecutionStep; +import org.gridsuite.monitor.commons.ReportInfos; import org.gridsuite.monitor.commons.StepStatus; import org.gridsuite.monitor.worker.server.core.ProcessStep; import org.gridsuite.monitor.worker.server.core.ProcessStepExecutionContext; import org.gridsuite.monitor.worker.server.core.ProcessStepType; -import org.gridsuite.monitor.worker.server.dto.ReportInfos; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith;