mimaison commented on pull request #9545:
URL: https://github.com/apache/kafka/pull/9545#issuecomment-729137112


   @scanterog 
   This PR changes the way the Checkpoint connector works. We need a test to 
exercise the new behaviour.
   Something simple like this would do:
   ```java
   @Test
   public void testFindConsumerGroups() throws Exception {
       MirrorConnectorConfig config = new MirrorConnectorConfig(makeProps());
       MirrorCheckpointConnector connector = new 
MirrorCheckpointConnector(Collections.emptyList(), config);
       connector = spy(connector);
   
       Collection<ConsumerGroupListing> groups = Arrays.asList(
               new ConsumerGroupListing("g1", true),
               new ConsumerGroupListing("g2", false));
       doReturn(groups).when(connector).listConsumerGroups();
       doReturn(true).when(connector).shouldReplicate(anyString());
       List<String> groupFound = connector.findConsumerGroups();
   
       Set<String> expectedGroups = groups.stream().map(g -> 
g.groupId()).collect(Collectors.toSet());
       assertEquals(expectedGroups, new HashSet<>(groupFound));
   }
   ```
   On `trunk` this test fails. But with your PR it passes.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to