mingyen066 commented on code in PR #20335:
URL: https://github.com/apache/kafka/pull/20335#discussion_r2275013842


##########
core/src/test/scala/unit/kafka/cluster/AssignmentStateTest.scala:
##########
@@ -86,31 +86,33 @@ class AssignmentStateTest extends AbstractPartitionTest {
 
   @ParameterizedTest
   @MethodSource(Array("parameters"))
-  def testPartitionAssignmentStatus(isr: util.List[Integer], replicas: 
util.List[Integer],
-                                    adding: util.List[Integer], removing: 
util.List[Integer],
+  def testPartitionAssignmentStatus(isr: Array[Int], replicas: Array[Int],
+                                    adding: Array[Int], removing: Array[Int],
                                     original: util.List[Int], 
isUnderReplicated: Boolean): Unit = {
-    val leaderState = new PartitionState()
+    val partitionRegistrationBuilder = new PartitionRegistration.Builder()
       .setLeader(brokerId)
+      .setLeaderRecoveryState(LeaderRecoveryState.RECOVERED)
       .setLeaderEpoch(6)
       .setIsr(isr)
       .setPartitionEpoch(1)
       .setReplicas(replicas)
-      .setIsNew(false)
-    if (!adding.isEmpty)
-      leaderState.setAddingReplicas(adding)
-    if (!removing.isEmpty)
-      leaderState.setRemovingReplicas(removing)
+      .setDirectories(DirectoryId.unassignedArray(replicas.length))
+    if (adding.nonEmpty)

Review Comment:
   Those checks are indeed unnecessary.



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