RivenSun2 commented on a change in pull request #11800: URL: https://github.com/apache/kafka/pull/11800#discussion_r814473563
########## File path: clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java ########## @@ -2866,6 +2866,25 @@ public void testUnknownConfigs() { } } + @Test + public void testUnusedAndUnknownConfigs() { + Map<String, Object> props = new HashMap<>(); + props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999"); + props.put(SslConfigs.SSL_PROTOCOL_CONFIG, "TLS"); + props.put(unknownTestConfig, "my_value"); + ConsumerConfig config = new ConsumerConfig(ConsumerConfig.appendDeserializerToConfig(props, new StringDeserializer(), new StringDeserializer())); + + assertTrue(config.unused().contains(SslConfigs.SSL_PROTOCOL_CONFIG)); + assertTrue(config.unknown().contains(unknownTestConfig)); + assertEquals(1, config.unknown().size()); Review comment: In fact, unused.size is not 1, I will add assert for it later. -- 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