diff --git a/src/test/java/org/gridsuite/modification/server/modifications/OperatingStatusModificationTripBusBarTest.java b/src/test/java/org/gridsuite/modification/server/modifications/OperatingStatusModificationTripBusBarTest.java index 2bb8fd508..534ea7257 100644 --- a/src/test/java/org/gridsuite/modification/server/modifications/OperatingStatusModificationTripBusBarTest.java +++ b/src/test/java/org/gridsuite/modification/server/modifications/OperatingStatusModificationTripBusBarTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022, RTE (http://www.rte-france.com) + * Copyright (c) 2024, 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/. @@ -21,22 +21,21 @@ import java.util.UUID; import static com.powsybl.iidm.network.extensions.OperatingStatus.Status.FORCED_OUTAGE; -import static com.powsybl.iidm.network.extensions.OperatingStatus.Status.PLANNED_OUTAGE; +import static com.powsybl.iidm.network.extensions.OperatingStatus.Status.IN_OPERATION; import static org.junit.jupiter.api.Assertions.assertEquals; @Tag("IntegrationTest") public class OperatingStatusModificationTripBusBarTest extends AbstractNetworkModificationTest { private static final String TARGET_BUSBAR_ID = "1.A"; - private static final String UPDATE_BRANCH_ID = "line1"; - private static final OperatingStatus.Status TARGET_BRANCH_STATUS = FORCED_OUTAGE; - private static final OperatingStatus.Status OTHER_BRANCH_STATUS = PLANNED_OUTAGE; + private static final OperatingStatus.Status TARGET_BUSBAR_STATUS = FORCED_OUTAGE; + private static final OperatingStatus.Status INITIAL_BUSBAR_STATUS = IN_OPERATION; @Override protected Network createNetwork(UUID networkUuid) { Network network = NetworkCreation.create(networkUuid, true); // force a branch status different from the expected one, after testCreate - TestUtils.setOperatingStatus(network, TARGET_BUSBAR_ID, OTHER_BRANCH_STATUS); + TestUtils.setOperatingStatus(network, TARGET_BUSBAR_ID, INITIAL_BUSBAR_STATUS); return network; } @@ -45,7 +44,6 @@ protected ModificationInfos buildModification() { return OperatingStatusModificationInfos.builder() .stashed(false) .equipmentId(TARGET_BUSBAR_ID) - .energizedVoltageLevelId("energizedVoltageLevelId") .action(OperatingStatusModificationInfos.ActionType.TRIP).build(); } @@ -53,21 +51,20 @@ protected ModificationInfos buildModification() { protected ModificationInfos buildModificationUpdate() { return OperatingStatusModificationInfos.builder() .stashed(false) - .equipmentId(UPDATE_BRANCH_ID) - .energizedVoltageLevelId("energizedVoltageLevelIdEdited") + .equipmentId(TARGET_BUSBAR_ID) .action(OperatingStatusModificationInfos.ActionType.SWITCH_ON).build(); } @Override protected void assertAfterNetworkModificationCreation() { - TestUtils.assertOperatingStatus(getNetwork(), TARGET_BUSBAR_ID, TARGET_BRANCH_STATUS); + TestUtils.assertOperatingStatus(getNetwork(), TARGET_BUSBAR_ID, TARGET_BUSBAR_STATUS); assertTerminalsStatusAfterNetworkModification(false); } @Override protected void assertAfterNetworkModificationDeletion() { // back to init status - TestUtils.assertOperatingStatus(getNetwork(), TARGET_BUSBAR_ID, OTHER_BRANCH_STATUS); + TestUtils.assertOperatingStatus(getNetwork(), TARGET_BUSBAR_ID, INITIAL_BUSBAR_STATUS); assertTerminalsStatusAfterNetworkModification(true); } @@ -76,9 +73,7 @@ protected void assertAfterNetworkModificationDeletion() { protected void testCreationModificationMessage(ModificationInfos modificationInfos) { assertEquals("OPERATING_STATUS_MODIFICATION", modificationInfos.getMessageType()); Map createdValues = mapper.readValue(modificationInfos.getMessageValues(), new TypeReference<>() { }); - assertEquals("energizedVoltageLevelId", createdValues.get("energizedVoltageLevelId")); assertEquals("TRIP", createdValues.get("action")); - assertEquals("1.A", createdValues.get("equipmentId")); } @Override @@ -86,9 +81,7 @@ protected void testCreationModificationMessage(ModificationInfos modificationInf protected void testUpdateModificationMessage(ModificationInfos modificationInfos) { assertEquals("OPERATING_STATUS_MODIFICATION", modificationInfos.getMessageType()); Map updatedValues = mapper.readValue(modificationInfos.getMessageValues(), new TypeReference<>() { }); - assertEquals("energizedVoltageLevelIdEdited", updatedValues.get("energizedVoltageLevelId")); assertEquals("SWITCH_ON", updatedValues.get("action")); - assertEquals("line1", updatedValues.get("equipmentId")); } private void assertTerminalsStatusAfterNetworkModification(boolean shouldBeConnected) {