zigarn commented on code in PR #12175: URL: https://github.com/apache/kafka/pull/12175#discussion_r951165346
########## core/src/test/scala/unit/kafka/tools/ConsoleProducerTest.scala: ########## @@ -140,6 +141,29 @@ class ConsoleProducerTest { assert(reader.parseKey) } + @Test + def testParseConfigFile (): Unit = { + val propsFile = TestUtils.tempFile() + val propsStream = Files.newOutputStream(propsFile.toPath) + propsStream.write("parse.key=true\n".getBytes()) + propsStream.write("key.separator=|".getBytes()) + propsStream.close() + + val args = Array( + "--bootstrap-server", "localhost:9092", + "--topic", "test", + "--property", "key.separator=;", + "--property", "parse.headers=true", + "--reader-config", propsFile.getAbsolutePath + ) + val config = new ConsoleProducer.ProducerConfig(args) + val reader = Class.forName(config.readerClass).getDeclaredConstructor().newInstance().asInstanceOf[LineMessageReader] + reader.init(System.in,ConsoleProducer.getReaderProps(config)) + assertEquals(";", reader.keySeparator) + assert(reader.parseKey) + assert(reader.parseHeaders) Review Comment: Fixed -- 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