use of org.apache.kafka.common.message.ListOffsetsRequestData in project kafka by apache.
the class ListOffsetsRequestTest method testDuplicatePartitions.
@Test
public void testDuplicatePartitions() {
List<ListOffsetsTopic> topics = Collections.singletonList(new ListOffsetsTopic().setName("topic").setPartitions(Arrays.asList(new ListOffsetsPartition().setPartitionIndex(0), new ListOffsetsPartition().setPartitionIndex(0))));
ListOffsetsRequestData data = new ListOffsetsRequestData().setTopics(topics).setReplicaId(-1);
ListOffsetsRequest request = ListOffsetsRequest.parse(MessageUtil.toByteBuffer(data, (short) 0), (short) 0);
assertEquals(Collections.singleton(new TopicPartition("topic", 0)), request.duplicatePartitions());
}
Aggregations