You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/06 05:07:35 UTC

[GitHub] [kafka] lihaosky commented on a diff in pull request #12944: [KAFKA-14395] add config to configure client supplier

lihaosky commented on code in PR #12944:
URL: https://github.com/apache/kafka/pull/12944#discussion_r1040472261


##########
streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java:
##########
@@ -1088,6 +1088,28 @@ public void shouldTriggerRecordingOfRocksDBMetricsIfRecordingLevelIsDebug() {
         }
     }
 
+    @Test
+    public void shouldGetClientSupplierFromConfigForConstructor() {
+        final StreamsConfig config = new StreamsConfig(props);
+        final StreamsConfig mockConfig = spy(config);
+        when(mockConfig.getKafkaClientSupplier()).thenReturn(supplier);
+
+        new KafkaStreams(getBuilderWithSource().build(), mockConfig);
+        // It's called once in above when mock
+        verify(mockConfig, times(2)).getKafkaClientSupplier();

Review Comment:
   Somehow above `when(mockConfig.getKafkaClientSupplier()).thenReturn(supplier);` is counted.



##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -1727,6 +1738,15 @@ public static Set<String> verifyTopologyOptimizationConfigs(final String config)
         return verifiedConfigs;
     }
 
+    /**
+     * Return configured KafkaClientSupplier
+     * @return Configured KafkaClientSupplier
+     */
+    public KafkaClientSupplier getKafkaClientSupplier() {

Review Comment:
   Sure. Will update the KIP.



##########
streams/src/test/java/org/apache/kafka/streams/KafkaStreamsTest.java:
##########
@@ -1088,6 +1088,28 @@ public void shouldTriggerRecordingOfRocksDBMetricsIfRecordingLevelIsDebug() {
         }
     }
 
+    @Test
+    public void shouldGetClientSupplierFromConfigForConstructor() {

Review Comment:
   Sure.



-- 
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-unsubscribe@kafka.apache.org

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