tang7526 commented on a change in pull request #10332:
URL: https://github.com/apache/kafka/pull/10332#discussion_r596103233



##########
File path: core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala
##########
@@ -61,14 +59,17 @@ class ProduceRequestTest extends BaseRequestTest {
             .setAcks((-1).toShort)
             .setTimeoutMs(3000)
             .setTransactionalId(null)).build())
-      assertEquals(1, produceResponse.responses.size)
-      val (tp, partitionResponse) = produceResponse.responses.asScala.head
+      assertEquals(1, produceResponse.data.responses.size)
+      val topicProduceResponse = produceResponse.data.responses.asScala.head
+      assertEquals(1, topicProduceResponse.partitionResponses.size)   
+      val partitionProduceResponse = 
topicProduceResponse.partitionResponses.asScala.head;

Review comment:
       Done.

##########
File path: core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala
##########
@@ -152,8 +156,11 @@ class ProduceRequestTest extends BaseRequestTest {
       .setTransactionalId(null)).build()
 
     val produceResponse = sendProduceRequest(nonReplicaId, produceRequest)
-    assertEquals(1, produceResponse.responses.size)
-    assertEquals(Errors.NOT_LEADER_OR_FOLLOWER, 
produceResponse.responses.asScala.head._2.error)
+    assertEquals(1, produceResponse.data.responses.size)
+    val topicProduceResponse = produceResponse.data.responses.asScala.head
+    assertEquals(1, topicProduceResponse.partitionResponses.size)   
+    val partitionProduceResponse = 
topicProduceResponse.partitionResponses.asScala.head;

Review comment:
       Done.

##########
File path: core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala
##########
@@ -43,12 +42,11 @@ class ProduceRequestTest extends BaseRequestTest {
 
   val metricsKeySet = 
KafkaYammerMetrics.defaultRegistry.allMetrics.keySet.asScala
 
-  @nowarn("cat=deprecation")
   @Test
   def testSimpleProduceRequest(): Unit = {
     val (partition, leader) = createTopicAndFindPartitionWithLeader("topic")
 
-    def sendAndCheck(memoryRecords: MemoryRecords, expectedOffset: Long): 
ProduceResponse.PartitionResponse = {
+    def sendAndCheck(memoryRecords: MemoryRecords, expectedOffset: Long): 
ProduceResponseData.PartitionProduceResponse = {

Review comment:
       Done.




----------------------------------------------------------------
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:
[email protected]


Reply via email to