From f18669d2b98b6b17827cafd2908cdaf2b50193a4 Mon Sep 17 00:00:00 2001 From: mroloux Date: Mon, 29 Jun 2026 12:16:15 +0200 Subject: [PATCH] Use httpbingo.org instead of httpbin.seatsio.net --- src/test/java/seatsio/ErrorHandlingTest.java | 8 ++++---- src/test/java/seatsio/ExponentialBackoffTest.java | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/seatsio/ErrorHandlingTest.java b/src/test/java/seatsio/ErrorHandlingTest.java index 0297e9eb..2ab06b91 100644 --- a/src/test/java/seatsio/ErrorHandlingTest.java +++ b/src/test/java/seatsio/ErrorHandlingTest.java @@ -21,8 +21,8 @@ public void test400() { @Test public void test500() { - SeatsioException e = assertThrows(SeatsioException.class, () -> new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbin.seatsio.net/status/500"))); - assertThat(e.getMessage()).isEqualTo("GET https://httpbin.seatsio.net/status/500 resulted in a 500 Internal Server Error response. Body: "); + SeatsioException e = assertThrows(SeatsioException.class, () -> new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbingo.org/status/500"))); + assertThat(e.getMessage()).isEqualTo("GET https://httpbingo.org/status/500 resulted in a 500 Internal Server Error response. Body: "); assertThat(e.errors).isNull(); } @@ -35,8 +35,8 @@ public void testWeirdError() { @Test public void testSocketTimeout() { - SeatsioException e = assertThrows(SeatsioException.class, () -> new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbin.seatsio.net/delay/5").socketTimeout(10))); - assertThat(e.getMessage()).contains("Error while executing GET https://httpbin.seatsio.net/delay/5"); + SeatsioException e = assertThrows(SeatsioException.class, () -> new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbingo.org/delay/5").socketTimeout(10))); + assertThat(e.getMessage()).contains("Error while executing GET https://httpbingo.org/delay/5"); assertThat(e.getCause()).isInstanceOf(UnirestException.class); assertThat(e.getCause().getCause()).isInstanceOf(java.net.SocketTimeoutException.class); assertThat(e.errors).isNull(); diff --git a/src/test/java/seatsio/ExponentialBackoffTest.java b/src/test/java/seatsio/ExponentialBackoffTest.java index 1228faff..775bb9bd 100644 --- a/src/test/java/seatsio/ExponentialBackoffTest.java +++ b/src/test/java/seatsio/ExponentialBackoffTest.java @@ -14,7 +14,7 @@ public class ExponentialBackoffTest { public void abortsEventuallyIfServerKeepsReturning429() { Instant start = Instant.now(); try { - new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbin.seatsio.net/status/429")); + new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbingo.org/status/429")); throw new RuntimeException("Should have failed"); } catch (SeatsioException e) { // TODO: check for RateLimitExceededException when httpbin supports status 429 with a JSON response body @@ -28,10 +28,10 @@ public void abortsEventuallyIfServerKeepsReturning429() { public void abortsDirectlyIfServerReturnsOtherErrorThan429() { Instant start = Instant.now(); try { - new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbin.seatsio.net/status/400")); + new UnirestWrapper("secretKey", null).stringResponse(get("https://httpbingo.org/status/400")); throw new RuntimeException("Should have failed"); } catch (SeatsioException e) { - assertThat(e.getMessage()).isEqualTo("GET https://httpbin.seatsio.net/status/400 resulted in a 400 Bad Request response. Body: "); + assertThat(e.getMessage()).isEqualTo("GET https://httpbingo.org/status/400 resulted in a 400 Bad Request response. Body: "); long waitTime = Instant.now().toEpochMilli() - start.toEpochMilli(); assertThat(waitTime).isLessThan(2000); } @@ -41,10 +41,10 @@ public void abortsDirectlyIfServerReturnsOtherErrorThan429() { public void abortsDirectlyIfMaxRetries0AndServerReturns429() { Instant start = Instant.now(); try { - new UnirestWrapper("secretKey", null).maxRetries(0).stringResponse(get("https://httpbin.seatsio.net/status/429")); + new UnirestWrapper("secretKey", null).maxRetries(0).stringResponse(get("https://httpbingo.org/status/429")); throw new RuntimeException("Should have failed"); } catch (SeatsioException e) { - assertThat(e.getMessage()).isEqualTo("GET https://httpbin.seatsio.net/status/429 resulted in a 429 Too Many Requests response. Body: "); + assertThat(e.getMessage()).isEqualTo("GET https://httpbingo.org/status/429 resulted in a 429 Too Many Requests response. Body: "); long waitTime = Instant.now().toEpochMilli() - start.toEpochMilli(); assertThat(waitTime).isLessThan(2000); } @@ -55,7 +55,7 @@ public void returnsSuccessfullyWhenTheServerSendsA429FirstAndThenASuccessfulResp for (int i = 0; i < 10; ++i) { new UnirestWrapper("secretKey", null) .maxRetries(20) - .stringResponse(get("https://httpbin.seatsio.net/status/429:0.25,204:0.75")); + .stringResponse(get("https://httpbingo.org/status/429:0.25,204:0.75")); } } }