use of com.linecorp.armeria.common.grpc.protocol.ArmeriaStatusException in project zipkin-gcp by openzipkin.
the class StackdriverSpanConsumerTest method verifyCheckReturnsFailureWhenServiceFailsForUnknownReason.
@Test
public void verifyCheckReturnsFailureWhenServiceFailsForUnknownReason() {
onClientCall(observer -> {
observer.onError(new RuntimeException("oh no"));
});
CheckResult result = storage.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(ArmeriaStatusException.class).satisfies(e -> assertThat(((ArmeriaStatusException) e).getCode()).isEqualTo(Status.UNKNOWN.getCode().value()));
}
use of com.linecorp.armeria.common.grpc.protocol.ArmeriaStatusException in project zipkin-gcp by openzipkin.
the class StackdriverSpanConsumerTest method verifyCheckReturnsFailureWhenServiceFailsWithKnownGrpcFailure.
@Test
public void verifyCheckReturnsFailureWhenServiceFailsWithKnownGrpcFailure() {
onClientCall(observer -> {
observer.onError(new StatusRuntimeException(Status.RESOURCE_EXHAUSTED));
});
CheckResult result = storage.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(ArmeriaStatusException.class).satisfies(e -> assertThat(((ArmeriaStatusException) e).getCode()).isEqualTo(Status.RESOURCE_EXHAUSTED.getCode().value()));
}
Aggregations