|
8 | 8 | package com.powsybl.openrao.searchtreerao.commons.costevaluatorresult; |
9 | 9 |
|
10 | 10 | import com.powsybl.contingency.Contingency; |
| 11 | +import com.powsybl.openrao.commons.OpenRaoException; |
11 | 12 | import com.powsybl.openrao.commons.Unit; |
12 | 13 | import com.powsybl.openrao.data.crac.api.State; |
13 | 14 | import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; |
@@ -161,10 +162,15 @@ void testWithoutAnyTimestampWithExclusion() { |
161 | 162 | addNullTimestamp(); |
162 | 163 | Map<FlowCnec, Double> marginPerCnec = Map.of(flowCnecPreventiveT1, -10.0, flowCnecCurative1T1, -50.0, flowCnecCurative12T1, -40.0, flowCnecCurativeT2, 20.0, flowCnecCurativeT3, -17.0); |
163 | 164 | SumMaxPerTimestampCostEvaluatorResult evaluatorResult = new SumMaxPerTimestampCostEvaluatorResult(marginPerCnec, List.of(), Unit.MEGAWATT); |
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"))); |
| 165 | + try { |
| 166 | + assertEquals(50.0, evaluatorResult.getCost(Set.of(), Set.of())); |
| 167 | + assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1", "contingency-2"), Set.of())); |
| 168 | + assertEquals(40.0, evaluatorResult.getCost(Set.of(), Set.of("cnec-curative1"))); |
| 169 | + assertEquals(17.0, evaluatorResult.getCost(Set.of("contingency-1"), Set.of("cnec-curative1"))); |
| 170 | + } catch (NullPointerException e) { |
| 171 | + e.printStackTrace(); |
| 172 | + throw new OpenRaoException(e); |
| 173 | + } |
168 | 174 | } |
169 | 175 |
|
170 | 176 | @Test |
|
0 commit comments