ijuma commented on code in PR #18588:
URL: https://github.com/apache/kafka/pull/18588#discussion_r1923027838


##########
core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala:
##########
@@ -43,25 +42,25 @@ class AddPartitionsTest extends BaseRequestTest {
   val partitionId = 0
 
   val topic1 = "new-topic1"
-  val topic1Assignment = Map(0 -> ReplicaAssignment(Seq(0,1), List(), List()))
+  val topic1Assignment = Map(0 -> List(Seq(0,1), List(), List()))
   val topic2 = "new-topic2"
-  val topic2Assignment = Map(0 -> ReplicaAssignment(Seq(1,2), List(), List()))
+  val topic2Assignment = Map(0 -> List(Seq(1,2), List(), List()))
   val topic3 = "new-topic3"
-  val topic3Assignment = Map(0 -> ReplicaAssignment(Seq(2,3,0,1), List(), 
List()))
+  val topic3Assignment = Map(0 -> List(Seq(2,3,0,1), List(), List()))
   val topic4 = "new-topic4"
-  val topic4Assignment = Map(0 -> ReplicaAssignment(Seq(0,3), List(), List()))
+  val topic4Assignment = Map(0 -> List(Seq(0,3), List(), List()))
   val topic5 = "new-topic5"
-  val topic5Assignment = Map(1 -> ReplicaAssignment(Seq(0,1), List(), List()))
+  val topic5Assignment = Map(1 -> List(Seq(0,1), List(), List()))
   var admin: Admin = _
 
   @BeforeEach
   override def setUp(testInfo: TestInfo): Unit = {
     super.setUp(testInfo)
     brokers.foreach(broker => 
broker.asInstanceOf[BrokerServer].lifecycleManager.initialUnfenceFuture.get())
-    createTopicWithAssignment(topic1, partitionReplicaAssignment = 
topic1Assignment.map { case (k, v) => k -> v.replicas })
-    createTopicWithAssignment(topic2, partitionReplicaAssignment = 
topic2Assignment.map { case (k, v) => k -> v.replicas })
-    createTopicWithAssignment(topic3, partitionReplicaAssignment = 
topic3Assignment.map { case (k, v) => k -> v.replicas })
-    createTopicWithAssignment(topic4, partitionReplicaAssignment = 
topic4Assignment.map { case (k, v) => k -> v.replicas })
+    createTopicWithAssignment(topic1, partitionReplicaAssignment = 
topic1Assignment.map { case (k, v) => k -> v.head })

Review Comment:
   Looks like we always only use the head of the list - can we remove the List 
wrapper altogether?



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

Reply via email to