@@ -245,6 +245,7 @@ void testNonExisting() {
245
245
.setG2 (0.0 )
246
246
.setB2 (386E-6 / 2 )
247
247
.add ();
248
+ // if not geo-data is associated to a substation, this substation shold not be mentionned in the returned value
248
249
List <SubstationGeoData > substationsGeoData = geoDataService .getSubstationsByCountries (network , new HashSet <>(Collections .singletonList (Country .FR )));
249
250
assertFalse (substationsGeoData .stream ().anyMatch (Objects ::isNull ), "Must not contain nulls" );
250
251
assertFalse (substationsGeoData .stream ().anyMatch (s -> notexistsub1 .getId ().equals (s .getId ())),
@@ -258,6 +259,35 @@ void testNonExisting() {
258
259
"Must not contain unknown lines " + notexistline .getId ());
259
260
}
260
261
262
+ @ Test
263
+ void outOfSubstationVoltageLevelShouldNotHinderLineDataGathering () {
264
+ Network network = EurostagTutorialExample1Factory .create ();
265
+ List <VoltageLevel > existingVls = network .getVoltageLevelStream ().toList ();
266
+ List <Line > existingLines = network .getLineStream ().toList ();
267
+ VoltageLevel p1 = network .newVoltageLevel ()
268
+ .setId ("PIQUAGE1" ).setNominalV (380 ).setTopologyKind (TopologyKind .BUS_BREAKER )
269
+ .add ();
270
+ Bus bus1 = p1 .getBusBreakerView ().newBus ()
271
+ .setId ("NPIQ1" )
272
+ .add ();
273
+ Line halfPiq = network .newLine ()
274
+ .setId ("LINE_PIQ_AT_A_SIDE" )
275
+ .setVoltageLevel1 (existingVls .get (0 ).getId ())
276
+ .setBus1 (existingVls .get (0 ).getBusBreakerView ().getBuses ().iterator ().next ().getId ())
277
+ .setConnectableBus1 (existingVls .get (0 ).getBusBreakerView ().getBuses ().iterator ().next ().getId ())
278
+ .setVoltageLevel2 (p1 .getId ()).setBus2 (bus1 .getId ()).setConnectableBus2 (bus1 .getId ())
279
+ .setR (3.0 )
280
+ .setX (33.0 )
281
+ .setG1 (0.0 )
282
+ .setB1 (386E-6 / 2 )
283
+ .setG2 (0.0 )
284
+ .setB2 (386E-6 / 2 )
285
+ .add ();
286
+
287
+ List <LineGeoData > linesGeoData = geoDataService .getLinesByCountries (network , new HashSet <>(Collections .singletonList (Country .FR )));
288
+ assertEquals (2 , linesGeoData .size ());
289
+ }
290
+
261
291
@ Test
262
292
void testSimilarNeighborhoodOffset () {
263
293
Network network = EurostagTutorialExample1Factory .create ();
0 commit comments