Skip to content

Commit f03b2ff

Browse files
Upgrade to powsybl-dependencies v2025.0.0 (#176)
Signed-off-by: BOUTIER Charly <[email protected]>
1 parent bcb5803 commit f03b2ff

File tree

6 files changed

+38
-11
lines changed

6 files changed

+38
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<properties>
4545
<jib.from.image>powsybl/java-dynawo:3.0.0</jib.from.image>
46-
<gridsuite-dependencies.version>38.0.0</gridsuite-dependencies.version>
46+
<gridsuite-dependencies.version>39.0.0</gridsuite-dependencies.version>
4747
<liquibase-hibernate-package>org.gridsuite.securityanalysis.server</liquibase-hibernate-package>
4848
<db-util.version>1.0.5</db-util.version>
4949
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package org.gridsuite.securityanalysis.server.report;
9+
10+
import com.google.auto.service.AutoService;
11+
import com.powsybl.commons.report.ReportResourceBundle;
12+
13+
/**
14+
* @author Charly Boutier {@literal <charly.boutier at rte-france.com>}
15+
*/
16+
@AutoService(ReportResourceBundle.class)
17+
public final class SecurityAnalysisServerReportResourceBundle implements ReportResourceBundle {
18+
19+
public static final String BASE_NAME = "org.gridsuite.securityanalysis.server.reports";
20+
21+
public String getBaseName() {
22+
return BASE_NAME;
23+
}
24+
}

src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisWorkerService.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,13 @@ private static void logContingencyEquipmentsNotFound(SecurityAnalysisRunContext
228228
}
229229

230230
ReportNode elementsNotFoundSubReporter = runContext.getReportNode().newReportNode()
231-
.withMessageTemplate("notFoundEquipments", "Equipments not found")
231+
.withMessageTemplate("security.analysis.server.notFoundEquipments")
232232
.add();
233233

234234
contingencyInfosList.forEach(contingencyInfos -> {
235235
String elementsIds = String.join(", ", contingencyInfos.getNotFoundElements());
236236
elementsNotFoundSubReporter.newReportNode()
237-
.withMessageTemplate("contingencyEquipmentNotFound",
238-
"Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}")
237+
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotFound")
239238
.withUntypedValue("elementsIds", elementsIds)
240239
.withUntypedValue("contingencyId", contingencyInfos.getId())
241240
.withSeverity(TypedValue.WARN_SEVERITY)
@@ -252,14 +251,13 @@ private void logContingencyEquipmentsNotConnected(SecurityAnalysisRunContext run
252251
}
253252

254253
ReportNode elementsNotConnectedSubReporter = runContext.getReportNode().newReportNode()
255-
.withMessageTemplate("notConnectedEquipments", "Equipments not connected")
254+
.withMessageTemplate("security.analysis.server.notConnectedEquipments")
256255
.add();
257256

258257
contingencyInfosList.forEach(contingencyInfos -> {
259258
String elementsIds = String.join(", ", contingencyInfos.getNotConnectedElements());
260259
elementsNotConnectedSubReporter.newReportNode()
261-
.withMessageTemplate("contingencyEquipmentNotConnected",
262-
"The following equipments ${elementsIds} in contingency ${contingencyId} are not connected")
260+
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotConnected")
263261
.withUntypedValue("elementsIds", elementsIds)
264262
.withUntypedValue("contingencyId", contingencyInfos.getId())
265263
.withSeverity(TypedValue.WARN_SEVERITY)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
security.analysis.server.notFoundEquipments = Equipments not found
2+
security.analysis.server.contingencyEquipmentNotFound = Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}
3+
security.analysis.server.notConnectedEquipments = Equipments not connected
4+
security.analysis.server.contingencyEquipmentNotConnected = The following equipments ${elementsIds} in contingency ${contingencyId} are not connected
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,11 @@ void runWithReportTestElementsNotFoundAndNotConnected() throws Exception {
721721
SecurityAnalysisResult securityAnalysisResult = mapper.readValue(resultAsString, SecurityAnalysisResult.class);
722722
assertThat(RESULT, new MatcherJson<>(mapper, securityAnalysisResult));
723723

724-
assertLogMessage("Equipments not found", "notFoundEquipments", reportService);
725-
assertLogMessage("Cannot find the following equipments wrongId1, wrongId2 in contingency l1", "contingencyEquipmentNotFound", reportService);
724+
assertLogMessage("Equipments not found", "security.analysis.server.notFoundEquipments", reportService);
725+
assertLogMessage("Cannot find the following equipments wrongId1, wrongId2 in contingency l1", "security.analysis.server.contingencyEquipmentNotFound", reportService);
726726

727-
assertLogMessage("Equipments not connected", "notConnectedEquipments", reportService);
728-
assertLogMessage("The following equipments notConnectedId1 in contingency l4 are not connected", "contingencyEquipmentNotConnected", reportService);
727+
assertLogMessage("Equipments not connected", "security.analysis.server.notConnectedEquipments", reportService);
728+
assertLogMessage("The following equipments notConnectedId1 in contingency l4 are not connected", "security.analysis.server.contingencyEquipmentNotConnected", reportService);
729729
}
730730

731731
@Test

0 commit comments

Comments
 (0)