@@ -358,12 +358,13 @@ public void runTest() throws Exception {
358
358
MvcResult result = mockMvc .perform (post (
359
359
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=AllBusesShortCircuitAnalysis&receiver=me&variantId=" + VARIANT_2_ID , NETWORK_UUID )
360
360
.header (HEADER_USER_ID , "userId" )
361
+ .accept (MediaType .TEXT_PLAIN_VALUE )
361
362
.contentType (MediaType .APPLICATION_JSON )
362
363
.content (parametersJson ))
363
364
.andExpect (status ().isOk ())
364
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
365
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN_VALUE ))
365
366
.andReturn ();
366
- assertEquals (RESULT_UUID , mapper . readValue (result .getResponse ().getContentAsString (), UUID . class ));
367
+ assertEquals (RESULT_UUID , UUID . fromString (result .getResponse ().getContentAsString ()));
367
368
368
369
Message <byte []> resultMessage = output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
369
370
assertEquals (RESULT_UUID .toString (), resultMessage .getHeaders ().get ("resultUuid" ));
@@ -510,12 +511,13 @@ public void testDeterministicResults() throws Exception {
510
511
MvcResult result = mockMvc .perform (post (
511
512
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=AllBusesShortCircuitAnalysis&receiver=me&variantId=" + VARIANT_2_ID , NETWORK_UUID )
512
513
.header (HEADER_USER_ID , "userId" )
514
+ .accept (MediaType .TEXT_PLAIN )
513
515
.contentType (MediaType .APPLICATION_JSON )
514
516
.content (parametersJson ))
515
517
.andExpect (status ().isOk ())
516
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
518
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
517
519
.andReturn ();
518
- assertEquals (RESULT_UUID , mapper . readValue (result .getResponse ().getContentAsString (), UUID . class ));
520
+ assertEquals (RESULT_UUID , UUID . fromString (result .getResponse ().getContentAsString ()));
519
521
520
522
Message <byte []> resultMessage = output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
521
523
assertEquals (RESULT_UUID .toString (), resultMessage .getHeaders ().get ("resultUuid" ));
@@ -561,12 +563,13 @@ public void runWithBusIdTest() throws Exception {
561
563
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=OneBusShortCircuitAnalysis&receiver=me&variantId=" + VARIANT_2_ID , NETWORK_UUID )
562
564
.param (HEADER_BUS_ID , "NGEN" )
563
565
.header (HEADER_USER_ID , "userId" )
566
+ .accept (MediaType .TEXT_PLAIN )
564
567
.contentType (MediaType .APPLICATION_JSON )
565
568
.content (parametersJson ))
566
569
.andExpect (status ().isOk ())
567
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
570
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
568
571
.andReturn ();
569
- assertEquals (RESULT_UUID , mapper . readValue (result .getResponse ().getContentAsString (), UUID . class ));
572
+ assertEquals (RESULT_UUID , UUID . fromString (result .getResponse ().getContentAsString ()));
570
573
571
574
Message <byte []> resultMessage = output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
572
575
assertEquals (RESULT_UUID .toString (), resultMessage .getHeaders ().get ("resultUuid" ));
@@ -624,12 +627,13 @@ public void runWithBusBarSectionIdTest() throws Exception {
624
627
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=OneBusShortCircuitAnalysis&receiver=me&variantId=" + NODE_BREAKER_NETWORK_VARIANT_ID , NODE_BREAKER_NETWORK_UUID )
625
628
.param (HEADER_BUS_ID , "S1VL2_BBS1" )
626
629
.header (HEADER_USER_ID , "userId" )
630
+ .accept (MediaType .TEXT_PLAIN )
627
631
.contentType (MediaType .APPLICATION_JSON )
628
632
.content (parametersJson ))
629
633
.andExpect (status ().isOk ())
630
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
634
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
631
635
.andReturn ();
632
- assertEquals (RESULT_UUID , mapper . readValue (result .getResponse ().getContentAsString (), UUID . class ));
636
+ assertEquals (RESULT_UUID , UUID . fromString (result .getResponse ().getContentAsString ()));
633
637
634
638
Message <byte []> resultMessage = output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
635
639
assertEquals (RESULT_UUID .toString (), resultMessage .getHeaders ().get ("resultUuid" ));
@@ -662,11 +666,12 @@ public void runWithBusBarSectionIdAndErrorTest() throws Exception {
662
666
MvcResult result = mockMvc .perform (post (
663
667
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=OneBusShortCircuitAnalysis&receiver=me&variantId=" + NODE_BREAKER_NETWORK_VARIANT_ID , NODE_BREAKER_NETWORK_UUID )
664
668
.param (HEADER_BUS_ID , "BUSBARSECTION_ID_NOT_EXISTING" )
665
- .header (HEADER_USER_ID , "userId" ))
669
+ .header (HEADER_USER_ID , "userId" )
670
+ .accept (MediaType .TEXT_PLAIN ))
666
671
.andExpect (status ().isOk ())
667
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
672
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
668
673
.andReturn ();
669
- assertEquals (RESULT_UUID , mapper . readValue (result .getResponse ().getContentAsString (), UUID . class ));
674
+ assertEquals (RESULT_UUID , UUID . fromString (result .getResponse ().getContentAsString ()));
670
675
671
676
Message <byte []> runMessage = output .receive (TIMEOUT , shortCircuitAnalysisRunDestination );
672
677
assertEquals (RESULT_UUID .toString (), runMessage .getHeaders ().get ("resultUuid" ));
@@ -697,9 +702,10 @@ public void stopTest() throws Exception {
697
702
698
703
mockMvc .perform (post (
699
704
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reportType=AllBusesShortCircuitAnalysis&receiver=me&variantId=" + VARIANT_2_ID , NETWORK_UUID )
700
- .header (HEADER_USER_ID , "userId" ))
705
+ .header (HEADER_USER_ID , "userId" )
706
+ .accept (MediaType .TEXT_PLAIN ))
701
707
.andExpect (status ().isOk ())
702
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
708
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
703
709
.andReturn ();
704
710
705
711
// stop shortcircuit analysis
@@ -767,9 +773,10 @@ public void runWithReportTest() {
767
773
768
774
mockMvc .perform (post (
769
775
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reporterId=myReporter&receiver=me&reportType=AllBusesShortCircuitAnalysis&reportUuid=" + REPORT_UUID + "&variantId=" + VARIANT_2_ID , NETWORK_UUID )
770
- .header (HEADER_USER_ID , "user" ))
776
+ .header (HEADER_USER_ID , "user" )
777
+ .accept (MediaType .TEXT_PLAIN ))
771
778
.andExpect (status ().isOk ())
772
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
779
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
773
780
.andReturn ();
774
781
775
782
Message <byte []> runMessage = output .receive (TIMEOUT , shortCircuitAnalysisRunDestination );
@@ -791,9 +798,10 @@ public void runWithNoShortcircuitDataTest() {
791
798
792
799
mockMvc .perform (post (
793
800
"/" + VERSION + "/networks/{networkUuid}/run-and-save?reporterId=myReporter&receiver=me&reportType=AllBusesShortCircuitAnalysis&reportUuid=" + REPORT_UUID + "&variantId=" + VARIANT_2_ID , NETWORK_UUID )
794
- .header (HEADER_USER_ID , "user" ))
801
+ .header (HEADER_USER_ID , "user" )
802
+ .accept (MediaType .TEXT_PLAIN ))
795
803
.andExpect (status ().isOk ())
796
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
804
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
797
805
.andReturn ();
798
806
799
807
Message <byte []> runMessage = output .receive (TIMEOUT , shortCircuitAnalysisRunDestination );
@@ -822,10 +830,11 @@ public void checkShortCircuitLimitsTest() throws Exception {
822
830
mockMvc .perform (post (
823
831
"/" + VERSION + "/networks/{networkUuid}/run-and-save?receiver=me&variantId=" + VARIANT_2_ID , NETWORK_UUID )
824
832
.header (HEADER_USER_ID , "userId" )
833
+ .accept (MediaType .TEXT_PLAIN )
825
834
.contentType (MediaType .APPLICATION_JSON )
826
835
.content (parametersJson ))
827
836
.andExpect (status ().isOk ())
828
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
837
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
829
838
.andReturn ();
830
839
output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
831
840
output .receive (TIMEOUT , shortCircuitAnalysisRunDestination );
@@ -846,17 +855,17 @@ public void checkShortCircuitLimitsTest() throws Exception {
846
855
mockMvc .perform (post (
847
856
"/" + VERSION + "/networks/{networkUuid}/run-and-save?receiver=me&variantId=" + VARIANT_4_ID , NETWORK1_UUID )
848
857
.header (HEADER_USER_ID , "userId" )
858
+ .accept (MediaType .TEXT_PLAIN )
849
859
.contentType (MediaType .APPLICATION_JSON )
850
860
.content (parametersJson ))
851
861
.andExpect (status ().isOk ())
852
- .andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
862
+ .andExpect (content ().contentType (MediaType .TEXT_PLAIN ))
853
863
.andReturn ();
854
864
855
865
output .receive (TIMEOUT , shortCircuitAnalysisResultDestination );
856
866
output .receive (TIMEOUT , shortCircuitAnalysisRunDestination );
857
867
858
- result = mockMvc .perform (get (
859
- "/" + VERSION + "/results/{resultUuid}" , RESULT_UUID ))
868
+ result = mockMvc .perform (get ("/" + VERSION + "/results/{resultUuid}" , RESULT_UUID ))
860
869
.andExpect (status ().isOk ())
861
870
.andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
862
871
.andReturn ();
0 commit comments