nileshkumar3 commented on code in PR #21976:
URL: https://github.com/apache/kafka/pull/21976#discussion_r3238555900
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/AbstractHerderTest.java:
##########
@@ -1141,6 +1141,23 @@ public void testTransformationPluginConfig() throws
ClassNotFoundException {
);
}
+ @Test
+ public void testConnectorPluginConfigOmitsInternalKeys() throws Exception {
+ String pluginName = "source-with-internal";
+ Class<?> pluginClass =
Class.forName("org.apache.kafka.connect.runtime.SourceConnectorWithInternalConfig");
+ AbstractHerder herder = testHerder();
+
+ when(plugins.pluginClass(pluginName, null)).then(invocation ->
pluginClass);
+ when(plugins.newPlugin(anyString(), any())).then(invocation ->
pluginClass.getDeclaredConstructor().newInstance());
+ when(herder.plugins()).thenReturn(plugins);
+
+ List<ConfigKeyInfo> configs = herder.connectorPluginConfig(pluginName);
+ assertTrue(configs.stream().anyMatch(c ->
c.name().equals("required")));
+ // any internal config keys should not be exposed
+ assertFalse(configs.stream().anyMatch(c ->
c.name().equals("internal.only.config")));
Review Comment:
added the const.
--
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]