Skip to content

Commit

Permalink
improve the test testGetTopicsOfGetTopicsResult
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed May 29, 2024
1 parent a802298 commit d942001
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ public void testGetTopicsOfGetTopicsResult(boolean isUsingHttpLookup) throws Exc
assertTrue(topics.contains(partitionedTopic));
assertFalse(topics.contains(nonPersistentTopic));
assertFalse(topics.contains(TopicName.get(partitionedTopic).getPartition(0).toString()));
// Verify the new method "GetTopicsResult.nonPartitionedOrPartitionTopics" works as expected.
Collection<String> nonPartitionedOrPartitionTopics =
lookupService.getTopicsUnderNamespace(NamespaceName.get("public/default"),
Mode.PERSISTENT, "public/default/.*", null).join()
.getNonPartitionedOrPartitionTopics();
assertTrue(nonPartitionedOrPartitionTopics.contains(nonPartitionedTopic));
assertFalse(nonPartitionedOrPartitionTopics.contains(partitionedTopic));
assertFalse(nonPartitionedOrPartitionTopics.contains(nonPersistentTopic));
assertTrue(nonPartitionedOrPartitionTopics.contains(TopicName.get(partitionedTopic).getPartition(0)
.toString()));
assertTrue(nonPartitionedOrPartitionTopics.contains(TopicName.get(partitionedTopic).getPartition(1)
.toString()));
assertTrue(nonPartitionedOrPartitionTopics.contains(TopicName.get(partitionedTopic).getPartition(2)
.toString()));

// Cleanup.
admin.topics().deletePartitionedTopic(partitionedTopic, false);
Expand Down

0 comments on commit d942001

Please sign in to comment.