Skip to content

Commit e505f80

Browse files
committed
MINOR: add assertion about groupEpoch and targetAssignmentEpoch to testConsumerGroups
Signed-off-by: PoAn Yang <[email protected]>
1 parent 220c578 commit e505f80

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest {
18101810
* Test the consumer group APIs.
18111811
*/
18121812
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
1813-
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17960"))
1813+
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
18141814
def testConsumerGroups(quorum: String, groupProtocol: String): Unit = {
18151815
val config = createConfig
18161816
client = Admin.create(config)
@@ -1938,8 +1938,13 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest {
19381938
// Test that we can get information about the test consumer group.
19391939
assertTrue(describeWithFakeGroupResult.describedGroups().containsKey(testGroupId))
19401940
var testGroupDescription = describeWithFakeGroupResult.describedGroups().get(testGroupId).get()
1941-
assertEquals(groupType == GroupType.CLASSIC, testGroupDescription.groupEpoch.isEmpty)
1942-
assertEquals(groupType == GroupType.CLASSIC, testGroupDescription.targetAssignmentEpoch.isEmpty)
1941+
if (groupType == GroupType.CLASSIC) {
1942+
assertTrue(testGroupDescription.groupEpoch.isEmpty)
1943+
assertTrue(testGroupDescription.targetAssignmentEpoch.isEmpty)
1944+
} else {
1945+
assertEquals(Optional.of(3), testGroupDescription.groupEpoch)
1946+
assertEquals(Optional.of(3), testGroupDescription.targetAssignmentEpoch)
1947+
}
19431948

19441949
assertEquals(testGroupId, testGroupDescription.groupId())
19451950
assertFalse(testGroupDescription.isSimpleConsumerGroup)
@@ -2167,7 +2172,7 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest {
21672172
* Test the consumer group APIs.
21682173
*/
21692174
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
2170-
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17960"))
2175+
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
21712176
def testConsumerGroupsDeprecatedConsumerGroupState(quorum: String, groupProtocol: String): Unit = {
21722177
val config = createConfig
21732178
client = Admin.create(config)

core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,5 @@ object QuorumTestHarness {
575575

576576
// The following parameter groups are to *temporarily* avoid bugs with the CONSUMER group protocol Consumer
577577
// implementation that would otherwise cause tests to fail.
578-
def getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17960: stream.Stream[Arguments] = getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
579-
def getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17961: stream.Stream[Arguments] = getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
580-
def getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_17964: stream.Stream[Arguments] = getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
581578
def getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly_KAFKA_18034: stream.Stream[Arguments] = getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
582579
}

0 commit comments

Comments
 (0)