[ https://issues.apache.org/jira/browse/KAFKA-8361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16839982#comment-16839982 ]
ASF GitHub Bot commented on KAFKA-8361: --------------------------------------- sekikn commented on pull request #6736: KAFKA-8361. Fix ConsumerPerformanceTest#testNonDetailedHeaderMatchBody to test a real ConsumerPerformance's method URL: https://github.com/apache/kafka/pull/6736 kafka.tools.ConsumerPerformanceTest#testNonDetailedHeaderMatchBody doesn't work as a regression test, since it checks the number of the fields which are output by an inline `println`, not by a real method of ConsumerPerformance. This PR makes ConsumerPerformance's output logic an independent method and testNonDetailedHeaderMatchBody test it. It also includes some formatting fixes. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Fix ConsumerPerformanceTest#testNonDetailedHeaderMatchBody to test a real > ConsumerPerformance's method > ------------------------------------------------------------------------------------------------------ > > Key: KAFKA-8361 > URL: https://issues.apache.org/jira/browse/KAFKA-8361 > Project: Kafka > Issue Type: Improvement > Components: unit tests > Reporter: Kengo Seki > Assignee: Kengo Seki > Priority: Minor > > {{kafka.tools.ConsumerPerformanceTest#testNonDetailedHeaderMatchBody}} > doesn't work as a regression test for now, since it tests an anonymous > function defined in the test method itself. > {code:java} > @Test > def testNonDetailedHeaderMatchBody(): Unit = { > testHeaderMatchContent(detailed = false, 2, () => > println(s"${dateFormat.format(System.currentTimeMillis)}, " + > s"${dateFormat.format(System.currentTimeMillis)}, 1.0, 1.0, 1, 1.0, 1, > 1, 1.1, 1.1")) > } > {code} > It should test a real {{ConsumerPerformance}}'s method, just like > {{testDetailedHeaderMatchBody}}. > {code:java} > @Test > def testDetailedHeaderMatchBody(): Unit = { > testHeaderMatchContent(detailed = true, 2, > () => ConsumerPerformance.printConsumerProgress(1, 1024 * 1024, 0, 1, > 0, 0, 1, dateFormat, 1L)) > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)