@Test
public void shouldFailWhenGraphiteHostUnavailable() {

    ConnectionFactory connectionFactory = new ConnectionFactory();
    connectionFactory.setHost("some-unknown-host");
    try (GraphiteRabbitMQ unavailableGraphite = new GraphiteRabbitMQ(connectionFactory, "graphite")) {
        unavailableGraphite.connect();
        failBecauseExceptionWasNotThrown(UnknownHostException.class);
    } catch (Exception e) {
        assertThat(e.getMessage()).contains("some-unknown-host");
    }
}