Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/test/java/com/github/underscore/LodashTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ void selectTokensGetAllWriters() {
void fetchGet() {
U.FetchResponse result =
U.fetch(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json");
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json");
result.json();
result.jsonMap();
assertEquals(
Expand All @@ -607,7 +608,8 @@ void fetchGet() {
assertEquals("Apple", U.get((Map<String, Object>) result.json(), "fruit"));
U.Chain<?> resultChain =
U.chain(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json")
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json")
.fetch();
assertEquals(
"{\n"
Expand All @@ -626,7 +628,8 @@ void downloadUrl() throws IOException, URISyntaxException {
try {
long result =
U.downloadUrl(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json",
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json",
"test.json");
assertEquals(65, result);
} catch (javax.net.ssl.SSLHandshakeException ignored) {
Expand All @@ -646,7 +649,8 @@ void decompressGzip() throws IOException {
void fetchGetWithTimeouts() {
U.FetchResponse result =
U.fetch(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json",
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json",
30000,
30000);
assertEquals(
Expand Down Expand Up @@ -706,7 +710,8 @@ void fetchGetHttps() {
void fetchPut() {
U.FetchResponse result =
U.fetch(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json",
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json",
"PUT",
"{"
+ " \"dragon\": {"
Expand All @@ -719,7 +724,8 @@ void fetchPut() {
assertEquals(403, result.getStatus());
U.FetchResponse result2 =
U.fetch(
"https://support.oneskyapp.com/hc/en-us/article_attachments/202761627/example_1.json",
"https://raw.githubusercontent.com/javadev/underscore-java/refs/heads/"
+ "main/src/test/resources/example.json",
"PUT",
"{"
+ " \"dragon\": {"
Expand Down Expand Up @@ -751,7 +757,7 @@ void fetchPut() {
+ "<head><title>301 Moved Permanently</title></head>\n"
+ "<body>\n"
+ "<center><h1>301 Moved Permanently</h1></center>\n"
+ "<hr><center>cloudflare</center>\n"
+ "<hr><center>nginx</center>\n"
+ "</body>\n"
+ "</html>\n",
resultChain.item().replace("\r\n", "\n"));
Expand Down
Loading