Skip to content

Commit b4fb9fa

Browse files
author
LE SAULNIER Kevin
committed
fix: tests
Signed-off-by: LE SAULNIER Kevin <[email protected]>
1 parent 2d417f6 commit b4fb9fa

File tree

2 files changed

+33
-43
lines changed

2 files changed

+33
-43
lines changed

src/main/resources/db/changelog/changesets/changelog_20250903T125946Z.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020
<column name="patl_limit" type="float(53)"/>
2121
</addColumn>
2222
</changeSet>
23-
<changeSet author="lesaulnierkev (generated)" id="1756904408172-5">
24-
<addColumn tableName="contingency_limit_violation">
25-
<column name="upcoming_acceptable_duration" type="integer"/>
26-
</addColumn>
27-
</changeSet>
28-
<changeSet author="lesaulnierkev (generated)" id="1756904408172-46">
29-
<addColumn tableName="pre_contingency_limit_violation">
30-
<column name="upcoming_acceptable_duration" type="integer"/>
31-
</addColumn>
32-
</changeSet>
3323
<changeSet author="lesaulnierkev (generated)" id="1756904408172-7">
3424
<addColumn tableName="contingency_limit_violation">
3525
<column name="patl_loading" type="float(53)"/>

src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisProviderMock.java

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,17 @@ private static SubjectLimitViolationDTO toSubjectLimitViolationDTO(LimitViolatio
231231

232232
return new SubjectLimitViolationDTO(
233233
limitViolation.getSubjectId(),
234-
new LimitViolationDTO(
235-
limitViolation.getLimitType(),
236-
limitViolation.getLimitName(),
237-
limitViolation.getSide(),
238-
limitViolation.getAcceptableDuration(),
239-
limitViolation.getLimit(),
240-
limitViolation.getLimitReduction(),
241-
limitViolation.getValue(),
242-
computedLoading,
243-
ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork())
244-
)
234+
LimitViolationDTO.builder()
235+
.limitType(limitViolation.getLimitType())
236+
.limitName(limitViolation.getLimitName())
237+
.side(limitViolation.getSide())
238+
.acceptableDuration(limitViolation.getAcceptableDuration())
239+
.limit(limitViolation.getLimit())
240+
.limitReduction(limitViolation.getLimitReduction())
241+
.value(limitViolation.getValue())
242+
.loading(computedLoading)
243+
.locationId(ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork()))
244+
.build()
245245
);
246246
}
247247

@@ -258,17 +258,17 @@ private static PreContingencyLimitViolationResultDTO toPreContingencyResultDTO(L
258258
return new PreContingencyLimitViolationResultDTO(
259259
limitViolation.getSubjectId(),
260260
status.name(),
261-
new LimitViolationDTO(
262-
limitViolation.getLimitType(),
263-
limitViolation.getLimitName(),
264-
limitViolation.getSide(),
265-
limitViolation.getAcceptableDuration(),
266-
limitViolation.getLimit(),
267-
limitViolation.getLimitReduction(),
268-
limitViolation.getValue(),
269-
computedLoading,
270-
ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork())
271-
));
261+
LimitViolationDTO.builder()
262+
.limitType(limitViolation.getLimitType())
263+
.limitName(limitViolation.getLimitName())
264+
.side(limitViolation.getSide())
265+
.acceptableDuration(limitViolation.getAcceptableDuration())
266+
.limit(limitViolation.getLimit())
267+
.limitReduction(limitViolation.getLimitReduction())
268+
.value(limitViolation.getValue())
269+
.loading(computedLoading)
270+
.locationId(ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork()))
271+
.build());
272272
}
273273

274274
private static ContingencyResultDTO toContingencyResultDTO(Contingency contingency, String status, List<LimitViolation> limitViolations) {
@@ -295,17 +295,17 @@ private static ContingencyLimitViolationDTO toContingencyLimitViolationDTO(Conti
295295
status,
296296
contingency.getElements().stream().map(e -> new ContingencyElementDTO(e.getId(), e.getType())).toList()
297297
),
298-
new LimitViolationDTO(
299-
limitViolation.getLimitType(),
300-
limitViolation.getLimitName(),
301-
limitViolation.getSide(),
302-
limitViolation.getAcceptableDuration(),
303-
limitViolation.getLimit(),
304-
limitViolation.getLimitReduction(),
305-
limitViolation.getValue(),
306-
computedLoading,
307-
ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork())
308-
)
298+
LimitViolationDTO.builder()
299+
.limitType(limitViolation.getLimitType())
300+
.limitName(limitViolation.getLimitName())
301+
.side(limitViolation.getSide())
302+
.acceptableDuration(limitViolation.getAcceptableDuration())
303+
.limit(limitViolation.getLimit())
304+
.limitReduction(limitViolation.getLimitReduction())
305+
.value(limitViolation.getValue())
306+
.loading(computedLoading)
307+
.locationId(ComputationResultUtils.getViolationLocationId(limitViolation, getNetwork()))
308+
.build()
309309
);
310310
}
311311

0 commit comments

Comments
 (0)