use of com.linecorp.armeria.client.endpoint.EndpointGroupException in project zipkin by openzipkin.
the class ElasticsearchStorageTest method isOverCapacity.
/**
* See {@link HttpCallTest#unprocessedRequest()} which shows {@link UnprocessedRequestException}
* are re-wrapped as {@link RejectedExecutionException}.
*/
@Test
void isOverCapacity() {
// timeout
assertThat(storage.isOverCapacity(ResponseTimeoutException.get())).isTrue();
// top-level
assertThat(storage.isOverCapacity(new RejectedExecutionException("{\"status\":429,\"error\":{\"type\":\"es_rejected_execution_exception\"}}"))).isTrue();
// re-wrapped
assertThat(storage.isOverCapacity(new RejectedExecutionException("Rejected execution: No endpoints.", new EndpointGroupException("No endpoints")))).isTrue();
// not applicable
assertThat(storage.isOverCapacity(new IllegalStateException("Rejected execution"))).isFalse();
}
Aggregations