From 0bf0033d964bac2f1fcb4af670843c10c33187f1 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Wed, 18 Dec 2024 08:05:09 +0800 Subject: [PATCH] MINOR: add assertion about groupEpoch and targetAssignmentEpoch to testConsumerGroups (#18203) Reviewers: David Jacot , Chia-Ping Tsai --- .../kafka/api/PlaintextAdminIntegrationTest.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala index e62ffdf7ff79..81ae104f5602 100644 --- a/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala +++ b/core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala @@ -1938,8 +1938,13 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest { // Test that we can get information about the test consumer group. assertTrue(describeWithFakeGroupResult.describedGroups().containsKey(testGroupId)) var testGroupDescription = describeWithFakeGroupResult.describedGroups().get(testGroupId).get() - assertEquals(groupType == GroupType.CLASSIC, testGroupDescription.groupEpoch.isEmpty) - assertEquals(groupType == GroupType.CLASSIC, testGroupDescription.targetAssignmentEpoch.isEmpty) + if (groupType == GroupType.CLASSIC) { + assertTrue(testGroupDescription.groupEpoch.isEmpty) + assertTrue(testGroupDescription.targetAssignmentEpoch.isEmpty) + } else { + assertEquals(Optional.of(3), testGroupDescription.groupEpoch) + assertEquals(Optional.of(3), testGroupDescription.targetAssignmentEpoch) + } assertEquals(testGroupId, testGroupDescription.groupId()) assertFalse(testGroupDescription.isSimpleConsumerGroup)