Search in sources :

Example 1 with EndTxnRequest

use of org.apache.kafka.common.requests.EndTxnRequest in project apache-kafka-on-k8s by banzaicloud.

the class TransactionManagerTest method endTxnMatcher.

private MockClient.RequestMatcher endTxnMatcher(final TransactionResult result, final long pid, final short epoch) {
    return new MockClient.RequestMatcher() {

        @Override
        public boolean matches(AbstractRequest body) {
            EndTxnRequest endTxnRequest = (EndTxnRequest) body;
            assertEquals(transactionalId, endTxnRequest.transactionalId());
            assertEquals(pid, endTxnRequest.producerId());
            assertEquals(epoch, endTxnRequest.producerEpoch());
            assertEquals(result, endTxnRequest.command());
            return true;
        }
    };
}
Also used : EndTxnRequest(org.apache.kafka.common.requests.EndTxnRequest) AbstractRequest(org.apache.kafka.common.requests.AbstractRequest)

Aggregations

AbstractRequest (org.apache.kafka.common.requests.AbstractRequest)1 EndTxnRequest (org.apache.kafka.common.requests.EndTxnRequest)1