Skip to content

Commit

Permalink
remove tests unused endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: maissa SOUISSI <[email protected]>
  • Loading branch information
souissimai committed Oct 10, 2024
1 parent 7c02126 commit 032996f
Showing 1 changed file with 0 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -822,77 +822,6 @@ public void runBuildTest() throws Exception {
assertEquals(1, tbseqVariant1.size());
assertEquals(tbseqVariant1.size(), tbseqVariant2.size());

// deactivate some modifications and rebuild VARIANT_ID
network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, NetworkCreation.VARIANT_ID, true);

AtomicReference<UUID> lineModificationEntityUuid = new AtomicReference<>();
AtomicReference<UUID> loadCreationEntityUuid = new AtomicReference<>();
AtomicReference<UUID> equipmentDeletionEntityUuid = new AtomicReference<>();
List<ModificationInfos> modificationsInfos = networkModificationService.getNetworkModifications(TEST_GROUP_ID, false, true);
modificationsInfos.addAll(networkModificationService.getNetworkModifications(TEST_GROUP_ID_2, false, true));
modificationsInfos.forEach(modificationInfos -> {
if (modificationInfos.getClass().equals(EquipmentAttributeModificationInfos.class)) {
if (((EquipmentAttributeModificationInfos) modificationInfos).getEquipmentId().equals("line1")) {
lineModificationEntityUuid.set(modificationInfos.getUuid());
}
} else if (modificationInfos.getClass().equals(LoadCreationInfos.class)) {
if (((LoadCreationInfos) modificationInfos).getEquipmentId().equals("newLoad1")) {
loadCreationEntityUuid.set(modificationInfos.getUuid());
}
} else if (modificationInfos.getClass().equals(EquipmentDeletionInfos.class)) {
if (((EquipmentDeletionInfos) modificationInfos).getEquipmentId().equals("v2shunt")) {
equipmentDeletionEntityUuid.set(modificationInfos.getUuid());
}
}
});

buildInfosJson = objectWriter.writeValueAsString(buildInfos);

mockMvc.perform(post(uriString, TEST_NETWORK_ID).content(buildInfosJson).contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk());

resultMessage = output.receive(TIMEOUT, buildResultDestination);
assertNotNull(resultMessage);
assertEquals("me", resultMessage.getHeaders().get("receiver"));
// 1 : SWITCH equipments are reduced to collection impact
// + 2 substation modifications
// = 3
testElementImpacts(mapper, new String(resultMessage.getPayload()), 3, Set.of(IdentifiableType.SWITCH), Set.of("newSubstation", "s1"));
buildMessage = output.receive(TIMEOUT, consumeBuildDestination);
assertNotNull(buildMessage);
assertEquals("me", buildMessage.getHeaders().get("receiver"));

// test that only active modifications have been made on variant VARIANT_ID
network.getVariantManager().setWorkingVariant(NetworkCreation.VARIANT_ID);
assertTrue(network.getSwitch("v1d1").isOpen());
assertNull(network.getLine("line1").getExtension(OperatingStatus.class));
assertEquals(55., network.getGenerator("idGenerator").getTargetP(), 0.1);
assertEquals(2, network.getTwoWindingsTransformer("trf1").getRatioTapChanger().getTapPosition());
assertEquals(0, network.getThreeWindingsTransformer("trf6").getLeg1().getPhaseTapChanger().getTapPosition());
assertNotNull(network.getLoad("newLoad"));
assertNull(network.getLoad("newLoad1"));
assertEquals(EnergySource.HYDRO, network.getGenerator(NEW_GENERATOR_ID).getEnergySource());
assertEquals("v2", network.getGenerator(NEW_GENERATOR_ID).getTerminal().getVoltageLevel().getId());
assertEquals(500., network.getGenerator(NEW_GENERATOR_ID).getMaxP(), 0.1);
assertEquals(100., network.getGenerator(NEW_GENERATOR_ID).getTargetP(), 0.1);
assertTrue(network.getGenerator(NEW_GENERATOR_ID).isVoltageRegulatorOn());
assertEquals(225., network.getGenerator(NEW_GENERATOR_ID).getTargetV(), 0.1);
assertEquals("v1", network.getLine("newLine").getTerminal1().getVoltageLevel().getId());
assertEquals("v2", network.getLine("newLine").getTerminal2().getVoltageLevel().getId());
assertEquals(4., network.getLine("newLine").getB1(), 0.1);
assertEquals("v1", network.getTwoWindingsTransformer("new2wt").getTerminal1().getVoltageLevel().getId());
assertEquals("v2", network.getTwoWindingsTransformer("new2wt").getTerminal2().getVoltageLevel().getId());
assertEquals(2., network.getTwoWindingsTransformer("new2wt").getX(), 0.1);
assertEquals(5., network.getTwoWindingsTransformer("new2wt").getRatedU1(), 0.1);
assertEquals(1, network.getTwoWindingsTransformer("new2wt").getRatedS(), 0.1);
assertEquals(4, network.getTwoWindingsTransformer("new2wt").getRatioTapChanger().getStepCount());
assertEquals(3, network.getTwoWindingsTransformer("new2wt").getPhaseTapChanger().getStepCount());
assertEquals(PhaseTapChanger.RegulationMode.CURRENT_LIMITER, network.getTwoWindingsTransformer("new2wt").getPhaseTapChanger().getRegulationMode());
assertNotNull(network.getShuntCompensator("v2shunt"));
assertEquals(Country.FR, network.getSubstation("newSubstation").getCountry().orElse(Country.AF));
assertNotNull(network.getVoltageLevel("vl9"));
assertNotNull(network.getShuntCompensator("shunt9"));

TestUtils.purgeRequests(server);
}

Expand Down

0 comments on commit 032996f

Please sign in to comment.