use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project spring-boot by spring-projects.
the class ZipkinRestTemplateSenderTests method checkShouldNotRaiseException.
@Test
void checkShouldNotRaiseException() {
this.mockServer.expect(requestTo(ZIPKIN_URL)).andExpect(method(HttpMethod.POST)).andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR));
CheckResult result = this.sut.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).hasMessageContaining("500 Internal Server Error");
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin by openzipkin.
the class RabbitMQCollector method check.
@Override
public CheckResult check() {
try {
start();
CheckResult failure = connection.failure.get();
if (failure != null)
return failure;
return CheckResult.OK;
} catch (Throwable e) {
Call.propagateIfFatal(e);
return CheckResult.failed(e);
}
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin by openzipkin.
the class ScribeCollectorTest method check_failsWhenNotStarted.
@Test
void check_failsWhenNotStarted() {
try (ScribeCollector scribe = ScribeCollector.newBuilder().storage(storage).port(0).build()) {
CheckResult result = scribe.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(IllegalStateException.class);
scribe.start();
assertThat(scribe.check().ok()).isTrue();
}
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin by openzipkin.
the class KafkaCollector method check.
@Override
public CheckResult check() {
try {
// check the kafka workers didn't quit
CheckResult failure = kafkaWorkers.failure.get();
if (failure != null)
return failure;
KafkaFuture<String> maybeClusterId = getAdminClient().describeCluster().clusterId();
maybeClusterId.get(1, TimeUnit.SECONDS);
return CheckResult.OK;
} catch (Throwable e) {
Call.propagateIfFatal(e);
return CheckResult.failed(e);
}
}
use of com.sequenceiq.cloudbreak.core.flow2.CheckResult in project zipkin by openzipkin.
the class ITElasticsearchHealthCheck method noneHealthy.
@Test
public void noneHealthy() {
server1Health.setHealthy(false);
server2Health.setHealthy(false);
try (ElasticsearchStorage storage = context.getBean(ElasticsearchStorage.class)) {
CheckResult result = storage.check();
assertThat(result.ok()).isFalse();
assertThat(result.error()).isInstanceOf(EmptyEndpointGroupException.class);
}
}
Aggregations