divijvaidya commented on code in PR #13950:
URL: https://github.com/apache/kafka/pull/13950#discussion_r1250972178


##########
core/src/test/scala/integration/kafka/admin/TopicCommandIntegrationTest.scala:
##########
@@ -789,9 +756,9 @@ class TopicCommandIntegrationTest extends 
KafkaServerTestHarness with Logging wi
       }
       val output = TestUtils.grabConsoleOutput(
         topicService.describeTopic(new 
TopicCommandOptions(Array("--under-min-isr-partitions"))))
-      val rows = output.split("\n")
-      assertTrue(rows(0).startsWith(s"\tTopic: $underMinIsrTopic"))
-      assertTrue(rows(1).startsWith(s"\tTopic: $offlineTopic"))
+      val rows = output.split(System.lineSeparator())
+      assertTrue(rows(0).startsWith(s"\tTopic: $underMinIsrTopic"), 
s"Unexpected output: ${rows(0)}")
+      assertTrue(rows(1).startsWith(s"\tTopic: $offlineTopic"), s"Unexpected 
output: ${rows(0)}")

Review Comment:
   rows{1}



##########
core/src/test/scala/integration/kafka/admin/TopicCommandIntegrationTest.scala:
##########
@@ -758,21 +731,15 @@ class TopicCommandIntegrationTest extends 
KafkaServerTestHarness with Logging wi
     val notUnderMinIsrTopic = "not-under-min-isr-topic"
     val offlineTopic = "offline-topic"
     val fullyReplicatedTopic = "fully-replicated-topic"
+    val replicationFactor: Short = 6

Review Comment:
   This can be further moved into a test class level constant as it represents 
the number of brokers in the cluster that are started in the setup() for this 
test. see: 
   
https://github.com/apache/kafka/blob/48eb8c90ef5f474e54694b74377d20f9e378174c/core/src/test/scala/integration/kafka/admin/TopicCommandIntegrationTest.scala#L57



##########
core/src/test/scala/integration/kafka/admin/TopicCommandIntegrationTest.scala:
##########
@@ -789,9 +756,9 @@ class TopicCommandIntegrationTest extends 
KafkaServerTestHarness with Logging wi
       }
       val output = TestUtils.grabConsoleOutput(
         topicService.describeTopic(new 
TopicCommandOptions(Array("--under-min-isr-partitions"))))
-      val rows = output.split("\n")
-      assertTrue(rows(0).startsWith(s"\tTopic: $underMinIsrTopic"))
-      assertTrue(rows(1).startsWith(s"\tTopic: $offlineTopic"))
+      val rows = output.split(System.lineSeparator())

Review Comment:
   Can we extract `System.lineSeparator()` into a class constant as well so 
that we don't have to make System calls every time to figure out this 
information? This isn't going to change throughout the tests in this test class.



-- 
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]

Reply via email to