hudeqi commented on code in PR #13446:
URL: https://github.com/apache/kafka/pull/13446#discussion_r1149996731
##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnectorTest.java:
##########
@@ -123,13 +127,21 @@ public void testFindConsumerGroups() throws Exception {
Collection<ConsumerGroupListing> groups = Arrays.asList(
new ConsumerGroupListing("g1", true),
new ConsumerGroupListing("g2", false));
+ Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>();
+ offsets.put(new TopicPartition("t1", 0), new OffsetAndMetadata(0));
doReturn(groups).when(connector).listConsumerGroups();
- doReturn(true).when(connector).shouldReplicate(anyString());
+
doReturn(true).when(connector).shouldReplicateByTopicFilter(anyString());
+
doReturn(true).when(connector).shouldReplicateByGroupFilter(anyString());
+
doReturn(offsets).when(connector).listConsumerGroupOffsets(anyString());
List<String> groupFound = connector.findConsumerGroups();
Set<String> expectedGroups =
groups.stream().map(ConsumerGroupListing::groupId).collect(Collectors.toSet());
assertEquals(expectedGroups, new HashSet<>(groupFound),
"Expected groups are not the same as findConsumerGroups");
+
+
doReturn(false).when(connector).shouldReplicateByTopicFilter(anyString());
Review Comment:
nice! I have added a relatively comprehensive test case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]