@Test
public void closesConnectionIfGraphiteIsUnavailable() throws Exception {

    doThrow(new UnknownHostException("UNKNOWN-HOST")).when(graphite).connect();
    reporter.report(map("gauge", gauge(1)),
        map(),
        map(),
        map(),
        map());
    final InOrder inOrder = inOrder(graphite);
    inOrder.verify(graphite).connect();
    inOrder.verify(graphite).close();
    verifyNoMoreInteractions(graphite);
}