@@ -616,20 +616,24 @@ void fetchGet() {
616
616
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" );
617
617
result .json ();
618
618
result .jsonMap ();
619
- // assertEquals("{\"gameId\":483159,\"knight\":{\"name\":"
620
- // + "\"Sir. Russell Jones of
621
- // Alberta\",\"attack\":2,\"armor\":7,\"agility\":3,\"endurance\":8}}",
622
- // result.text());
623
- // assertEquals("Sir. Russell Jones of Alberta",
624
- // (String) Underscore.get((Map<String, Object>) result.json(), "knight.name"));
619
+ assertEquals ("{\n "
620
+ + " \" fruit\" : \" Apple\" ,\n "
621
+ + " \" size\" : \" Large\" ,\n "
622
+ + " \" color\" : \" Red\" \n "
623
+ + "}" ,
624
+ result .text ());
625
+ assertEquals ("Apple" ,
626
+ U .get ((Map <String , Object >) result .json (), "fruit" ));
625
627
U .Chain <?> resultChain =
626
628
U .chain (
627
629
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" )
628
630
.fetch ();
629
- // assertEquals("{\"gameId\":483159,\"knight\":{\"name\":"
630
- // + "\"Sir. Russell Jones of
631
- // Alberta\",\"attack\":2,\"armor\":7,\"agility\":3,\"endurance\":8}}",
632
- // resultChain.item());
631
+ assertEquals ("{\n "
632
+ + " \" fruit\" : \" Apple\" ,\n "
633
+ + " \" size\" : \" Large\" ,\n "
634
+ + " \" color\" : \" Red\" \n "
635
+ + "}" ,
636
+ resultChain .item ());
633
637
U .chain (
634
638
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" )
635
639
.fetch ();
@@ -662,10 +666,12 @@ void fetchGetWithTimeouts() {
662
666
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
663
667
30000 ,
664
668
30000 );
665
- // assertEquals("{\"gameId\":483159,\"knight\":{\"name\":"
666
- // + "\"Sir. Russell Jones of
667
- // Alberta\",\"attack\":2,\"armor\":7,\"agility\":3,\"endurance\":8}}",
668
- // result.text());
669
+ assertEquals ("{\n "
670
+ + " \" fruit\" : \" Apple\" ,\n "
671
+ + " \" size\" : \" Large\" ,\n "
672
+ + " \" color\" : \" Red\" \n "
673
+ + "}" ,
674
+ result .text ());
669
675
}
670
676
671
677
@ Test
@@ -725,9 +731,7 @@ void fetchPut() {
725
731
+ " \" fireBreath\" : 10"
726
732
+ " }"
727
733
+ "}" );
728
- // assertEquals("{\"status\":\"Victory\",\"message\":\"Dragon was successful in a
729
- // glorious battle\"}",
730
- // result.text());
734
+ assertEquals (403 , result .getStatus ());
731
735
U .FetchResponse result2 =
732
736
U .fetch (
733
737
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
@@ -743,10 +747,8 @@ void fetchPut() {
743
747
null ,
744
748
null ,
745
749
null );
746
- // assertEquals("{\"status\":\"Defeat\",\"message\":"
747
- // + "\"No dragon showed up, knight dealt his deeds as he pleased.\"}",
748
- // result2.text());
749
- U .Chain resultChain =
750
+ assertEquals (403 , result2 .getStatus ());
751
+ U .Chain <String > resultChain =
750
752
U .chain (
751
753
"http://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" )
752
754
.fetch (
@@ -759,9 +761,13 @@ void fetchPut() {
759
761
+ " \" fireBreath\" : 10"
760
762
+ " }"
761
763
+ "}" );
762
- // assertEquals("{\"status\":\"Victory\",\"message\":\"Dragon was successful in a
763
- // glorious battle\"}",
764
- // resultChain.item());
764
+ assertEquals ("<html>\n "
765
+ + "<head><title>301 Moved Permanently</title></head>\n "
766
+ + "<body>\n "
767
+ + "<center><h1>301 Moved Permanently</h1></center>\n "
768
+ + "<hr><center>cloudflare</center>\n "
769
+ + "</body>\n "
770
+ + "</html>\n " , resultChain .item ().replace ("\r \n " , "\n " ));
765
771
}
766
772
767
773
@ Test
0 commit comments