From d125883c5e48b2fbec611ef7dd7ecce12f7f8a52 Mon Sep 17 00:00:00 2001 From: Maissa SOUISSI Date: Thu, 16 Nov 2023 10:45:44 +0100 Subject: [PATCH] fixes Signed-off-by: Maissa SOUISSI --- .../loadflow/server/service/LoadFlowWorkerService.java | 3 +-- .../gridsuite/loadflow/server/LoadFlowControllerTest.java | 8 -------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowWorkerService.java b/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowWorkerService.java index fef3885d..cf37b701 100644 --- a/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowWorkerService.java +++ b/src/main/java/org/gridsuite/loadflow/server/service/LoadFlowWorkerService.java @@ -147,8 +147,7 @@ private void cleanLoadFlowResultsAndPublishCancel(UUID resultUuid, String receiv private static LoadingLimits.TemporaryLimit handleEquipmentLimitViolation(Branch branch, LimitViolationInfos violationInfo) { Optional currentLimits = violationInfo.getSide().equals("ONE") ? branch.getCurrentLimits1() : branch.getCurrentLimits2(); - Double permanantLimit = currentLimits.get().getPermanentLimit(); - if (violationInfo.getValue() < permanantLimit) { + if (violationInfo.getValue() < currentLimits.get().getPermanentLimit()) { return null; } else { List temporaryLimits = currentLimits.get().getTemporaryLimits().stream().collect(Collectors.toList()); diff --git a/src/test/java/org/gridsuite/loadflow/server/LoadFlowControllerTest.java b/src/test/java/org/gridsuite/loadflow/server/LoadFlowControllerTest.java index 187e44f5..2344cbc0 100644 --- a/src/test/java/org/gridsuite/loadflow/server/LoadFlowControllerTest.java +++ b/src/test/java/org/gridsuite/loadflow/server/LoadFlowControllerTest.java @@ -147,13 +147,6 @@ private static void assertResultsEquals(LoadFlowResult result, org.gridsuite.loa } } - private static void assertLimitViolationsCalculatedOverloadEquals(List limitViolationsDto) { - assertEquals(60, limitViolationsDto.get(0).getActualOverload(), 0.01); - assertNull(limitViolationsDto.get(0).getUpComingOverload()); - assertNull(limitViolationsDto.get(1).getActualOverload()); - assertEquals(300, limitViolationsDto.get(1).getUpComingOverload(), 0.01); - } - private static void assertLimitViolationsEquals(List limitViolations, List limitViolationsDto, Network network) { assertEquals(limitViolations.size(), limitViolationsDto.size()); @@ -298,7 +291,6 @@ public void testGetLimitViolations() throws Exception { .andReturn(); List limitViolations = mapper.readValue(result.getResponse().getContentAsString(), new TypeReference>() { }); assertLimitViolationsEquals(LimitViolationsMock.limitViolations, limitViolations, network); - //assertLimitViolationsCalculatedOverloadEquals(limitViolations); } }