brandboat commented on code in PR #20385:
URL: https://github.com/apache/kafka/pull/20385#discussion_r2303421157
##########
tools/src/test/java/org/apache/kafka/tools/ConsumerPerformanceTest.java:
##########
@@ -145,21 +185,61 @@ public void testClientIdOverride() throws IOException {
String[] args = new String[]{
"--bootstrap-server", "localhost:9092",
"--topic", "test",
- "--messages", "10",
+ "--num-records", "10",
+ "--command-config", tempFile.getAbsolutePath()
+ };
+
+ ConsumerPerformance.ConsumerPerfOptions config = new
ConsumerPerformance.ConsumerPerfOptions(args);
+
+ assertEquals("consumer-1",
config.props().getProperty(ConsumerConfig.CLIENT_ID_CONFIG));
+ Files.deleteIfExists(configPath);
+ }
+
+ @Test
+ public void testConsumerConfigDeprecated() throws IOException {
+ Path configPath = tempDir.resolve("test_consumer_config.conf");
+ Files.deleteIfExists(configPath);
+ File tempFile = Files.createFile(configPath).toFile();
+ try (PrintWriter output = new
PrintWriter(Files.newOutputStream(tempFile.toPath()))) {
+ output.println("client.id=consumer-1");
+ output.flush();
+ }
+
+ String[] args = new String[]{
+ "--bootstrap-server", "localhost:9092",
+ "--topic", "test",
+ "--num-records", "10",
"--consumer.config", tempFile.getAbsolutePath()
};
ConsumerPerformance.ConsumerPerfOptions config = new
ConsumerPerformance.ConsumerPerfOptions(args);
assertEquals("consumer-1",
config.props().getProperty(ConsumerConfig.CLIENT_ID_CONFIG));
+ Files.deleteIfExists(configPath);
+ }
+
+ @Test
+ public void testCommandConfigWithConsumerConfigPresent() throws
IOException {
Review Comment:
nit:
```suggestion
public void testCommandConfigWithConsumerConfigPresent() {
```
--
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]