use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin-gcp by openzipkin.
the class StackdriverSenderTest method verifyCheckReturnsFailureWhenServiceFailsForUnknownReason.
@Test
public void verifyCheckReturnsFailureWhenServiceFailsForUnknownReason() {
onClientCall(observer -> {
observer.onError(new RuntimeException("oh no"));
});
CheckResult result = sender.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(RuntimeException.class).hasMessageContaining("UNKNOWN");
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult 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