1
1
/*
2
2
* The MIT License (MIT)
3
3
*
4
- * Copyright 2015-2025 Valentyn Kolesnikov
4
+ * Copyright 2015-2025 Valentyn Kolesnikov <0009-0003-9608-3364@orcid.org>
5
5
*
6
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
* of this software and associated documentation files (the "Software"), to deal
@@ -594,7 +594,8 @@ void selectTokensGetAllWriters() {
594
594
void fetchGet () {
595
595
U .FetchResponse result =
596
596
U .fetch (
597
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" );
597
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
598
+ + "main/src/test/resources/example.json" );
598
599
result .json ();
599
600
result .jsonMap ();
600
601
assertEquals (
@@ -607,7 +608,8 @@ void fetchGet() {
607
608
assertEquals ("Apple" , U .get ((Map <String , Object >) result .json (), "fruit" ));
608
609
U .Chain <?> resultChain =
609
610
U .chain (
610
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" )
611
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
612
+ + "main/src/test/resources/example.json" )
611
613
.fetch ();
612
614
assertEquals (
613
615
"{\n "
@@ -626,7 +628,8 @@ void downloadUrl() throws IOException, URISyntaxException {
626
628
try {
627
629
long result =
628
630
U .downloadUrl (
629
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
631
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
632
+ + "main/src/test/resources/example.json" ,
630
633
"test.json" );
631
634
assertEquals (65 , result );
632
635
} catch (javax .net .ssl .SSLHandshakeException ignored ) {
@@ -646,7 +649,8 @@ void decompressGzip() throws IOException {
646
649
void fetchGetWithTimeouts () {
647
650
U .FetchResponse result =
648
651
U .fetch (
649
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
652
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
653
+ + "main/src/test/resources/example.json" ,
650
654
30000 ,
651
655
30000 );
652
656
assertEquals (
@@ -691,7 +695,8 @@ void fetchResponseBlob() {
691
695
void fetchGetHttps () {
692
696
U .FetchResponse result =
693
697
U .fetch (
694
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" );
698
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
699
+ + "main/src/test/resources/example.json" );
695
700
assertEquals (
696
701
"{\n "
697
702
+ " \" fruit\" : \" Apple\" ,\n "
@@ -705,7 +710,8 @@ void fetchGetHttps() {
705
710
void fetchPut () {
706
711
U .FetchResponse result =
707
712
U .fetch (
708
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
713
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
714
+ + "main/src/test/resources/example.json" ,
709
715
"PUT" ,
710
716
"{"
711
717
+ " \" dragon\" : {"
@@ -718,7 +724,8 @@ void fetchPut() {
718
724
assertEquals (403 , result .getStatus ());
719
725
U .FetchResponse result2 =
720
726
U .fetch (
721
- "https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json" ,
727
+ "https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
728
+ + "main/src/test/resources/example.json" ,
722
729
"PUT" ,
723
730
"{"
724
731
+ " \" dragon\" : {"
@@ -750,7 +757,7 @@ void fetchPut() {
750
757
+ "<head><title>301 Moved Permanently</title></head>\n "
751
758
+ "<body>\n "
752
759
+ "<center><h1>301 Moved Permanently</h1></center>\n "
753
- + "<hr><center>cloudflare </center>\n "
760
+ + "<hr><center>nginx </center>\n "
754
761
+ "</body>\n "
755
762
+ "</html>\n " ,
756
763
resultChain .item ().replace ("\r \n " , "\n " ));
0 commit comments