tombentley commented on a change in pull request #10221:
URL: https://github.com/apache/kafka/pull/10221#discussion_r658822455



##########
File path: 
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorConfigTest.java
##########
@@ -262,4 +264,65 @@ public void testTargetAdminConfigWithSourcePrefix() {
         assertEquals(expectedAdminProps, connectorAdminProps, prefix + " 
source connector admin props not matching");
     }
 
+    @Test
+    public void testOffsetSyncsTopic() {
+        // Invalid location
+        Map<String, String> connectorProps = 
makeProps("offset-syncs.topic.location", "something");
+        assertThrows(ConfigException.class, () -> new 
MirrorConnectorConfig(connectorProps));
+
+        connectorProps.put("offset-syncs.topic.location", "source");
+        MirrorConnectorConfig config = new 
MirrorConnectorConfig(connectorProps);
+        assertEquals("mm2-offset-syncs.target2.internal", 
config.offsetSyncsTopic());
+        connectorProps.put("offset-syncs.topic.location", "target");
+        config = new MirrorConnectorConfig(connectorProps);
+        assertEquals("mm2-offset-syncs.source1.internal", 
config.offsetSyncsTopic());
+        // Default to source
+        connectorProps.remove("offset-syncs.topic.location");
+        config = new MirrorConnectorConfig(connectorProps);
+        assertEquals("mm2-offset-syncs.target2.internal", 
config.offsetSyncsTopic());
+    }
+
+    @Test
+    public void testConsumerConfigsForOffsetSyncsTopic() {
+        Map<String, String> connectorProps = makeProps(
+                "source.consumer.max.partition.fetch.bytes", "1",
+                "target.consumer.heartbeat.interval.ms", "1",
+                "consumer.max.poll.interval.ms", "1",
+                "fetch.min.bytes", "1"
+        );
+        MirrorConnectorConfig config = new 
MirrorConnectorConfig(connectorProps);
+        assertEquals(config.sourceConsumerConfig(), 
config.offsetSyncsTopicConsumerConfig());
+        connectorProps.put("offset-syncs.topic.location", "target");
+        config = new MirrorConnectorConfig(connectorProps);
+        assertEquals(config.targetConsumerConfig(), 
config.offsetSyncsTopicConsumerConfig());
+    }
+
+    @Test
+    public void testProducerConfigsForOffsetSyncsTopic() {
+        Map<String, String> connectorProps = makeProps(
+                "source.batch.size", "1",
+                "target.acks", "1",
+                "producer.max.poll.interval.ms", "1",
+                "fetch.min.bytes", "1"
+        );
+        MirrorConnectorConfig config = new 
MirrorConnectorConfig(connectorProps);
+        assertEquals(config.sourceProducerConfig(), 
config.offsetSyncsTopicProducerConfig());
+        connectorProps.put("offset-syncs.topic.location", "target");

Review comment:
       Well, maybe I should have pointed them _all_ out the first time.




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


Reply via email to