divijvaidya commented on code in PR #12976: URL: https://github.com/apache/kafka/pull/12976#discussion_r1232345504
########## core/src/test/scala/unit/kafka/utils/TestUtils.scala: ########## @@ -156,6 +156,21 @@ object TestUtils extends Logging { */ def tempFile(prefix: String, suffix: String): File = JTestUtils.tempFile(prefix, suffix) + /** + * Create a file with the given contents in the default temporary-file directory, + * using `kafka` as the prefix and `tmp` as the suffix to generate its name. + */ + def tempFile(contents: String): File = JTestUtils.tempFile(contents) + + def tempPropertiesFile(properties: Properties): File = { + return tempPropertiesFile(properties.asScala) + } + + def tempPropertiesFile(properties: Map[String, String]): File = { + val content = properties.map{case (k, v) => k + "=" + v}.mkString("\n") Review Comment: please use `System.lineSeparator()` instead of `\n`. It's a much safer way to write newline characters that make the code system independent -- 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