Search in sources :

Example 1 with TopicNameCollection

use of org.apache.kafka.common.TopicCollection.TopicNameCollection in project kafka by apache.

the class TopicCollectionTest method testTopicCollection.

@Test
public void testTopicCollection() {
    List<Uuid> topicIds = Arrays.asList(Uuid.randomUuid(), Uuid.randomUuid(), Uuid.randomUuid());
    List<String> topicNames = Arrays.asList("foo", "bar");
    TopicCollection idCollection = TopicCollection.ofTopicIds(topicIds);
    TopicCollection nameCollection = TopicCollection.ofTopicNames(topicNames);
    assertTrue(((TopicIdCollection) idCollection).topicIds().containsAll(topicIds));
    assertTrue(((TopicNameCollection) nameCollection).topicNames().containsAll(topicNames));
}
Also used : Uuid(org.apache.kafka.common.Uuid) TopicIdCollection(org.apache.kafka.common.TopicCollection.TopicIdCollection) TopicCollection(org.apache.kafka.common.TopicCollection) TopicNameCollection(org.apache.kafka.common.TopicCollection.TopicNameCollection) Test(org.junit.jupiter.api.Test)

Aggregations

TopicCollection (org.apache.kafka.common.TopicCollection)1 TopicIdCollection (org.apache.kafka.common.TopicCollection.TopicIdCollection)1 TopicNameCollection (org.apache.kafka.common.TopicCollection.TopicNameCollection)1 Uuid (org.apache.kafka.common.Uuid)1 Test (org.junit.jupiter.api.Test)1