RabbitMQCollector extends CollectorComponent { @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); } } RabbitMQCollector(Builder builder); static Builder builder(); @Override RabbitMQCollector start(); @Override CheckResult check(); @Override void close(); @Override final String toString();  }
@Test public void checkFalseWhenRabbitMQIsDown() { CheckResult check = collector.check(); assertThat(check.ok()).isFalse(); assertThat(check.error()).isInstanceOf(UncheckedIOException.class); }