Search in sources :

Example 6 with BrokerKey

use of org.apache.kafka.clients.admin.internals.AllBrokersStrategy.BrokerKey in project kafka by apache.

the class ListTransactionsHandlerTest method testBuildRequestWithoutFilters.

@Test
public void testBuildRequestWithoutFilters() {
    int brokerId = 1;
    BrokerKey brokerKey = new BrokerKey(OptionalInt.of(brokerId));
    ListTransactionsOptions options = new ListTransactionsOptions();
    ListTransactionsHandler handler = new ListTransactionsHandler(options, logContext);
    ListTransactionsRequest request = handler.buildRequest(brokerId, singleton(brokerKey)).build();
    assertEquals(Collections.emptyList(), request.data().producerIdFilters());
    assertEquals(Collections.emptyList(), request.data().stateFilters());
}
Also used : ListTransactionsOptions(org.apache.kafka.clients.admin.ListTransactionsOptions) ListTransactionsRequest(org.apache.kafka.common.requests.ListTransactionsRequest) BrokerKey(org.apache.kafka.clients.admin.internals.AllBrokersStrategy.BrokerKey) Test(org.junit.jupiter.api.Test)

Aggregations

BrokerKey (org.apache.kafka.clients.admin.internals.AllBrokersStrategy.BrokerKey)6 ListTransactionsOptions (org.apache.kafka.clients.admin.ListTransactionsOptions)5 Test (org.junit.jupiter.api.Test)4 ListTransactionsRequest (org.apache.kafka.common.requests.ListTransactionsRequest)3 Collection (java.util.Collection)2 ListTransactionsResponse (org.apache.kafka.common.requests.ListTransactionsResponse)2 TransactionState (org.apache.kafka.clients.admin.TransactionState)1 ListTransactionsResponseData (org.apache.kafka.common.message.ListTransactionsResponseData)1