jsancio commented on code in PR #18391: URL: https://github.com/apache/kafka/pull/18391#discussion_r2078362054
########## tools/src/test/java/org/apache/kafka/tools/ProducerPerformanceTest.java: ########## @@ -104,6 +104,20 @@ public void testReadProps() throws Exception { Utils.delete(producerConfig); } + @Test + public void testReadPayloadFileWithAlternateDelimiter() throws Exception { + File payloadFile = createTempFile("Hello~~Kafka"); + String payloadFilePath = payloadFile.getAbsolutePath(); + String payloadDelimiter = "~~"; + + List<byte[]> payloadByteList = ProducerPerformance.readPayloadFile(payloadFilePath, payloadDelimiter); + + assertEquals(2, payloadByteList.size()); + assertEquals("Hello", new String(payloadByteList.get(0))); + assertEquals("Kafka", new String(payloadByteList.get(1))); + Utils.delete(payloadFile); Review Comment: Lets make sure the test always deletes the file. You can use `try ... finally ...` to achieve this. -- 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