private void respondToEndTxn(Errors error) {
        client.respond(
            request -> request instanceof EndTxnRequest,
            new EndTxnResponse(new EndTxnResponseData()
                .setErrorCode(error.code())
                .setThrottleTimeMs(0))
        );
    }
Tests the code path where the target node to send FindCoordinator or InitProducerId
is not ready.
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java