Skip to content

Commit 33ca324

Browse files
committed
remove try catch, keep logs
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
1 parent 341e376 commit 33ca324

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/costevaluatorresult/SumMaxPerTimestampCostEvaluatorResultTest.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,10 @@ void testWithoutAnyTimestampWithExclusion() {
161161
addNullTimestamp();
162162
Map<FlowCnec, Double> marginPerCnec = Map.of(flowCnecPreventiveT1, -10.0, flowCnecCurative1T1, -50.0, flowCnecCurative12T1, -40.0, flowCnecCurativeT2, 20.0, flowCnecCurativeT3, -17.0);
163163
SumMaxPerTimestampCostEvaluatorResult evaluatorResult = new SumMaxPerTimestampCostEvaluatorResult(marginPerCnec, List.of(), Unit.MEGAWATT);
164-
try {
165-
assertEquals(50.0, evaluatorResult.getCost(Set.of(), Set.of()));
166-
assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1", "contingency-2"), Set.of()));
167-
assertEquals(40.0, evaluatorResult.getCost(Set.of(), Set.of("cnec-curative1")));
168-
assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1"), Set.of("cnec-curative1")));
169-
} catch (NullPointerException e) {
170-
System.out.println("NullPointerException: " + e.getMessage());
171-
System.out.println(e.getStackTrace());
172-
throw new RuntimeException(e);
173-
}
164+
assertEquals(50.0, evaluatorResult.getCost(Set.of(), Set.of()));
165+
assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1", "contingency-2"), Set.of()));
166+
assertEquals(40.0, evaluatorResult.getCost(Set.of(), Set.of("cnec-curative1")));
167+
assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1"), Set.of("cnec-curative1")));
174168
}
175169

176170
@Test

0 commit comments

Comments
 (0)