Skip to content

Commit caaf7b5

Browse files
committed
test for windows build
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
1 parent a13a6ea commit caaf7b5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ void addTimestamp() {
111111

112112
}
113113

114+
void addNullTimestamp() {
115+
Mockito.when(preventiveStateT1.getTimestamp()).thenReturn(Optional.empty());
116+
Mockito.when(preventiveStateT2.getTimestamp()).thenReturn(Optional.empty());
117+
Mockito.when(preventiveStateT3.getTimestamp()).thenReturn(Optional.empty());
118+
Mockito.when(curativeStateT1.getTimestamp()).thenReturn(Optional.empty());
119+
Mockito.when(curativeStateT2.getTimestamp()).thenReturn(Optional.empty());
120+
Mockito.when(curativeStateT3.getTimestamp()).thenReturn(Optional.empty());
121+
}
122+
114123
@Test
115124
void testEvaluator() {
116125
addTimestamp();
@@ -149,6 +158,7 @@ void testEvaluatorWithExclusion() {
149158

150159
@Test
151160
void testWithoutAnyTimestampWithExclusion() {
161+
addNullTimestamp();
152162
Map<FlowCnec, Double> marginPerCnec = Map.of(flowCnecPreventiveT1, -10.0, flowCnecCurative1T1, -50.0, flowCnecCurative12T1, -40.0, flowCnecCurativeT2, 20.0, flowCnecCurativeT3, -17.0);
153163
SumMaxPerTimestampCostEvaluatorResult evaluatorResult = new SumMaxPerTimestampCostEvaluatorResult(marginPerCnec, List.of(), Unit.MEGAWATT);
154164
assertEquals(50.0, evaluatorResult.getCost(Set.of(), Set.of()));

0 commit comments

Comments
 (0)