@Test
public void typical() throws Exception {

  ReplicaInfo ri = new ReplicaInfo(42L, 0L, false);
  TopicPartition topicPartition = new TopicPartition("topic", 0);
  Map<TopicPartition, ReplicaInfo> replicaInfos = Collections.singletonMap(topicPartition, ri);
  LogDirInfo ldi = new LogDirInfo(null, replicaInfos);
  Map<String, LogDirInfo> ldis = Collections.singletonMap("logDir", ldi);
  KafkaFuture<Map<String, LogDirInfo>> kafkaFuture = KafkaFuture.completedFuture(ldis);
  Map<Integer, KafkaFuture<Map<String, LogDirInfo>>> values = Collections.singletonMap(brokerId, kafkaFuture);
  doReturn(describeLogDirsResult).when(adminClient).describeLogDirs(brokerIds);
  doReturn(values).when(describeLogDirsResult).values();
  Map<TopicPartition, Replica> result = underTest.apply(brokerId);
  assertThat(result.size(), is(1));
  Replica replica = new Replica("logDir", 42L);
  assertThat(result.get(topicPartition), is(replica));
}