@SuppressWarnings("deprecation")
    private static  void assertDescriptionContains(Map<String, DescribeLogDirsResponse.LogDirInfo> descriptionsMap,
                                           String logDir, TopicPartition tp, Errors error,
                                           int offsetLag, long partitionSize) {
        assertNotNull(descriptionsMap);
        assertEquals(singleton(logDir), descriptionsMap.keySet());
        assertEquals(error, descriptionsMap.get(logDir).error);
        Map<TopicPartition, DescribeLogDirsResponse.ReplicaInfo> allReplicaInfos =
                descriptionsMap.get(logDir).replicaInfos;
        assertEquals(singleton(tp), allReplicaInfos.keySet());
        assertEquals(partitionSize, allReplicaInfos.get(tp).size);
        assertEquals(offsetLag, allReplicaInfos.get(tp).offsetLag);
        assertFalse(allReplicaInfos.get(tp).isFuture);
    }
Test that we propagate exceptions encountered when fetching metadata.
clients/src/test/java/org/apache/kafka/clients/admin/KafkaAdminClientTest.java