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 2020/05/29 15:36:34 UTC

[GitHub] [kafka] tombentley commented on a change in pull request #8755: KAFKA-10069 The user-defined "predicate" and "negate" are not removed…

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



##########
File path: connect/runtime/src/test/java/org/apache/kafka/connect/runtime/ConnectorConfigTest.java
##########
@@ -434,5 +436,56 @@ public void configure(Map<String, ?> configs) {
         }
     }
 
+    @Test
+    public void testConfigDefOverrideByInitialConfigDef() {
+        String alias = "hdt";
+        String prefix = ConnectorConfig.TRANSFORMS_CONFIG + "." + alias + ".";
+        Map<String, String> props = new HashMap<>();
+        props.put(ConnectorConfig.TRANSFORMS_CONFIG, alias);
+        props.put(prefix + "type", HasDuplicateConfigTransformation.class.getName());
+        ConfigDef def = ConnectorConfig.enrich(MOCK_PLUGINS,
+                new ConfigDef(),
+                props,
+                false);
+        Arrays.asList(PredicatedTransformation.PREDICATE_CONFIG,
+                PredicatedTransformation.NEGATE_CONFIG,
+                HasDuplicateConfigTransformation.MUST_EXIST_KEY)
+                .forEach(key -> {
+                    Assert.assertNotNull(def.configKeys().get(prefix + key));

Review comment:
       I think we should assert that the "predicate" and "negate" config were the implicit ones and not the ones defined by `HasDuplicateConfigTransformation`. I guess we could do this by having `HasDuplicateConfigTransformation`'s configs use different types ("negate is `BOOLEAN` in both) and then asserting the expected types.




----------------------------------------------------------------
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:
users@infra.apache.org