@Test
public void shouldRetry() throws TransportException, IOException {

  Sink sink = mock(Sink.class);
  TcpTransport transport = new TcpTransport(sink, 1, 0);
  TcpTransportBuffer transportBuffer = mock(TcpTransportBuffer.class);
  Buffer buffer = new Buffer();
  when(transportBuffer.getInternalBuffer()).thenReturn(buffer);
  doThrow(new IOException()).doNothing().when(sink).write(eq(buffer), eq(0L));
  transport.sendBatch(transportBuffer);
  verify(sink, times(2)).write(eq(buffer), eq(0L));
}