client.disconnect(client.requests().peek().request().destination());
sender.run(time.milliseconds()); // receive error
sender.run(time.milliseconds()); // reconnect
sender.run(time.milliseconds()); // resend
}
sender.run(time.milliseconds());
completedWithError(future, Errors.NETWORK_EXCEPTION);
}
private void completedWithError(Future<RecordMetadata> future, Errors error) throws Exception {
assertTrue("Request should be completed", future.isDone());