use of zipkin.Component.CheckResult in project zipkin by openzipkin.
the class Cassandra3StorageTest method check_failsInsteadOfThrowing.
@Test
public void check_failsInsteadOfThrowing() {
CheckResult result = Cassandra3Storage.builder().contactPoints("1.1.1.1").build().check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(NoHostAvailableException.class);
}
use of zipkin.Component.CheckResult in project zipkin by openzipkin.
the class CassandraStorageTest method check_failsInsteadOfThrowing.
@Test
public void check_failsInsteadOfThrowing() {
CheckResult result = CassandraStorage.builder().contactPoints("1.1.1.1").build().check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(NoHostAvailableException.class);
}
use of zipkin.Component.CheckResult in project zipkin by openzipkin.
the class MySQLStorageTest method check_failsInsteadOfThrowing.
@Test
public void check_failsInsteadOfThrowing() throws SQLException {
DataSource dataSource = mock(DataSource.class);
when(dataSource.getConnection()).thenThrow(new SQLException("foo"));
CheckResult result = storage(dataSource).check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(SQLException.class);
}
use of zipkin.Component.CheckResult in project zipkin by openzipkin.
the class ScribeCollectorTest method check_failsWhenNotStarted.
@Test
public void check_failsWhenNotStarted() {
try (ScribeCollector scribe = ScribeCollector.builder().storage(new InMemoryStorage()).port(12345).build()) {
CheckResult result = scribe.check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(IllegalStateException.class);
scribe.start();
assertThat(scribe.check().ok).isTrue();
}
}
use of zipkin.Component.CheckResult in project zipkin by openzipkin.
the class ElasticsearchStorageTest method check_failsInsteadOfThrowing.
@Test
public void check_failsInsteadOfThrowing() {
CheckResult result = ElasticsearchStorage.builder().cluster("1.1.1.1").build().check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(NoNodeAvailableException.class);
}
Aggregations