fvaleri commented on code in PR #20302: URL: https://github.com/apache/kafka/pull/20302#discussion_r2297725911
########## clients/src/test/java/org/apache/kafka/clients/consumer/ConsumerConfigTest.java: ########## @@ -256,4 +261,29 @@ private void testUnsupportedConfigsWithConsumerGroupProtocol(String configName, assertEquals(configName + " cannot be set when " + ConsumerConfig.GROUP_PROTOCOL_CONFIG + "=" + GroupProtocol.CONSUMER.name(), exception.getMessage()); } + + /** + * Validates config/consumer.properties file to avoid getting out of sync with ConsumerConfig. + */ + @Test + public void testValidateConfigPropertiesFile() throws FileNotFoundException { + Properties props = new Properties(); + InputStream inputStream = new FileInputStream( + System.getProperty("user.dir") + "/../config/consumer.properties"); + + try { + props.load(inputStream); + inputStream.close(); Review Comment: Thanks for catching this. InputStream implements Closable, so we can actually use try-with-resources to fix that. See latest commit. -- 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