use of org.apache.kafka.common.requests.AddOffsetsToTxnResponse in project kafka by apache.
the class TransactionManagerTest method prepareAddOffsetsToTxnResponse.
private void prepareAddOffsetsToTxnResponse(final Errors error, final String consumerGroupId, final long producerId, final short producerEpoch) {
client.prepareResponse(body -> {
AddOffsetsToTxnRequest addOffsetsToTxnRequest = (AddOffsetsToTxnRequest) body;
assertEquals(consumerGroupId, addOffsetsToTxnRequest.data().groupId());
assertEquals(transactionalId, addOffsetsToTxnRequest.data().transactionalId());
assertEquals(producerId, addOffsetsToTxnRequest.data().producerId());
assertEquals(producerEpoch, addOffsetsToTxnRequest.data().producerEpoch());
return true;
}, new AddOffsetsToTxnResponse(new AddOffsetsToTxnResponseData().setErrorCode(error.code())));
}
Aggregations