@Test
public void testGetConsumerGroupDetails() {

    // First need to create a topic.
    final String topicName = "AnotherTestTopic-" + System.currentTimeMillis();
    // Create topic
    sharedKafkaTestResource
        .getKafkaTestUtils()
        .createTopic(topicName, 1, (short) 1);
    // Publish data into the topic
    sharedKafkaTestResource
        .getKafkaTestUtils()
        .produceRecords(10, topicName, 0);
    final String consumerId1 = "ConsumerA-" + System.currentTimeMillis();
    final String consumerPrefix = "TestConsumer";
    final String finalConsumerGroupId = consumerPrefix + "-" + consumerId1;
    final String finalConsumerId = finalConsumerGroupId + "-" + Thread.currentThread().getId();
    // Create consumer, consume from topic, keep alive.
    try (final KafkaConsumer consumer = consumeFromTopic(topicName, consumerId1, consumerPrefix)) {
        // Ask for list of consumers.
        final ConsumerGroupDetails consumerGroupDetails = kafkaOperations.getConsumerGroupDetails(finalConsumerGroupId);
        // We should have one
        assertNotNull(consumerGroupDetails);
        // Validate bits
        assertEquals(finalConsumerGroupId, consumerGroupDetails.getGroupId());
        assertFalse(consumerGroupDetails.isSimple());
        assertEquals("range", consumerGroupDetails.getPartitionAssignor());
        assertEquals("Stable", consumerGroupDetails.getState());
        assertEquals(1, consumerGroupDetails.getMembers().size());
        final ConsumerGroupDetails.Member memberDetails = consumerGroupDetails.getMembers().get(0);
        assertNotNull(memberDetails);
        assertEquals("/127.0.0.1", memberDetails.getHost());
        assertEquals(finalConsumerId, memberDetails.getClientId());
        assertTrue(memberDetails.getMemberId().startsWith(finalConsumerId));
    }
}