Skip to content

Commit

Permalink
enable these timeout tests all the time
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed May 9, 2024
1 parent a6e5d35 commit dbe42b7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion unirest-bdd-tests/src/test/java/BehaviorTests/TimeoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@

import static org.junit.jupiter.api.Assertions.*;

@Disabled

class TimeoutTest extends BddTest {

@Test
void requestTmeouts() {
// prime the server
Unirest.get(MockServer.GET).asEmpty();

var ex = assertThrows(UnirestException.class, () -> {
Unirest.get(MockServer.TIMEOUT)
.requestTimeout(5)
Expand All @@ -55,6 +58,20 @@ void requestTmeouts() {
assertEquals(HttpTimeoutException.class, ex.getCause().getClass());
}

@Test
void requestTmeoutsViaGlobalConfig() {
// prime the server
Unirest.get(MockServer.GET).asEmpty();

Unirest.config().requestTimeout(5);

var ex = assertThrows(UnirestException.class, () -> {
Unirest.get(MockServer.TIMEOUT)
.asString();
});
assertEquals(HttpTimeoutException.class, ex.getCause().getClass());
}

@Test @Disabled
void testSetTimeouts() {
String address = MockServer.GET;
Expand Down

0 comments on commit dbe42b7

Please sign in to comment.