OmniaGM commented on code in PR #15999: URL: https://github.com/apache/kafka/pull/15999#discussion_r1639050807
########## connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnectorTest.java: ########## @@ -50,6 +50,40 @@ public class MirrorCheckpointConnectorTest { private static final String CONSUMER_GROUP = "consumer-group-1"; private static final Map<String, ?> SOURCE_OFFSET = MirrorUtils.wrapOffset(0); + @Test + public void testEmitCheckpointsAndSyncGroupOffsetsBothDisabled() { + // disable the checkpoint emission + MirrorCheckpointConfig config = new MirrorCheckpointConfig( + makeProps("emit.checkpoints.enabled", "false", + "sync.group.offsets.enabled", "false")); + + Set<String> knownConsumerGroups = new HashSet<>(); + knownConsumerGroups.add(CONSUMER_GROUP); + // MirrorCheckpointConnector as minimum to run taskConfig() + MirrorCheckpointConnector connector = new MirrorCheckpointConnector(knownConsumerGroups, + config); + List<Map<String, String>> output = connector.taskConfigs(1); + // expect no task will be created + assertEquals(0, output.size(), "MirrorCheckpointConnector not disabled"); + } + + @Test + public void testEmitOffsetSyncsDisabled() { + // disable the checkpoint emission + MirrorCheckpointConfig config = new MirrorCheckpointConfig( + makeProps("emit.checkpoints.enabled", "false", + MirrorConnectorConfig.EMIT_OFFSET_SYNCS_ENABLED, "false")); + + Set<String> knownConsumerGroups = new HashSet<>(); + knownConsumerGroups.add(CONSUMER_GROUP); + // MirrorCheckpointConnector as minimum to run taskConfig() + MirrorCheckpointConnector connector = new MirrorCheckpointConnector(knownConsumerGroups, + config); + List<Map<String, String>> output = connector.taskConfigs(1); + // expect no task will be created + assertEquals(0, output.size(), "MirrorCheckpointConnector not disabled"); Review Comment: extracted this out -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org