Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ public class IterableApiResponseTest {
private MockWebServer server;

@Before
public void setUp() {
public void setUp() throws IOException {
server = new MockWebServer();
// Explicitly start the server to ensure it's ready
try {
server.start();
} catch (IllegalStateException e) {
// Server may already be started by url() call below, which is fine
}
IterableApi.overrideURLEndpointPath(server.url("").toString());
createIterableApi();
}
Expand Down Expand Up @@ -138,7 +144,7 @@ public void onFailure(@NonNull String reason, @Nullable JSONObject data) {
new IterableRequestTask().execute(request);

server.takeRequest(5, TimeUnit.SECONDS);
assertTrue("onFailure is called", signal.await(1, TimeUnit.SECONDS));
assertTrue("onFailure is called", signal.await(5, TimeUnit.SECONDS));
}


Expand Down
Loading
Loading