use of org.apache.kafka.clients.admin.ListTransactionsResult in project kafka by apache.
the class TransactionsCommandTest method expectListTransactions.
private void expectListTransactions(ListTransactionsOptions options, Map<Integer, Collection<TransactionListing>> listingsByBroker) {
ListTransactionsResult listResult = Mockito.mock(ListTransactionsResult.class);
Mockito.when(admin.listTransactions(options)).thenReturn(listResult);
List<TransactionListing> allListings = new ArrayList<>();
listingsByBroker.values().forEach(allListings::addAll);
Mockito.when(listResult.all()).thenReturn(completedFuture(allListings));
Mockito.when(listResult.allByBrokerId()).thenReturn(completedFuture(listingsByBroker));
}
Aggregations