showuon commented on code in PR #20302:
URL: https://github.com/apache/kafka/pull/20302#discussion_r2297642364
##########
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:
We should put the inputStream.close in the `finally` block. Same as
producerConfigTest
--
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]