use of io.confluent.kafkarest.entities.Topic in project kafka-rest by confluentinc.
the class TopicManagerImplTest method listTopics_existingCluster_returnsTopicsWithAuthOperations.
@Test
public void listTopics_existingCluster_returnsTopicsWithAuthOperations() throws Exception {
expect(clusterManager.getCluster(CLUSTER_ID)).andReturn(completedFuture(Optional.of(CLUSTER)));
expect(adminClient.listTopics()).andReturn(listTopicsResult);
expect(listTopicsResult.listings()).andReturn(KafkaFuture.completedFuture(singletonList(new TopicListing("topic-4", false))));
expect(adminClient.describeTopics(isA(Collection.class), anyObject())).andReturn(describeTopicResult);
expect(describeTopicResult.all()).andReturn(KafkaFuture.completedFuture(createTopicDescriptionMap(TOPIC_DESCRIPTION_4)));
replay(clusterManager, adminClient, listTopicsResult, describeTopicResult);
List<Topic> topics = topicManager.listTopics(CLUSTER_ID, true).get();
assertEquals(Arrays.asList(TOPIC_4), topics);
}
Aggregations