Skip to content

Commit 1276b33

Browse files
authored
Fixed fetch tests
1 parent df2daaa commit 1276b33

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/test/java/com/github/underscore/LodashTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ void selectTokensGetAllWriters() {
594594
void fetchGet() {
595595
U.FetchResponse result =
596596
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");
598599
result.json();
599600
result.jsonMap();
600601
assertEquals(
@@ -607,7 +608,8 @@ void fetchGet() {
607608
assertEquals("Apple", U.get((Map<String, Object>) result.json(), "fruit"));
608609
U.Chain<?> resultChain =
609610
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")
611613
.fetch();
612614
assertEquals(
613615
"{\n"
@@ -626,7 +628,8 @@ void downloadUrl() throws IOException, URISyntaxException {
626628
try {
627629
long result =
628630
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",
630633
"test.json");
631634
assertEquals(65, result);
632635
} catch (javax.net.ssl.SSLHandshakeException ignored) {
@@ -646,7 +649,8 @@ void decompressGzip() throws IOException {
646649
void fetchGetWithTimeouts() {
647650
U.FetchResponse result =
648651
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",
650654
30000,
651655
30000);
652656
assertEquals(
@@ -706,7 +710,8 @@ void fetchGetHttps() {
706710
void fetchPut() {
707711
U.FetchResponse result =
708712
U.fetch(
709-
"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",
710715
"PUT",
711716
"{"
712717
+ " \"dragon\": {"
@@ -719,7 +724,8 @@ void fetchPut() {
719724
assertEquals(403, result.getStatus());
720725
U.FetchResponse result2 =
721726
U.fetch(
722-
"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",
723729
"PUT",
724730
"{"
725731
+ " \"dragon\": {"
@@ -751,7 +757,7 @@ void fetchPut() {
751757
+ "<head><title>301 Moved Permanently</title></head>\n"
752758
+ "<body>\n"
753759
+ "<center><h1>301 Moved Permanently</h1></center>\n"
754-
+ "<hr><center>cloudflare</center>\n"
760+
+ "<hr><center>nginx</center>\n"
755761
+ "</body>\n"
756762
+ "</html>\n",
757763
resultChain.item().replace("\r\n", "\n"));

0 commit comments

Comments
 (0)