@Test
public void notifiesIfGraphiteIsUnavailable() {

    final String unavailableHost = "unknown-host-10el6m7yg56ge7dmcom";
    InetSocketAddress unavailableAddress = new InetSocketAddress(unavailableHost, 1234);
    try (Graphite unavailableGraphite = new Graphite(unavailableAddress, socketFactory)) {
        unavailableGraphite.connect();
        failBecauseExceptionWasNotThrown(UnknownHostException.class);
    } catch (Exception e) {
        assertThat(e.getMessage())
            .isEqualTo(unavailableHost);
    }
}