|
8 | 8 | package org.gridsuite.modification.modifications; |
9 | 9 |
|
10 | 10 | import com.powsybl.commons.report.ReportNode; |
| 11 | +import com.powsybl.iidm.modification.topology.DefaultNamingStrategy; |
11 | 12 | import com.powsybl.iidm.network.Country; |
12 | 13 | import com.powsybl.iidm.network.Network; |
13 | 14 | import com.powsybl.loadflow.LoadFlowParameters; |
@@ -102,6 +103,13 @@ protected void checkModification() { |
102 | 103 | // No checks implemented for this modification |
103 | 104 | } |
104 | 105 |
|
| 106 | + @Override |
| 107 | + @Test |
| 108 | + public void testApply() throws Exception { |
| 109 | + buildModification().toModification().apply(getNetwork(), new DefaultNamingStrategy(), ReportNode.NO_OP); |
| 110 | + assertAfterNetworkModificationApplication(); |
| 111 | + } |
| 112 | + |
105 | 113 | @Test |
106 | 114 | void testApplyWithLoadFlow() { |
107 | 115 | var infos = BalancesAdjustmentModificationInfos.builder() |
@@ -149,7 +157,7 @@ void testApplyWithLoadFlow() { |
149 | 157 | .build()); |
150 | 158 | BalancesAdjustmentModification modification = (BalancesAdjustmentModification) infos.toModification(); |
151 | 159 | modification.initApplicationContext(null, loadFlowService); |
152 | | - modification.apply(getNetwork(), false); |
| 160 | + modification.apply(getNetwork(), new DefaultNamingStrategy(), ReportNode.NO_OP); |
153 | 161 |
|
154 | 162 | assertEquals(-58d, getNetwork().getGenerator("GH1").getTerminal().getP(), PRECISION); |
155 | 163 | assertEquals(-36d, getNetwork().getGenerator("GH2").getTerminal().getP(), PRECISION); |
@@ -194,7 +202,7 @@ void testLoadFlowParametersNotFound() { |
194 | 202 | .build(); |
195 | 203 |
|
196 | 204 | // Should not throw exception but use default parameters and complete successfully |
197 | | - assertDoesNotThrow(() -> modification.apply(network, false, reportNode)); |
| 205 | + assertDoesNotThrow(() -> modification.apply(network, new DefaultNamingStrategy(), reportNode)); |
198 | 206 |
|
199 | 207 | // Verify that the appropriate report message was generated |
200 | 208 | TestUtils.assertLogMessage( |
@@ -237,7 +245,7 @@ void testLoadFlowProviderNotSpecified() { |
237 | 245 | .build(); |
238 | 246 |
|
239 | 247 | // Should not throw exception but use default parameters and complete successfully |
240 | | - assertDoesNotThrow(() -> modification.apply(network, false, reportNode)); |
| 248 | + assertDoesNotThrow(() -> modification.apply(network, new DefaultNamingStrategy(), reportNode)); |
241 | 249 |
|
242 | 250 | // Verify that the appropriate report message was generated |
243 | 251 | TestUtils.assertLogMessageWithoutRank( |
@@ -273,7 +281,7 @@ void testLoadFlowParametersIdNull() { |
273 | 281 | .build(); |
274 | 282 |
|
275 | 283 | // Should not throw exception but use default parameters and complete successfully |
276 | | - assertDoesNotThrow(() -> modification.apply(network, false, reportNode)); |
| 284 | + assertDoesNotThrow(() -> modification.apply(network, new DefaultNamingStrategy(), reportNode)); |
277 | 285 |
|
278 | 286 | // Verify that the appropriate report message was generated |
279 | 287 | TestUtils.assertLogMessageWithoutRank( |
|
0 commit comments