use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin by openzipkin.
the class RabbitMQCollectorTest method checkFalseWhenRabbitMQIsDown.
@Test
public void checkFalseWhenRabbitMQIsDown() {
CheckResult check = collector.check();
assertThat(check.ok()).isFalse();
assertThat(check.error()).isInstanceOf(UncheckedIOException.class);
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin-azure by openzipkin.
the class EventHubCollectorTest method check_failsOnRuntimeException_registration.
@Test
public void check_failsOnRuntimeException_registration() {
RuntimeException exception = new RuntimeException();
EventHubCollector collector = new EventHubCollector(new LazyFuture() {
@Override
protected Future<?> compute() {
registration.completeExceptionally(exception);
return registration;
}
});
CheckResult result = collector.check();
assertThat(result.error()).isEqualTo(exception);
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project spring-cloud-gcp by spring-cloud.
the class StackdriverTraceAutoConfiguration method stackdriverReporter.
@Bean(REPORTER_BEAN_NAME)
@ConditionalOnMissingBean(name = REPORTER_BEAN_NAME)
public Reporter<Span> stackdriverReporter(ReporterMetrics reporterMetrics, GcpTraceProperties trace, @Qualifier(SENDER_BEAN_NAME) Sender sender) {
AsyncReporter<Span> asyncReporter = AsyncReporter.builder(sender).queuedMaxSpans(1000).messageTimeout(trace.getMessageTimeout(), TimeUnit.SECONDS).metrics(reporterMetrics).build(StackdriverEncoder.V2);
CheckResult checkResult = asyncReporter.check();
if (!checkResult.ok()) {
LOGGER.warn("Error when performing Stackdriver AsyncReporter health check.", checkResult.error());
}
return asyncReporter;
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin-gcp by openzipkin.
the class ITStackdriverSender method healthcheckFailNoPermission.
@Test
public void healthcheckFailNoPermission() {
CheckResult result = reporterNoPermission.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isNotNull();
assertThat(result.error()).isInstanceOfSatisfying(StatusRuntimeException.class, sre -> assertThat(sre.getStatus().getCode()).isEqualTo(Status.Code.PERMISSION_DENIED));
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin-gcp by openzipkin.
the class StackdriverSenderTest method verifyCheckReturnsFailureWhenServiceFailsWithKnownGrpcFailure.
@Test
public void verifyCheckReturnsFailureWhenServiceFailsWithKnownGrpcFailure() {
onClientCall(observer -> {
observer.onError(new StatusRuntimeException(Status.RESOURCE_EXHAUSTED));
});
CheckResult result = sender.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(StatusRuntimeException.class).hasMessageContaining("RESOURCE_EXHAUSTED");
}
Aggregations