use of org.apache.kafka.clients.admin.ListTopicsResult in project ksql by confluentinc.
the class KafkaTopicClientImplTest method getListTopicsResult.
private ListTopicsResult getListTopicsResult() {
ListTopicsResult listTopicsResult = mock(ListTopicsResult.class);
List<String> topicNamesList = Arrays.asList(topicName1, topicName2, topicName3);
expect(listTopicsResult.names()).andReturn(KafkaFuture.completedFuture(new HashSet<>(topicNamesList)));
replay(listTopicsResult);
return listTopicsResult;
}
use of org.apache.kafka.clients.admin.ListTopicsResult in project strimzi by strimzi.
the class BaseKafkaImpl method listTopics.
@Override
public void listTopics(Handler<AsyncResult<Set<String>>> handler) {
LOGGER.debug("Listing topics");
ListTopicsResult future = adminClient.listTopics();
queueWork(new UniWork<>("listTopics", future.names(), handler));
}
use of org.apache.kafka.clients.admin.ListTopicsResult in project ksql by confluentinc.
the class KafkaTopicClientImplTest method getListTopicsResultWithInternalTopics.
private ListTopicsResult getListTopicsResultWithInternalTopics() {
ListTopicsResult listTopicsResult = mock(ListTopicsResult.class);
List<String> topicNamesList = Arrays.asList(topicName1, topicName2, topicName3, internalTopic1, internalTopic2, confluentInternalTopic);
expect(listTopicsResult.names()).andReturn(KafkaFuture.completedFuture(new HashSet<>(topicNamesList)));
replay(listTopicsResult);
return listTopicsResult;
}
use of org.apache.kafka.clients.admin.ListTopicsResult in project ksql by confluentinc.
the class KafkaTopicClientImplTest method getEmptyListTopicResult.
private ListTopicsResult getEmptyListTopicResult() {
ListTopicsResult listTopicsResult = mock(ListTopicsResult.class);
List<String> topicNamesList = Collections.emptyList();
expect(listTopicsResult.names()).andReturn(KafkaFuture.completedFuture(new HashSet<>(topicNamesList)));
replay(listTopicsResult);
return listTopicsResult;
}
use of org.apache.kafka.clients.admin.ListTopicsResult in project ksql by confluentinc.
the class KafkaTopicClientImplTest method listTopicResultWithNotControllerException.
@SuppressWarnings("unchecked")
private ListTopicsResult listTopicResultWithNotControllerException() {
ListTopicsResult listTopicsResult = mock(ListTopicsResult.class);
expect(listTopicsResult.names()).andReturn(failedFuture(new NotControllerException("Not Controller")));
replay(listTopicsResult);
return listTopicsResult;
}
Aggregations