private void assertSuccessfulSend() throws InterruptedException {
        Future<RecordMetadata> future = appendToAccumulator(tp0);
        sender.runOnce(); // send request
        assertEquals(1, client.inFlightRequestCount(), "We should have a single produce request in flight.");
        assertEquals(1, sender.inFlightBatches(tp0).size());
        assertTrue(client.hasInFlightRequests());
        client.respond(produceResponse(tp0, 0, Errors.NONE, 0));
        sender.runOnce();
        assertTrue(future.isDone());
        try {
            future.get();
        } catch (ExecutionException e) {
            fail("Future should not have raised an exception: " + e.getCause());
        }
    }
It creates response with new leader info and new nodes, as stated in KIP-951
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java