soarez commented on code in PR #14290: URL: https://github.com/apache/kafka/pull/14290#discussion_r1358332456
########## clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java: ########## @@ -1170,6 +1174,71 @@ private ConsumerGroupDescribeResponse createConsumerGroupDescribeResponse() { return new ConsumerGroupDescribeResponse(data); } + private AssignReplicasToDirsRequest createAssignReplicasToDirsRequest(short version) { + AssignReplicasToDirsRequestData data = new AssignReplicasToDirsRequestData() + .setBrokerId(1) + .setBrokerEpoch(123L) + .setDirectories(Arrays.asList( + new AssignReplicasToDirsRequestData.DirectoryData() + .setId(Uuid.randomUuid()) + .setTopics(Arrays.asList( + new AssignReplicasToDirsRequestData.TopicData() + .setName("foo") + .setPartitions(Arrays.asList( + new AssignReplicasToDirsRequestData.PartitionData() + .setPartitionIndex(8) + )) + )), + new AssignReplicasToDirsRequestData.DirectoryData() + .setId(Uuid.randomUuid()) + .setTopics(Arrays.asList( + new AssignReplicasToDirsRequestData.TopicData() + .setName("bar") + .setPartitions(Arrays.asList( + new AssignReplicasToDirsRequestData.PartitionData() + .setPartitionIndex(2), + new AssignReplicasToDirsRequestData.PartitionData() + .setPartitionIndex(80) + )) + )) + )); + return new AssignReplicasToDirsRequest.Builder(data).build(version); + } + + private AssignReplicasToDirsResponse createAssignReplicasToDirsResponse() { + AssignReplicasToDirsResponseData data = new AssignReplicasToDirsResponseData() + .setErrorCode(Errors.NONE.code()) + .setThrottleTimeMs(123) + .setDirectories(Arrays.asList( + new AssignReplicasToDirsResponseData.DirectoryData() + .setId(Uuid.randomUuid()) + .setTopics(Arrays.asList( + new AssignReplicasToDirsResponseData.TopicData() + .setName("foo") + .setPartitions(Arrays.asList( + new AssignReplicasToDirsResponseData.PartitionData() + .setPartitionIndex(8) + .setErrorCode(Errors.NONE.code()) + )) + )), + new AssignReplicasToDirsResponseData.DirectoryData() + .setId(Uuid.randomUuid()) + .setTopics(Arrays.asList( + new AssignReplicasToDirsResponseData.TopicData() + .setName("bar") + .setPartitions(Arrays.asList( + new AssignReplicasToDirsResponseData.PartitionData() + .setPartitionIndex(2) + .setErrorCode(Errors.UNKNOWN_TOPIC_OR_PARTITION.code()), + new AssignReplicasToDirsResponseData.PartitionData() + .setPartitionIndex(8) Review Comment: It doesn't really matter. This test suite doesn't test the semantics of the handling logic for each RPC, rather it focuses on aspects around serialization/deserialization. Wrt these changes, the only relevant test is `testSerialization`. -- 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