junrao commented on code in PR #15968: URL: https://github.com/apache/kafka/pull/15968#discussion_r2056421991
########## clients/src/test/java/org/apache/kafka/common/requests/ProduceRequestTest.java: ########## @@ -164,7 +188,7 @@ public void testV3AndAboveCannotUseMagicV0() { ProduceRequest.Builder requestBuilder = ProduceRequest.builder(new ProduceRequestData() .setTopicData(new ProduceRequestData.TopicProduceDataCollection(Collections.singletonList( new ProduceRequestData.TopicProduceData() - .setName("test") + .setTopicId(Uuid.fromString("H3Emm3vW7AKKO4NTRPaCWt")) Review Comment: There are still quite a few other usage of `setName`. Should we change them to use `setTopicId`? ########## core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala: ########## @@ -182,13 +185,13 @@ class ProduceRequestTest extends BaseRequestTest { // Send the produce request to the non-replica val records = MemoryRecords.withRecords(Compression.NONE, new SimpleRecord("key".getBytes, "value".getBytes)) - val topicPartition = new TopicPartition("topic", partition) val produceRequest = ProduceRequest.builder(new ProduceRequestData() .setTopicData(new ProduceRequestData.TopicProduceDataCollection(Collections.singletonList( new ProduceRequestData.TopicProduceData() - .setName(topicPartition.topic()) + .setName("topic") Review Comment: This is still not removed. It's a bit confusing since there are two ProduceRequestTest, one in scala and another in java. You fixed the one in java, but this one is in scala. ########## core/src/test/scala/unit/kafka/server/ProduceRequestTest.scala: ########## @@ -214,19 +217,20 @@ class ProduceRequestTest extends BaseRequestTest { @ValueSource(strings = Array("kraft")) def testCorruptLz4ProduceRequest(quorum: String): Unit = { val (partition, leader) = createTopicAndFindPartitionWithLeader("topic") + val topicId = getTopicIds().get("topic").get val timestamp = 1000000 val memoryRecords = MemoryRecords.withRecords(Compression.lz4().build(), new SimpleRecord(timestamp, "key".getBytes, "value".getBytes)) // Change the lz4 checksum value (not the kafka record crc) so that it doesn't match the contents val lz4ChecksumOffset = 6 memoryRecords.buffer.array.update(DefaultRecordBatch.RECORD_BATCH_OVERHEAD + lz4ChecksumOffset, 0) - val topicPartition = new TopicPartition("topic", partition) val produceResponse = sendProduceRequest(leader, ProduceRequest.builder(new ProduceRequestData() .setTopicData(new ProduceRequestData.TopicProduceDataCollection(Collections.singletonList( new ProduceRequestData.TopicProduceData() - .setName(topicPartition.topic()) + .setName("topic") Review Comment: This is not removed. -- 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