63
63
import static org .mockito .Mockito .times ;
64
64
import static org .mockito .Mockito .verify ;
65
65
import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .get ;
66
+ import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .post ;
66
67
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .content ;
67
68
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
68
69
@@ -318,7 +319,9 @@ void testNetworkAreaDiagram() throws Exception {
318
319
given (networkStoreService .getNetwork (testNetworkId , PreloadingStrategy .COLLECTION )).willReturn (createNetwork ());
319
320
given (networkStoreService .getNetwork (notFoundNetworkId , PreloadingStrategy .COLLECTION )).willThrow (new PowsyblException ());
320
321
321
- MvcResult result = mvc .perform (get ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=0" + "&voltageLevelsIds=vlFr1A" , testNetworkId ))
322
+ MvcResult result = mvc .perform (post ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=0" , testNetworkId )
323
+ .contentType (MediaType .APPLICATION_JSON )
324
+ .content ("[\" vlFr1A\" ]" ))
322
325
.andExpect (status ().isOk ())
323
326
.andExpect (content ().contentTypeCompatibleWith (MediaType .APPLICATION_JSON_VALUE ))
324
327
.andReturn ();
@@ -328,7 +331,9 @@ void testNetworkAreaDiagram() throws Exception {
328
331
assertTrue (stringResult .contains ("additionalMetadata" ));
329
332
assertTrue (stringResult .contains ("<?xml" ));
330
333
331
- result = mvc .perform (get ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=2" + "&voltageLevelsIds=vlFr1A" , testNetworkId ))
334
+ mvc .perform (post ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=2" , testNetworkId )
335
+ .contentType (MediaType .APPLICATION_JSON )
336
+ .content ("[\" vlFr1A\" ]" ))
332
337
.andExpect (status ().isOk ())
333
338
.andExpect (content ().contentTypeCompatibleWith (MediaType .APPLICATION_JSON_VALUE ))
334
339
.andReturn ();
@@ -338,7 +343,9 @@ void testNetworkAreaDiagram() throws Exception {
338
343
assertTrue (stringResult .contains ("additionalMetadata" ));
339
344
assertTrue (stringResult2 .contains ("<?xml" ));
340
345
341
- mvc .perform (get ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=2" + "&voltageLevelsIds=notFound" , testNetworkId ))
346
+ mvc .perform (post ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=2" , testNetworkId )
347
+ .contentType (MediaType .APPLICATION_JSON )
348
+ .content ("[\" notFound\" ]" ))
342
349
.andExpect (status ().isNotFound ());
343
350
}
344
351
@@ -659,7 +666,9 @@ void testNetworkAreaDiagramWithMissingVoltageLevel() throws Exception {
659
666
assertNotNull (voltageLevels );
660
667
assertEquals (1 , voltageLevels .size ());
661
668
assertEquals ("vlFr1A" , voltageLevels .get (0 ).get ("id" ));
662
- mvc .perform (get ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=0" + "&voltageLevelsIds=vlNotFound1,vlNotFound2" , testNetworkId ))
669
+ mvc .perform (post ("/v1/network-area-diagram/{networkUuid}?variantId=" + VARIANT_2_ID + "&depth=0" , testNetworkId )
670
+ .contentType (MediaType .APPLICATION_JSON )
671
+ .content ("[\" vlNotFound1\" , \" vlNotFound2\" ]" ))
663
672
.andExpect (status ().isNotFound ());
664
673
}
665
674
0 commit comments