use of com.dtflys.forest.http.ForestResponse in project forest by dromara.
the class ErrorTest method testErrorCallback.
public void testErrorCallback() {
configuration.setTimeout(10);
final AtomicInteger count = new AtomicInteger(0);
final boolean[] ts = new boolean[] { false };
errorClient.testError(new OnError() {
@Override
public void onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) {
int status = response.getStatusCode();
count.incrementAndGet();
assertNotNull(ex);
assertNotNull(request);
}
});
assertEquals(1, count.get());
}
Aggregations