fapaul commented on code in PR #108: URL: https://github.com/apache/flink-connector-kafka/pull/108#discussion_r1678856214
########## flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/source/KafkaSourceBuilderTest.java: ########## @@ -191,6 +196,53 @@ public void testSettingCustomKafkaSubscriber() { "Cannot use partitions for consumption because a ExampleCustomSubscriber is already set for consumption."); } + @Test + public void testSettingCustomKeyDeserializer() { + final String keyDeserializer = TestByteArrayDeserializer.class.getName(); + final KafkaSource<String> kafkaSource = getBasicBuilder().setProperty("key.deserializer", keyDeserializer).build(); + // key.deserializer should be overridden + assertThat( + kafkaSource + .getConfiguration() + .get( + ConfigOptions.key(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG) + .stringType() + .noDefaultValue())) + .isEqualTo(keyDeserializer); + } + + @Test + public void testSettingCustomValueDeserializer() { + final String valueDeserializer = TestByteArrayDeserializer.class.getName(); + final KafkaSource<String> kafkaSource = getBasicBuilder().setProperty("value.deserializer", valueDeserializer).build(); + // value.deserializer should be overridden + assertThat( + kafkaSource + .getConfiguration() + .get( + ConfigOptions.key(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG) + .stringType() + .noDefaultValue())) + .isEqualTo(valueDeserializer); + } Review Comment: Sorry, my initial comment also referred to these tests. The code is identical except the property we set. Can you also convert it to a parameterized test? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org