You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2025/03/29 18:11:14 UTC
(kafka) branch trunk updated: KAFKA-19032 Remove TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames (#19270)
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 4a5ae144eaa KAFKA-19032 Remove TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames (#19270)
4a5ae144eaa is described below
commit 4a5ae144eaaff1607c04dcb35ffa1ebbfeb019c7
Author: PoAn Yang <pa...@apache.org>
AuthorDate: Sun Mar 30 02:11:07 2025 +0800
KAFKA-19032 Remove TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames (#19270)
The zookeeper mode was removed in 4.0. The test cases don't need to
specify quorum. Following variable and functions can be replaced:
- TestWithParameterizedQuorumAndGroupProtocolNames
- getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly
- getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly
- getTestQuorumAndGroupProtocolParametersAll
Reviewers: Chia-Ping Tsai <ch...@gmail.com>
---
.../kafka/api/AuthorizerIntegrationTest.scala | 238 ++++++++++-----------
.../integration/kafka/api/BaseConsumerTest.scala | 18 +-
.../kafka/api/BaseProducerSendTest.scala | 60 +++---
.../integration/kafka/api/BaseQuotaTest.scala | 30 +--
.../integration/kafka/api/ConsumerBounceTest.scala | 42 ++--
...merWithLegacyMessageFormatIntegrationTest.scala | 12 +-
.../kafka/api/CustomQuotaCallbackTest.scala | 6 +-
.../DelegationTokenEndToEndAuthorizationTest.scala | 6 +-
.../kafka/api/EndToEndAuthorizationTest.scala | 78 +++----
.../kafka/api/EndToEndClusterIdTest.scala | 6 +-
.../kafka/api/GroupAuthorizerIntegrationTest.scala | 24 +--
.../kafka/api/PlaintextConsumerAssignTest.scala | 48 ++---
.../kafka/api/PlaintextConsumerAssignorsTest.scala | 54 +++--
.../kafka/api/PlaintextConsumerCallbackTest.scala | 49 +++--
.../kafka/api/PlaintextConsumerCommitTest.scala | 66 +++---
.../kafka/api/PlaintextConsumerFetchTest.scala | 54 ++---
.../kafka/api/PlaintextConsumerPollTest.scala | 66 +++---
.../api/PlaintextConsumerSubscriptionTest.scala | 78 +++----
.../kafka/api/PlaintextConsumerTest.scala | 186 ++++++++--------
.../kafka/api/PlaintextProducerSendTest.scala | 72 +++----
.../kafka/api/ProducerFailureHandlingTest.scala | 18 +-
.../kafka/api/ProducerIdExpirationTest.scala | 18 +-
.../SaslClientsWithInvalidCredentialsTest.scala | 18 +-
.../kafka/api/SaslEndToEndAuthorizationTest.scala | 6 +-
.../kafka/api/SaslMultiMechanismConsumerTest.scala | 6 +-
.../SaslScramSslEndToEndAuthorizationTest.scala | 9 +-
.../kafka/api/TransactionsBounceTest.scala | 6 +-
.../integration/kafka/api/TransactionsTest.scala | 126 +++++------
.../api/TransactionsWithMaxInFlightOneTest.scala | 6 +-
.../server/DynamicBrokerReconfigurationTest.scala | 84 ++++----
.../server/FetchFromFollowerIntegrationTest.scala | 24 +--
.../kafka/server/GssapiAuthenticationTest.scala | 6 +-
...ListenersWithSameSecurityProtocolBaseTest.scala | 6 +-
.../kafka/server/QuorumTestHarness.scala | 26 +--
.../src/test/scala/kafka/utils/TestInfoUtils.scala | 2 -
.../integration/UncleanLeaderElectionTest.scala | 36 ++--
.../scala/unit/kafka/metrics/MetricsTest.scala | 6 +-
.../unit/kafka/server/LogDirFailureTest.scala | 42 ++--
.../unit/kafka/server/ServerShutdownTest.scala | 6 +-
.../tiered/storage/TieredStorageTestHarness.java | 8 +-
.../integration/DisableRemoteLogOnTopicTest.java | 8 +-
.../storage/integration/ListOffsetsTest.java | 12 +-
.../group/ConsumerGroupCommandTestUtils.java | 2 +-
.../SaslClientsWithInvalidCredentialsTest.java | 16 +-
44 files changed, 830 insertions(+), 860 deletions(-)
diff --git a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
index dc78ec18d23..0f465f098ad 100644
--- a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
@@ -714,8 +714,8 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
}
@ParameterizedTest
- @CsvSource(value = Array("kraft,false", "kraft,true"))
- def testTopicIdAuthorization(quorum: String, withTopicExisting: Boolean): Unit = {
+ @CsvSource(value = Array("false", "true"))
+ def testTopicIdAuthorization(withTopicExisting: Boolean): Unit = {
val topicId = if (withTopicExisting) {
createTopicWithBrokerPrincipal(topic)
getTopicIds()(topic)
@@ -942,9 +942,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
sendRecords(producer, numRecords, tp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeUsingAssignWithNoAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeUsingAssignWithNoAccess(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -957,9 +957,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertThrows(classOf[TopicAuthorizationException], () => consumeRecords(consumer))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSimpleConsumeWithOffsetLookupAndNoGroupAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSimpleConsumeWithOffsetLookupAndNoGroupAccess(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -977,9 +977,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(group, e.groupId())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSimpleConsumeWithExplicitSeekAndNoGroupAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSimpleConsumeWithExplicitSeekAndNoGroupAccess(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -997,9 +997,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumeRecords(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeWithoutTopicDescribeAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeWithoutTopicDescribeAccess(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1015,9 +1015,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(Collections.singleton(topic), e.unauthorizedTopics())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeWithTopicDescribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeWithTopicDescribe(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1034,9 +1034,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(Collections.singleton(topic), e.unauthorizedTopics())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeWithTopicWrite(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeWithTopicWrite(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1053,9 +1053,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(Collections.singleton(topic), e.unauthorizedTopics())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeWithTopicAndGroupRead(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeWithTopicAndGroupRead(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1071,9 +1071,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumeRecords(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionWithNoTopicAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionWithNoTopicAccess(groupProtocol: String): Unit = {
val assignSemaphore = new Semaphore(0)
createTopicWithBrokerPrincipal(topic)
@@ -1098,9 +1098,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertTrue(consumer.subscription.isEmpty)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionWithTopicDescribeOnlyAndGroupRead(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionWithTopicDescribeOnlyAndGroupRead(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1116,9 +1116,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(Collections.singleton(topic), e.unauthorizedTopics())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionWithTopicAndGroupRead(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionWithTopicAndGroupRead(groupProtocol: String): Unit = {
val assignSemaphore = new Semaphore(0)
createTopicWithBrokerPrincipal(topic)
@@ -1157,9 +1157,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertTrue(consumer.assignment().isEmpty)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionMatchingInternalTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionMatchingInternalTopic(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1187,9 +1187,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionMatchingInternalTopicWithDescribeOnlyPermission(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionMatchingInternalTopicWithDescribeOnlyPermission(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1213,9 +1213,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(Collections.singleton(GROUP_METADATA_TOPIC_NAME), e.unauthorizedTopics())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscriptionNotMatchingInternalTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscriptionNotMatchingInternalTopic(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, WRITE, ALLOW)), topicResource)
@@ -1232,17 +1232,17 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumeRecords(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCreatePermissionOnTopicToReadFromNonExistentTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCreatePermissionOnTopicToReadFromNonExistentTopic(groupProtocol: String): Unit = {
testCreatePermissionNeededToReadFromNonExistentTopic("newTopic",
Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, CREATE, ALLOW)),
TOPIC)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCreatePermissionOnClusterToReadFromNonExistentTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCreatePermissionOnClusterToReadFromNonExistentTopic(groupProtocol: String): Unit = {
testCreatePermissionNeededToReadFromNonExistentTopic("newTopic",
Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, CREATE, ALLOW)),
CLUSTER)
@@ -1295,24 +1295,24 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithNoAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithNoAccess(groupProtocol: String): Unit = {
val consumer = createConsumer()
assertThrows(classOf[GroupAuthorizationException], () => consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithNoTopicAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithNoTopicAccess(groupProtocol: String): Unit = {
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
val consumer = createConsumer()
assertThrows(classOf[TopicAuthorizationException], () => consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithTopicWrite(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithTopicWrite(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -1321,9 +1321,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertThrows(classOf[TopicAuthorizationException], () => consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithTopicDescribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithTopicDescribe(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -1332,17 +1332,17 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertThrows(classOf[TopicAuthorizationException], () => consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithNoGroupAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithNoGroupAccess(groupProtocol: String): Unit = {
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), topicResource)
val consumer = createConsumer()
assertThrows(classOf[GroupAuthorizationException], () => consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitWithTopicAndGroupRead(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitWithTopicAndGroupRead(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), topicResource)
@@ -1350,17 +1350,17 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumer.commitSync(Map(tp -> new OffsetAndMetadata(5)).asJava)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchWithNoAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchWithNoAccess(groupProtocol: String): Unit = {
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
assertThrows(classOf[TopicAuthorizationException], () => consumer.position(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchWithNoGroupAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchWithNoGroupAccess(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), topicResource)
val consumer = createConsumer()
@@ -1368,18 +1368,18 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertThrows(classOf[GroupAuthorizationException], () => consumer.position(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchWithNoTopicAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchWithNoTopicAccess(groupProtocol: String): Unit = {
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
assertThrows(classOf[TopicAuthorizationException], () => consumer.position(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchAllTopicPartitionsAuthorization(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchAllTopicPartitionsAuthorization(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
val offset = 15L
@@ -1409,9 +1409,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertEquals(offset, offsetFetchResponse.partitionDataMap(group).get(tp).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchMultipleGroupsAuthorization(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchMultipleGroupsAuthorization(groupProtocol: String): Unit = {
val groups: Seq[String] = (1 to 5).map(i => s"group$i")
val groupResources = groups.map(group => new ResourcePattern(GROUP, group, LITERAL))
val topics: Seq[String] = (1 to 3).map(i => s"topic$i")
@@ -1565,9 +1565,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchTopicDescribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchTopicDescribe(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, DESCRIBE, ALLOW)), groupResource)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, DESCRIBE, ALLOW)), topicResource)
@@ -1576,9 +1576,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumer.position(tp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetFetchWithTopicAndGroupRead(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetFetchWithTopicAndGroupRead(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), topicResource)
@@ -1587,32 +1587,32 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
consumer.position(tp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMetadataWithNoTopicAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMetadataWithNoTopicAccess(groupProtocol: String): Unit = {
val consumer = createConsumer()
assertThrows(classOf[TopicAuthorizationException], () => consumer.partitionsFor(topic))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMetadataWithTopicDescribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMetadataWithTopicDescribe(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, DESCRIBE, ALLOW)), topicResource)
val consumer = createConsumer()
consumer.partitionsFor(topic)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testListOffsetsWithNoTopicAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testListOffsetsWithNoTopicAccess(groupProtocol: String): Unit = {
val consumer = createConsumer()
assertThrows(classOf[TopicAuthorizationException], () => consumer.endOffsets(Set(tp).asJava))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testListOffsetsWithTopicDescribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testListOffsetsWithTopicDescribe(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, DESCRIBE, ALLOW)), topicResource)
val consumer = createConsumer()
@@ -1637,9 +1637,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
JTestUtils.assertFutureThrows(classOf[GroupIdNotFoundException], result.describedGroups().get(group))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testListGroupApiWithAndWithoutListGroupAcls(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testListGroupApiWithAndWithoutListGroupAcls(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
// write some record to the topic
@@ -1686,9 +1686,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
otherConsumer.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDeleteGroupApiWithDeleteGroupAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDeleteGroupApiWithDeleteGroupAcl(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -1700,9 +1700,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
createAdminClient().deleteConsumerGroups(Seq(group).asJava).deletedGroups().get(group).get()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDeleteGroupApiWithNoDeleteGroupAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDeleteGroupApiWithNoDeleteGroupAcl(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -1721,9 +1721,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
JTestUtils.assertFutureThrows(classOf[GroupAuthorizationException], result.deletedGroups().get(group))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDeleteGroupOffsetsWithAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDeleteGroupOffsetsWithAcl(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, DELETE, ALLOW)), groupResource)
@@ -1737,9 +1737,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
assertNull(result.partitionResult(tp).get())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDeleteGroupOffsetsWithoutDeleteAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDeleteGroupOffsetsWithoutDeleteAcl(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -1752,9 +1752,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
JTestUtils.assertFutureThrows(classOf[GroupAuthorizationException], result.all())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDeleteGroupOffsetsWithDeleteAclWithoutTopicAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDeleteGroupOffsetsWithDeleteAclWithoutTopicAcl(groupProtocol: String): Unit = {
createTopicWithBrokerPrincipal(topic)
// Create the consumer group
addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, WILDCARD_HOST, READ, ALLOW)), groupResource)
@@ -2483,9 +2483,9 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCreateAndCloseConsumerWithNoAccess(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCreateAndCloseConsumerWithNoAccess(groupProtocol: String): Unit = {
val consumer = createConsumer()
val closeConsumer: Executable = () => consumer.close()
// Close consumer without consuming anything. close() call should pass successfully and throw no exception.
diff --git a/core/src/test/scala/integration/kafka/api/BaseConsumerTest.scala b/core/src/test/scala/integration/kafka/api/BaseConsumerTest.scala
index 82d795b737f..02e30b50c3e 100644
--- a/core/src/test/scala/integration/kafka/api/BaseConsumerTest.scala
+++ b/core/src/test/scala/integration/kafka/api/BaseConsumerTest.scala
@@ -37,9 +37,9 @@ import scala.collection.Seq
*/
abstract class BaseConsumerTest extends AbstractConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSimpleConsumption(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSimpleConsumption(groupProtocol: String): Unit = {
val numRecords = 10000
val producer = createProducer()
val startingTimestamp = System.currentTimeMillis()
@@ -57,9 +57,9 @@ abstract class BaseConsumerTest extends AbstractConsumerTest {
sendAndAwaitAsyncCommit(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testClusterResourceListener(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testClusterResourceListener(groupProtocol: String): Unit = {
val numRecords = 100
val producerProps = new Properties()
producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, classOf[BaseConsumerTest.TestClusterResourceListenerSerializer])
@@ -79,9 +79,9 @@ abstract class BaseConsumerTest extends AbstractConsumerTest {
assertNotEquals(0, BaseConsumerTest.updateConsumerCount.get())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCoordinatorFailover(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCoordinatorFailover(groupProtocol: String): Unit = {
val listener = new TestConsumerReassignmentListener()
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "5001")
diff --git a/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala b/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
index 74111e319b0..e4894729b81 100644
--- a/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
+++ b/core/src/test/scala/integration/kafka/api/BaseProducerSendTest.scala
@@ -128,9 +128,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
* 1. Send with null key/value/partition-id should be accepted; send with null topic should be rejected.
* 2. Last message of the non-blocking send should return the correct offset metadata
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendOffset(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendOffset(groupProtocol: String): Unit = {
val producer = createProducer()
val partition = 0
@@ -190,9 +190,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendCompressedMessageWithCreateTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendCompressedMessageWithCreateTime(groupProtocol: String): Unit = {
val producer = createProducer(
compressionType = "gzip",
lingerMs = Int.MaxValue,
@@ -200,9 +200,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
sendAndVerifyTimestamp(producer, TimestampType.CREATE_TIME)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendNonCompressedMessageWithCreateTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendNonCompressedMessageWithCreateTime(groupProtocol: String): Unit = {
val producer = createProducer(lingerMs = Int.MaxValue, deliveryTimeoutMs = Int.MaxValue)
sendAndVerifyTimestamp(producer, TimestampType.CREATE_TIME)
}
@@ -293,9 +293,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
*
* After close() returns, all messages should be sent with correct returned offset metadata
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testClose(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testClose(groupProtocol: String): Unit = {
val producer = createProducer()
try {
@@ -327,9 +327,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
*
* The specified partition-id should be respected
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendToPartition(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendToPartition(groupProtocol: String): Unit = {
val producer = createProducer()
try {
@@ -367,9 +367,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendToPartitionWithFollowerShutdownShouldNotTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendToPartitionWithFollowerShutdownShouldNotTimeout(groupProtocol: String): Unit = {
// This test produces to a leader that has follower that is shutting down. It shows that
// the produce request succeed, do not timeout and do not need to be retried.
val producer = createProducer()
@@ -420,9 +420,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
* Producer will attempt to send messages to the partition specified in each record, and should
* succeed as long as the partition is included in the metadata.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendBeforeAndAfterPartitionExpansion(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendBeforeAndAfterPartitionExpansion(groupProtocol: String): Unit = {
val producer = createProducer(maxBlockMs = 5 * 1000L)
// create topic
@@ -478,9 +478,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
/**
* Test that flush immediately sends all accumulated requests.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFlush(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFlush(groupProtocol: String): Unit = {
val producer = createProducer(lingerMs = Int.MaxValue, deliveryTimeoutMs = Int.MaxValue)
try {
TestUtils.createTopicWithAdmin(admin, topic, brokers, controllerServers, 2, 2)
@@ -500,9 +500,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
/**
* Test close with zero timeout from caller thread
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCloseWithZeroTimeoutFromCallerThread(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCloseWithZeroTimeoutFromCallerThread(groupProtocol: String): Unit = {
TestUtils.createTopicWithAdmin(admin, topic, brokers, controllerServers, 2, 2)
val partition = 0
consumer.assign(List(new TopicPartition(topic, partition)).asJava)
@@ -526,9 +526,9 @@ abstract class BaseProducerSendTest extends KafkaServerTestHarness {
/**
* Test close with zero and non-zero timeout from sender thread
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCloseWithZeroTimeoutFromSenderThread(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCloseWithZeroTimeoutFromSenderThread(groupProtocol: String): Unit = {
TestUtils.createTopicWithAdmin(admin, topic, brokers, controllerServers, 1, 2)
val partition = 0
consumer.assign(List(new TopicPartition(topic, partition)).asJava)
diff --git a/core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala b/core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala
index f35fc176ae7..ef1246d36d5 100644
--- a/core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala
+++ b/core/src/test/scala/integration/kafka/api/BaseQuotaTest.scala
@@ -92,9 +92,9 @@ abstract class BaseQuotaTest extends IntegrationTestHarness {
}
@Flaky("KAFKA-8073")
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testThrottledProducerConsumer(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testThrottledProducerConsumer(groupProtocol: String): Unit = {
val numRecords = 1000
val produced = quotaTestClients.produceUntilThrottled(numRecords)
quotaTestClients.verifyProduceThrottle(expectThrottle = true)
@@ -104,9 +104,9 @@ abstract class BaseQuotaTest extends IntegrationTestHarness {
quotaTestClients.verifyConsumeThrottle(expectThrottle = true)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProducerConsumerOverrideUnthrottled(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProducerConsumerOverrideUnthrottled(groupProtocol: String): Unit = {
// Give effectively unlimited quota for producer and consumer
val props = new Properties()
props.put(QuotaConfig.PRODUCER_BYTE_RATE_OVERRIDE_CONFIG, Long.MaxValue.toString)
@@ -124,9 +124,9 @@ abstract class BaseQuotaTest extends IntegrationTestHarness {
quotaTestClients.verifyConsumeThrottle(expectThrottle = false)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProducerConsumerOverrideLowerQuota(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProducerConsumerOverrideLowerQuota(groupProtocol: String): Unit = {
// consumer quota is set such that consumer quota * default quota window (10 seconds) is less than
// MAX_PARTITION_FETCH_BYTES_CONFIG, so that we can test consumer ability to fetch in this case
// In this case, 250 * 10 < 4096
@@ -143,9 +143,9 @@ abstract class BaseQuotaTest extends IntegrationTestHarness {
}
@Flaky("KAFKA-18810")
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testQuotaOverrideDelete(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testQuotaOverrideDelete(groupProtocol: String): Unit = {
// Override producer and consumer quotas to unlimited
quotaTestClients.overrideQuotas(Long.MaxValue, Long.MaxValue, Long.MaxValue.toDouble)
quotaTestClients.waitForQuotaUpdate(Long.MaxValue, Long.MaxValue, Long.MaxValue.toDouble)
@@ -170,9 +170,9 @@ abstract class BaseQuotaTest extends IntegrationTestHarness {
quotaTestClients.verifyConsumeThrottle(expectThrottle = true)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testThrottledRequest(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testThrottledRequest(groupProtocol: String): Unit = {
quotaTestClients.overrideQuotas(Long.MaxValue, Long.MaxValue, 0.1)
quotaTestClients.waitForQuotaUpdate(Long.MaxValue, Long.MaxValue, 0.1)
diff --git a/core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala b/core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala
index f05280b24a2..ff8cef56e56 100644
--- a/core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala
+++ b/core/src/test/scala/integration/kafka/api/ConsumerBounceTest.scala
@@ -98,9 +98,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumptionWithBrokerFailures(quorum: String, groupProtocol: String): Unit = consumeWithBrokerFailures(10)
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumptionWithBrokerFailures(groupProtocol: String): Unit = consumeWithBrokerFailures(10)
/*
* 1. Produce a bunch of messages
@@ -143,9 +143,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSeekAndCommitWithBrokerFailures(quorum: String, groupProtocol: String): Unit = seekAndCommitWithBrokerFailures(5)
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSeekAndCommitWithBrokerFailures(groupProtocol: String): Unit = seekAndCommitWithBrokerFailures(5)
def seekAndCommitWithBrokerFailures(numIters: Int): Unit = {
val numRecords = 1000
@@ -187,9 +187,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSubscribeWhenTopicUnavailable(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSubscribeWhenTopicUnavailable(groupProtocol: String): Unit = {
val numRecords = 1000
val newtopic = "newtopic"
@@ -239,9 +239,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
receiveExactRecords(poller, numRecords, 10000L)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testClose(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testClose(groupProtocol: String): Unit = {
val numRecords = 10
val producer = createProducer()
producerSend(producer, numRecords)
@@ -327,10 +327,10 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
* the group should be forced to rebalance when it becomes hosted on a Coordinator with the new config.
* Then, 1 consumer should be left out of the group.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
@Disabled // TODO: To be re-enabled once we can make it less flaky (KAFKA-13421)
- def testRollingBrokerRestartsWithSmallerMaxGroupSizeConfigDisruptsBigGroup(quorum: String, groupProtocol: String): Unit = {
+ def testRollingBrokerRestartsWithSmallerMaxGroupSizeConfigDisruptsBigGroup(groupProtocol: String): Unit = {
val group = "group-max-size-test"
val topic = "group-max-size-test"
val maxGroupSize = 2
@@ -371,9 +371,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
/**
* When we have the consumer group max size configured to X, the X+1th consumer trying to join should receive a fatal exception
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerReceivesFatalExceptionWhenGroupPassesMaxSize(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerReceivesFatalExceptionWhenGroupPassesMaxSize(groupProtocol: String): Unit = {
val group = "fatal-exception-test"
val topic = "fatal-exception-test"
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, "60000")
@@ -412,9 +412,9 @@ class ConsumerBounceTest extends AbstractConsumerTest with Logging {
* immediately if rebalance is in progress. If brokers are not available,
* close should terminate immediately without sending leave group.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCloseDuringRebalance(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCloseDuringRebalance(groupProtocol: String): Unit = {
val topic = "closetest"
createTopic(topic, 10, brokerCount)
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, "60000")
diff --git a/core/src/test/scala/integration/kafka/api/ConsumerWithLegacyMessageFormatIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/ConsumerWithLegacyMessageFormatIntegrationTest.scala
index d7d3629b6a4..e708e045415 100644
--- a/core/src/test/scala/integration/kafka/api/ConsumerWithLegacyMessageFormatIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/ConsumerWithLegacyMessageFormatIntegrationTest.scala
@@ -82,9 +82,9 @@ class ConsumerWithLegacyMessageFormatIntegrationTest extends AbstractConsumerTes
producer.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetsForTimes(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetsForTimes(groupProtocol: String): Unit = {
setupTopics()
val consumer = createConsumer()
@@ -129,9 +129,9 @@ class ConsumerWithLegacyMessageFormatIntegrationTest extends AbstractConsumerTes
assertNull(timestampOffsets.get(t3p1))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testEarliestOrLatestOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testEarliestOrLatestOffsets(groupProtocol: String): Unit = {
setupTopics()
val partitions = Set(t1p0, t1p1, t2p0, t2p1, t3p0, t3p1).asJava
diff --git a/core/src/test/scala/integration/kafka/api/CustomQuotaCallbackTest.scala b/core/src/test/scala/integration/kafka/api/CustomQuotaCallbackTest.scala
index 006a5d085c5..0ed9dc44fdf 100644
--- a/core/src/test/scala/integration/kafka/api/CustomQuotaCallbackTest.scala
+++ b/core/src/test/scala/integration/kafka/api/CustomQuotaCallbackTest.scala
@@ -101,9 +101,9 @@ class CustomQuotaCallbackTest extends IntegrationTestHarness with SaslSetup {
kafkaClientSaslMechanism, JaasTestUtils.KAFKA_SCRAM_ADMIN, JaasTestUtils.KAFKA_SCRAM_ADMIN_PASSWORD)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCustomQuotaCallback(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCustomQuotaCallback(groupProtocol: String): Unit = {
// Large quota override, should not throttle
var brokerId = 0
var user = createGroupWithOneUser("group0_user1", brokerId)
diff --git a/core/src/test/scala/integration/kafka/api/DelegationTokenEndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/DelegationTokenEndToEndAuthorizationTest.scala
index ab5b587a0e6..9c8c8744ebd 100644
--- a/core/src/test/scala/integration/kafka/api/DelegationTokenEndToEndAuthorizationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/DelegationTokenEndToEndAuthorizationTest.scala
@@ -99,9 +99,9 @@ class DelegationTokenEndToEndAuthorizationTest extends EndToEndAuthorizationTest
superuserClientConfig.put(SaslConfigs.SASL_JAAS_CONFIG, privilegedClientLoginContext)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCreateUserWithDelegationToken(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCreateUserWithDelegationToken(groupProtocol: String): Unit = {
val privilegedAdminClient = Admin.create(privilegedAdminClientConfig)
try {
val user = "user"
diff --git a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
index aa6d208ef8b..0fd6ca4cad5 100644
--- a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala
@@ -170,9 +170,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
/**
* Tests the ability of producing and consuming with the appropriate ACLs set.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsumeViaAssign(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsumeViaAssign(groupProtocol: String): Unit = {
setAclsAndProduce(tp)
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
@@ -199,9 +199,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
._2.asInstanceOf[Gauge[Double]]
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsumeViaSubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsumeViaSubscribe(groupProtocol: String): Unit = {
setAclsAndProduce(tp)
val consumer = createConsumer()
consumer.subscribe(List(topic).asJava)
@@ -209,9 +209,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
confirmReauthenticationMetrics()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsumeWithWildcardAcls(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsumeWithWildcardAcls(groupProtocol: String): Unit = {
setWildcardResourceAcls()
val producer = createProducer()
sendRecords(producer, numRecords, tp)
@@ -221,9 +221,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
confirmReauthenticationMetrics()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsumeWithPrefixedAcls(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsumeWithPrefixedAcls(groupProtocol: String): Unit = {
setPrefixedResourceAcls()
val producer = createProducer()
sendRecords(producer, numRecords, tp)
@@ -233,9 +233,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
confirmReauthenticationMetrics()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsumeTopicAutoCreateTopicCreateAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsumeTopicAutoCreateTopicCreateAcl(groupProtocol: String): Unit = {
// topic2 is not created on setup()
val tp2 = new TopicPartition("topic2", 0)
setAclsAndProduce(tp2)
@@ -301,14 +301,14 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
* messages and describe topics respectively when the describe ACL isn't set.
* Also verifies that subsequent publish, consume and describe to authorized topic succeeds.
*/
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}.isIdempotenceEnabled={2}")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}.isIdempotenceEnabled={1}")
@CsvSource(value = Array(
- "kraft, classic, true",
- //"kraft, consumer, true",
- "kraft, classic, false",
- //"kraft, consumer, false",
+ "classic, true",
+ //"consumer, true",
+ "classic, false",
+ //"consumer, false",
))
- def testNoDescribeProduceOrConsumeWithoutTopicDescribeAcl(quorum:String, groupProtocol:String, isIdempotenceEnabled:Boolean): Unit = {
+ def testNoDescribeProduceOrConsumeWithoutTopicDescribeAcl(groupProtocol:String, isIdempotenceEnabled:Boolean): Unit = {
// Set consumer group acls since we are testing topic authorization
setConsumerGroupAcls()
@@ -374,10 +374,10 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
@ParameterizedTest
@CsvSource(value = Array(
- "kraft, true",
- "kraft, false",
+ "true",
+ "false",
))
- def testNoProduceWithDescribeAcl(quorum:String, isIdempotenceEnabled:Boolean): Unit = {
+ def testNoProduceWithDescribeAcl(isIdempotenceEnabled:Boolean): Unit = {
val superuserAdminClient = createSuperuserAdminClient()
superuserAdminClient.createAcls(List(AclTopicDescribe()).asJava).values
@@ -403,9 +403,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
* Tests that a consumer fails to consume messages without the appropriate
* ACL set.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoConsumeWithoutDescribeAclViaAssign(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoConsumeWithoutDescribeAclViaAssign(groupProtocol: String): Unit = {
noConsumeWithoutDescribeAclSetup()
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
@@ -414,9 +414,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
confirmReauthenticationMetrics()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoConsumeWithoutDescribeAclViaSubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoConsumeWithoutDescribeAclViaSubscribe(groupProtocol: String): Unit = {
noConsumeWithoutDescribeAclSetup()
val consumer = createConsumer()
consumer.subscribe(List(topic).asJava)
@@ -466,9 +466,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoConsumeWithDescribeAclViaAssign(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoConsumeWithDescribeAclViaAssign(groupProtocol: String): Unit = {
noConsumeWithDescribeAclSetup()
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
@@ -478,9 +478,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
confirmReauthenticationMetrics()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoConsumeWithDescribeAclViaSubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoConsumeWithDescribeAclViaSubscribe(groupProtocol: String): Unit = {
noConsumeWithDescribeAclSetup()
val consumer = createConsumer()
consumer.subscribe(List(topic).asJava)
@@ -507,9 +507,9 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas
* Tests that a consumer fails to consume messages without the appropriate
* ACL set.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoGroupAcl(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoGroupAcl(groupProtocol: String): Unit = {
val superuserAdminClient = createSuperuserAdminClient()
superuserAdminClient.createAcls(List(AclTopicWrite(), AclTopicCreate(), AclTopicDescribe()).asJava).values
brokers.foreach { s =>
diff --git a/core/src/test/scala/integration/kafka/api/EndToEndClusterIdTest.scala b/core/src/test/scala/integration/kafka/api/EndToEndClusterIdTest.scala
index c423c95ae9d..50588ac9e29 100644
--- a/core/src/test/scala/integration/kafka/api/EndToEndClusterIdTest.scala
+++ b/core/src/test/scala/integration/kafka/api/EndToEndClusterIdTest.scala
@@ -116,9 +116,9 @@ class EndToEndClusterIdTest extends KafkaServerTestHarness {
createTopic(topic, 2, serverCount)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testEndToEnd(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testEndToEnd(groupProtocol: String): Unit = {
val appendStr = "mock"
MockConsumerInterceptor.resetCounters()
MockProducerInterceptor.resetCounters()
diff --git a/core/src/test/scala/integration/kafka/api/GroupAuthorizerIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/GroupAuthorizerIntegrationTest.scala
index e9a0644a26c..2d7a82383bc 100644
--- a/core/src/test/scala/integration/kafka/api/GroupAuthorizerIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/GroupAuthorizerIntegrationTest.scala
@@ -112,9 +112,9 @@ class GroupAuthorizerIntegrationTest extends BaseRequestTest {
new AccessControlEntry(principal.toString, WILDCARD_HOST, aclOperation, aclPermissionType)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUnauthorizedProduceAndConsume(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUnauthorizedProduceAndConsume(groupProtocol: String): Unit = {
val topic = "topic"
val topicPartition = new TopicPartition("topic", 0)
@@ -133,9 +133,9 @@ class GroupAuthorizerIntegrationTest extends BaseRequestTest {
assertEquals(Set(topic), consumeException.unauthorizedTopics.asScala)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeUnsubscribeWithoutGroupPermission(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeUnsubscribeWithoutGroupPermission(groupProtocol: String): Unit = {
val topic = "topic"
createTopic(topic, listenerName = interBrokerListenerName)
@@ -173,9 +173,9 @@ class GroupAuthorizerIntegrationTest extends BaseRequestTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeCloseWithoutGroupPermission(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeCloseWithoutGroupPermission(groupProtocol: String): Unit = {
val topic = "topic"
createTopic(topic, listenerName = interBrokerListenerName)
@@ -211,9 +211,9 @@ class GroupAuthorizerIntegrationTest extends BaseRequestTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAuthorizedProduceAndConsume(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAuthorizedProduceAndConsume(groupProtocol: String): Unit = {
val topic = "topic"
val topicPartition = new TopicPartition("topic", 0)
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignTest.scala
index ec6ad5089c5..474e10100d8 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignTest.scala
@@ -29,9 +29,9 @@ import scala.jdk.CollectionConverters._
@Timeout(600)
class PlaintextConsumerAssignTest extends AbstractConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndCommitAsyncNotCommitted(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndCommitAsyncNotCommitted(groupProtocol: String): Unit = {
val props = new Properties()
val consumer = createConsumer(configOverrides = props)
val producer = createProducer()
@@ -51,9 +51,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertTrue(consumer.assignment.contains(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndCommitSyncNotCommitted(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndCommitSyncNotCommitted(groupProtocol: String): Unit = {
val props = new Properties()
val consumer = createConsumer(configOverrides = props)
val producer = createProducer()
@@ -70,9 +70,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertTrue(consumer.assignment.contains(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndCommitSyncAllConsumed(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndCommitSyncAllConsumed(groupProtocol: String): Unit = {
val numRecords = 10000
val producer = createProducer()
@@ -92,9 +92,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertEquals(numRecords, committedOffset.get(tp).offset())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndConsume(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndConsume(groupProtocol: String): Unit = {
val numRecords = 10
val producer = createProducer()
@@ -110,9 +110,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertEquals(numRecords, consumer.position(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndConsumeSkippingPosition(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndConsumeSkippingPosition(groupProtocol: String): Unit = {
val numRecords = 10
val producer = createProducer()
@@ -131,9 +131,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertEquals(numRecords, consumer.position(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndFetchCommittedOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndFetchCommittedOffsets(groupProtocol: String): Unit = {
val numRecords = 100
val startingTimestamp = System.currentTimeMillis()
val producer = createProducer()
@@ -153,9 +153,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
assertEquals(numRecords, anotherConsumer.committed(Set(tp).asJava).get(tp).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndConsumeFromCommittedOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndConsumeFromCommittedOffsets(groupProtocol: String): Unit = {
val producer = createProducer()
val numRecords = 100
val startingTimestamp = System.currentTimeMillis()
@@ -181,9 +181,9 @@ class PlaintextConsumerAssignTest extends AbstractConsumerTest {
startingTimestamp = startingTimestamp + offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAssignAndRetrievingCommittedOffsetsMultipleTimes(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAssignAndRetrievingCommittedOffsetsMultipleTimes(groupProtocol: String): Unit = {
val numRecords = 100
val startingTimestamp = System.currentTimeMillis()
val producer = createProducer()
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignorsTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignorsTest.scala
index 13251efc788..6923199b93d 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignorsTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerAssignorsTest.scala
@@ -34,9 +34,9 @@ import scala.jdk.CollectionConverters._
class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly"))
- def testRoundRobinAssignment(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersClassicGroupProtocolOnly"))
+ def testRoundRobinAssignment(groupProtocol: String): Unit = {
// 1 consumer using round-robin assignment
this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "roundrobin-group")
this.consumerConfig.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, classOf[RoundRobinAssignor].getName)
@@ -72,9 +72,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
}
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly"))
- def testMultiConsumerRoundRobinAssignor(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersClassicGroupProtocolOnly"))
+ def testMultiConsumerRoundRobinAssignor(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "roundrobin-group")
this.consumerConfig.setProperty(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG, classOf[RoundRobinAssignor].getName)
@@ -111,9 +111,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
* will move to consumer #10, leading to a total of (#par mod 9) partition movement
*/
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly"))
- def testMultiConsumerStickyAssignor(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersClassicGroupProtocolOnly"))
+ def testMultiConsumerStickyAssignor(groupProtocol: String): Unit = {
def reverse(m: Map[Long, Set[TopicPartition]]) =
m.values.toSet.flatten.map(v => (v, m.keys.filter(m(_).contains(v)).head)).toMap
@@ -160,9 +160,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
* It tests the assignment results is expected using default assignor (i.e. Range assignor)
*/
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly"))
- def testMultiConsumerDefaultAssignorAndVerifyAssignment(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersClassicGroupProtocolOnly"))
+ def testMultiConsumerDefaultAssignorAndVerifyAssignment(groupProtocol: String): Unit = {
// create two new topics, each having 3 partitions
val topic1 = "topic1"
val topic2 = "topic2"
@@ -198,9 +198,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
* As a result, it is testing the default assignment strategy set by BaseConsumerTest
*/
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly"))
- def testMultiConsumerDefaultAssignor(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersClassicGroupProtocolOnly"))
+ def testMultiConsumerDefaultAssignor(groupProtocol: String): Unit = {
// use consumers and topics defined in this class + one more topic
val producer = createProducer()
sendRecords(producer, numRecords = 100, tp)
@@ -235,11 +235,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
}
// Remote assignors only supported with consumer group protocol
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @CsvSource(Array(
- "kraft, consumer"
- ))
- def testRemoteAssignorInvalid(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRemoteAssignorInvalid(groupProtocol: String): Unit = {
// 1 consumer using invalid remote assignor
this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "invalid-assignor-group")
this.consumerConfig.setProperty(ConsumerConfig.GROUP_REMOTE_ASSIGNOR_CONFIG, "invalid")
@@ -265,11 +263,9 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
}
// Remote assignors only supported with consumer group protocol
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @CsvSource(Array(
- "kraft, consumer"
- ))
- def testRemoteAssignorRange(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRemoteAssignorRange(groupProtocol: String): Unit = {
// 1 consumer using range assignment
this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "range-group")
this.consumerConfig.setProperty(ConsumerConfig.GROUP_REMOTE_ASSIGNOR_CONFIG, "range")
@@ -306,12 +302,12 @@ class PlaintextConsumerAssignorsTest extends AbstractConsumerTest {
}
// Only the classic group protocol supports client-side assignors
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}.assignmentStrategy={2}")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}.assignmentStrategy={1}")
@CsvSource(Array(
- "kraft, classic, org.apache.kafka.clients.consumer.CooperativeStickyAssignor",
- "kraft, classic, org.apache.kafka.clients.consumer.RangeAssignor"
+ "classic, org.apache.kafka.clients.consumer.CooperativeStickyAssignor",
+ "classic, org.apache.kafka.clients.consumer.RangeAssignor"
))
- def testRebalanceAndRejoin(quorum: String, groupProtocol: String, assignmentStrategy: String): Unit = {
+ def testRebalanceAndRejoin(groupProtocol: String, assignmentStrategy: String): Unit = {
// create 2 consumers
this.consumerConfig.setProperty(ConsumerConfig.GROUP_PROTOCOL_CONFIG, groupProtocol)
this.consumerConfig.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "rebalance-and-rejoin-group")
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerCallbackTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerCallbackTest.scala
index e159042df57..e9c0ba0cc22 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerCallbackTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerCallbackTest.scala
@@ -31,9 +31,9 @@ import java.util.concurrent.atomic.AtomicBoolean
*/
class PlaintextConsumerCallbackTest extends AbstractConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerAssignOnPartitionsAssigned(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerAssignOnPartitionsAssigned(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsAssigned(tp, { (consumer, _) =>
val e: Exception = assertThrows(classOf[IllegalStateException], () => consumer.assign(Collections.singletonList(tp)))
@@ -41,18 +41,18 @@ class PlaintextConsumerCallbackTest extends AbstractConsumerTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerAssignmentOnPartitionsAssigned(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerAssignmentOnPartitionsAssigned(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsAssigned(tp, { (consumer, _) =>
assertTrue(consumer.assignment().contains(tp));
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerBeginningOffsetsOnPartitionsAssigned(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerBeginningOffsetsOnPartitionsAssigned(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsAssigned(tp, { (consumer, _) =>
val map = consumer.beginningOffsets(Collections.singletonList(tp))
@@ -61,9 +61,9 @@ class PlaintextConsumerCallbackTest extends AbstractConsumerTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerAssignOnPartitionsRevoked(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerAssignOnPartitionsRevoked(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsRevoked(tp, { (consumer, _) =>
val e: Exception = assertThrows(classOf[IllegalStateException], () => consumer.assign(Collections.singletonList(tp)))
@@ -71,18 +71,18 @@ class PlaintextConsumerCallbackTest extends AbstractConsumerTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerAssignmentOnPartitionsRevoked(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerAssignmentOnPartitionsRevoked(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsRevoked(tp, { (consumer, _) =>
assertTrue(consumer.assignment().contains(tp))
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerRebalanceListenerBeginningOffsetsOnPartitionsRevoked(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerRebalanceListenerBeginningOffsetsOnPartitionsRevoked(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsRevoked(tp, { (consumer, _) =>
val map = consumer.beginningOffsets(Collections.singletonList(tp))
@@ -91,17 +91,16 @@ class PlaintextConsumerCallbackTest extends AbstractConsumerTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testGetPositionOfNewlyAssignedPartitionOnPartitionsAssignedCallback(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testGetPositionOfNewlyAssignedPartitionOnPartitionsAssignedCallback(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
triggerOnPartitionsAssigned(tp, { (consumer, _) => assertDoesNotThrow(() => consumer.position(tp)) })
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback(quorum: String,
- groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback(groupProtocol: String): Unit = {
val consumer = createConsumer()
val startingOffset = 100L
val totalRecords = 120L
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerCommitTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerCommitTest.scala
index 8267401a467..0445e81cac1 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerCommitTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerCommitTest.scala
@@ -34,9 +34,9 @@ import scala.jdk.CollectionConverters._
@Timeout(600)
class PlaintextConsumerCommitTest extends AbstractConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoCommitOnClose(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoCommitOnClose(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true")
val consumer = createConsumer()
@@ -58,9 +58,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(500, anotherConsumer.committed(Set(tp2).asJava).get(tp2).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoCommitOnCloseAfterWakeup(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoCommitOnCloseAfterWakeup(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true")
val consumer = createConsumer()
@@ -86,9 +86,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(500, anotherConsumer.committed(Set(tp2).asJava).get(tp2).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitMetadata(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitMetadata(groupProtocol: String): Unit = {
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
@@ -108,9 +108,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(nullMetadata, consumer.committed(Set(tp).asJava).get(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAsyncCommit(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAsyncCommit(groupProtocol: String): Unit = {
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
@@ -128,9 +128,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(new OffsetAndMetadata(count), consumer.committed(Set(tp).asJava).get(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoCommitIntercept(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoCommitIntercept(groupProtocol: String): Unit = {
val topic2 = "topic2"
createTopic(topic2, 2, brokerCount)
@@ -187,9 +187,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
MockConsumerInterceptor.resetCounters()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitSpecifiedOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitSpecifiedOffsets(groupProtocol: String): Unit = {
val producer = createProducer()
sendRecords(producer, numRecords = 5, tp)
sendRecords(producer, numRecords = 7, tp2)
@@ -215,9 +215,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(7, consumer.committed(Set(tp2).asJava).get(tp2).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoCommitOnRebalance(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoCommitOnRebalance(groupProtocol: String): Unit = {
val topic2 = "topic2"
createTopic(topic2, 2, brokerCount)
@@ -255,9 +255,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
assertEquals(500, consumer.committed(Set(tp2).asJava).get(tp2).offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSubscribeAndCommitSync(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSubscribeAndCommitSync(groupProtocol: String): Unit = {
// This test ensure that the member ID is propagated from the group coordinator when the
// assignment is received into a subsequent offset commit
val consumer = createConsumer()
@@ -270,9 +270,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
consumer.commitSync()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPositionAndCommit(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPositionAndCommit(groupProtocol: String): Unit = {
val producer = createProducer()
var startingTimestamp = System.currentTimeMillis()
sendRecords(producer, numRecords = 5, tp, startingTimestamp = startingTimestamp)
@@ -304,9 +304,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
}
// TODO: This only works in the new consumer, but should be fixed for the old consumer as well
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testCommitAsyncCompletedBeforeConsumerCloses(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testCommitAsyncCompletedBeforeConsumerCloses(groupProtocol: String): Unit = {
// This is testing the contract that asynchronous offset commit are completed before the consumer
// is closed, even when no commit sync is performed as part of the close (due to auto-commit
// disabled, or simply because there are no consumed offsets).
@@ -326,9 +326,9 @@ class PlaintextConsumerCommitTest extends AbstractConsumerTest {
}
// TODO: This only works in the new consumer, but should be fixed for the old consumer as well
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testCommitAsyncCompletedBeforeCommitSyncReturns(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testCommitAsyncCompletedBeforeCommitSyncReturns(groupProtocol: String): Unit = {
// This is testing the contract that asynchronous offset commits sent previously with the
// `commitAsync` are guaranteed to have their callbacks invoked prior to completion of
// `commitSync` (given that it does not time out).
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerFetchTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerFetchTest.scala
index 4b50bddd9fc..f1a91658669 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerFetchTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerFetchTest.scala
@@ -30,9 +30,9 @@ import scala.jdk.CollectionConverters._
@Timeout(600)
class PlaintextConsumerFetchTest extends AbstractConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchInvalidOffset(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchInvalidOffset(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none")
val consumer = createConsumer(configOverrides = this.consumerConfig)
@@ -56,9 +56,9 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
assertEquals(outOfRangePos.toLong, outOfRangePartitions.get(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchOutOfRangeOffsetResetConfigEarliest(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchOutOfRangeOffsetResetConfigEarliest(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
// ensure no in-flight fetch request so that the offset can be reset immediately
this.consumerConfig.setProperty(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, "0")
@@ -78,9 +78,9 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchOutOfRangeOffsetResetConfigLatest(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchOutOfRangeOffsetResetConfigLatest(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest")
// ensure no in-flight fetch request so that the offset can be reset immediately
this.consumerConfig.setProperty(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, "0")
@@ -105,9 +105,9 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
assertEquals(totalRecords, nextRecord.offset())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchOutOfRangeOffsetResetConfigByDuration(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchOutOfRangeOffsetResetConfigByDuration(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "by_duration:PT1H")
// ensure no in-flight fetch request so that the offset can be reset immediately
this.consumerConfig.setProperty(ConsumerConfig.FETCH_MAX_WAIT_MS_CONFIG, "0")
@@ -151,9 +151,9 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
timestampIncrement = Duration.ofHours(1).toMillis)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchRecordLargerThanFetchMaxBytes(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchRecordLargerThanFetchMaxBytes(groupProtocol: String): Unit = {
val maxFetchBytes = 10 * 1024
this.consumerConfig.setProperty(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, maxFetchBytes.toString)
checkLargeRecord(maxFetchBytes + 1)
@@ -181,9 +181,9 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
}
/** We should only return a large record if it's the first record in the first non-empty partition of the fetch request */
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchHonoursFetchSizeIfLargeRecordNotFirst(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchHonoursFetchSizeIfLargeRecordNotFirst(groupProtocol: String): Unit = {
val maxFetchBytes = 10 * 1024
this.consumerConfig.setProperty(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, maxFetchBytes.toString)
checkFetchHonoursSizeIfLargeRecordNotFirst(maxFetchBytes)
@@ -214,26 +214,26 @@ class PlaintextConsumerFetchTest extends AbstractConsumerTest {
}
/** We should only return a large record if it's the first record in the first partition of the fetch request */
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchHonoursMaxPartitionFetchBytesIfLargeRecordNotFirst(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchHonoursMaxPartitionFetchBytesIfLargeRecordNotFirst(groupProtocol: String): Unit = {
val maxPartitionFetchBytes = 10 * 1024
this.consumerConfig.setProperty(ConsumerConfig.MAX_PARTITION_FETCH_BYTES_CONFIG, maxPartitionFetchBytes.toString)
checkFetchHonoursSizeIfLargeRecordNotFirst(maxPartitionFetchBytes)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchRecordLargerThanMaxPartitionFetchBytes(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchRecordLargerThanMaxPartitionFetchBytes(groupProtocol: String): Unit = {
val maxPartitionFetchBytes = 10 * 1024
this.consumerConfig.setProperty(ConsumerConfig.MAX_PARTITION_FETCH_BYTES_CONFIG, maxPartitionFetchBytes.toString)
checkLargeRecord(maxPartitionFetchBytes + 1)
}
/** Test that we consume all partitions if fetch max bytes and max.partition.fetch.bytes are low */
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testLowMaxFetchSizeForRequestAndPartition(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testLowMaxFetchSizeForRequestAndPartition(groupProtocol: String): Unit = {
// one of the effects of this is that there will be some log reads where `0 > remaining limit bytes < message size`
// and we don't return the message because it's not the first message in the first non-empty partition of the fetch
// this behaves a little different than when remaining limit bytes is 0 and it's important to test it
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerPollTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerPollTest.scala
index c52228acbca..42e9c50fc4c 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerPollTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerPollTest.scala
@@ -40,9 +40,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
properties.setProperty(GroupCoordinatorConfig.CONSUMER_GROUP_MIN_HEARTBEAT_INTERVAL_MS_CONFIG, 500.toString)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMaxPollRecords(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMaxPollRecords(groupProtocol: String): Unit = {
val maxPollRecords = 2
val numRecords = 10000
@@ -57,9 +57,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
startingTimestamp = startingTimestamp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMaxPollIntervalMs(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMaxPollIntervalMs(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 1000.toString)
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 500.toString)
@@ -85,9 +85,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertEquals(1, listener.callsToRevoked)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMaxPollIntervalMsDelayInRevocation(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMaxPollIntervalMsDelayInRevocation(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 5000.toString)
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 500.toString)
@@ -129,9 +129,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertTrue(commitCompleted)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMaxPollIntervalMsDelayInAssignment(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMaxPollIntervalMsDelayInAssignment(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 5000.toString)
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 500.toString)
@@ -156,9 +156,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
ensureNoRebalance(consumer, listener)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMaxPollIntervalMsShorterThanPollTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMaxPollIntervalMsShorterThanPollTimeout(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 1000.toString)
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 500.toString)
@@ -183,9 +183,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertEquals(callsToAssignedAfterFirstRebalance, listener.callsToAssigned)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLeadWithMaxPollRecords(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLeadWithMaxPollRecords(groupProtocol: String): Unit = {
val numMessages = 1000
val maxPollRecords = 10
val producer = createProducer()
@@ -206,9 +206,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertEquals(maxPollRecords, lead.metricValue().asInstanceOf[Double], s"The lead should be $maxPollRecords")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLagWithMaxPollRecords(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLagWithMaxPollRecords(groupProtocol: String): Unit = {
val numMessages = 1000
val maxPollRecords = 10
val producer = createProducer()
@@ -230,21 +230,21 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertEquals(numMessages - records.count, lag.metricValue.asInstanceOf[Double], epsilon, s"The lag should be ${numMessages - records.count}")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMultiConsumerSessionTimeoutOnStopPolling(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMultiConsumerSessionTimeoutOnStopPolling(groupProtocol: String): Unit = {
runMultiConsumerSessionTimeoutTest(false)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMultiConsumerSessionTimeoutOnClose(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMultiConsumerSessionTimeoutOnClose(groupProtocol: String): Unit = {
runMultiConsumerSessionTimeoutTest(true)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPollEventuallyReturnsRecordsWithZeroTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPollEventuallyReturnsRecordsWithZeroTimeout(groupProtocol: String): Unit = {
val numMessages = 100
val producer = createProducer()
sendRecords(producer, numMessages, tp)
@@ -255,9 +255,9 @@ class PlaintextConsumerPollTest extends AbstractConsumerTest {
assertEquals(numMessages, records.count())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNoOffsetForPartitionExceptionOnPollZero(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNoOffsetForPartitionExceptionOnPollZero(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "none")
val consumer = createConsumer(configOverrides = this.consumerConfig)
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerSubscriptionTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerSubscriptionTest.scala
index 70abc3f8412..e1e74321106 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerSubscriptionTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerSubscriptionTest.scala
@@ -41,9 +41,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
* metadata refresh the consumer becomes subscribed to this new topic and all partitions
* of that topic are assigned to it.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternSubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternSubscription(groupProtocol: String): Unit = {
val numRecords = 10000
val producer = createProducer()
sendRecords(producer, numRecords, tp)
@@ -99,9 +99,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
* The metadata refresh interval is intentionally increased to a large enough value to guarantee
* that it is the subscription call that triggers a metadata refresh, and not the timeout.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSubsequentPatternSubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSubsequentPatternSubscription(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.METADATA_MAX_AGE_CONFIG, "30000")
val consumer = createConsumer()
@@ -151,9 +151,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
* When consumer unsubscribes from all its subscriptions, it is expected that its
* assignments are cleared right away.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPatternUnsubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPatternUnsubscription(groupProtocol: String): Unit = {
val numRecords = 10000
val producer = createProducer()
sendRecords(producer, numRecords, tp)
@@ -178,9 +178,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
assertEquals(0, consumer.assignment().size)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testRe2JPatternSubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRe2JPatternSubscription(groupProtocol: String): Unit = {
val topic1 = "tblablac" // matches subscribed pattern
createTopic(topic1, 2, brokerCount)
@@ -215,9 +215,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
awaitAssignment(consumer, assignment)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testRe2JPatternSubscriptionFetch(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRe2JPatternSubscriptionFetch(groupProtocol: String): Unit = {
val topic1 = "topic1" // matches subscribed pattern
createTopic(topic1, 2, brokerCount)
@@ -242,9 +242,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = totalRecords.toInt, startingOffset = 0, startingTimestamp = startingTimestamp, tp = tp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testRe2JPatternExpandSubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRe2JPatternExpandSubscription(groupProtocol: String): Unit = {
val topic1 = "topic1" // matches first pattern
createTopic(topic1, 2, brokerCount)
@@ -273,9 +273,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
awaitAssignment(consumer, expandedAssignment)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testRe2JPatternSubscriptionAndTopicSubscription(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRe2JPatternSubscriptionAndTopicSubscription(groupProtocol: String): Unit = {
val topic1 = "topic1" // matches subscribed pattern
createTopic(topic1, 2, brokerCount)
@@ -313,9 +313,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
awaitAssignment(consumer, patternAssignment)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly"))
- def testRe2JPatternSubscriptionInvalidRegex(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersConsumerGroupProtocolOnly"))
+ def testRe2JPatternSubscriptionInvalidRegex(groupProtocol: String): Unit = {
val consumer = createConsumer()
assertEquals(0, consumer.assignment().size)
@@ -328,9 +328,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
consumer.unsubscribe()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testExpandingTopicSubscriptions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testExpandingTopicSubscriptions(groupProtocol: String): Unit = {
val otherTopic = "other"
val initialAssignment = Set(new TopicPartition(topic, 0), new TopicPartition(topic, 1))
val consumer = createConsumer()
@@ -343,9 +343,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
awaitAssignment(consumer, expandedAssignment)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testShrinkingTopicSubscriptions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testShrinkingTopicSubscriptions(groupProtocol: String): Unit = {
val otherTopic = "other"
createTopic(otherTopic, 2, brokerCount)
val initialAssignment = Set(new TopicPartition(topic, 0), new TopicPartition(topic, 1), new TopicPartition(otherTopic, 0), new TopicPartition(otherTopic, 1))
@@ -358,9 +358,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
awaitAssignment(consumer, shrunkenAssignment)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUnsubscribeTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUnsubscribeTopic(groupProtocol: String): Unit = {
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "100") // timeout quickly to avoid slow test
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, "30")
@@ -377,9 +377,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
assertEquals(0, consumer.assignment.size())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSubscribeInvalidTopicCanUnsubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSubscribeInvalidTopicCanUnsubscribe(groupProtocol: String): Unit = {
val consumer = createConsumer()
setupSubscribeInvalidTopic(consumer)
@@ -393,9 +393,9 @@ class PlaintextConsumerSubscriptionTest extends AbstractConsumerTest {
})
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSubscribeInvalidTopicCanClose(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSubscribeInvalidTopicCanClose(groupProtocol: String): Unit = {
val consumer = createConsumer()
setupSubscribeInvalidTopic(consumer)
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
index 2469a482ab5..f1c708acfdd 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala
@@ -42,9 +42,9 @@ import scala.jdk.CollectionConverters._
@Timeout(600)
class PlaintextConsumerTest extends BaseConsumerTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testHeaders(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testHeaders(groupProtocol: String): Unit = {
val numRecords = 1
val record = new ProducerRecord(tp.topic, tp.partition, null, "key".getBytes, "value".getBytes)
@@ -92,9 +92,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(numRecords, records.size)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testHeadersSerializerDeserializer(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testHeadersSerializerDeserializer(groupProtocol: String): Unit = {
val extendedSerializer = new SerializerImpl
val extendedDeserializer = new DeserializerImpl
@@ -102,9 +102,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
testHeadersSerializeDeserialize(extendedSerializer, extendedDeserializer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoOffsetReset(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoOffsetReset(groupProtocol: String): Unit = {
val producer = createProducer()
val startingTimestamp = System.currentTimeMillis()
sendRecords(producer, numRecords = 1, tp, startingTimestamp = startingTimestamp)
@@ -114,9 +114,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = 1, startingOffset = 0, startingTimestamp = startingTimestamp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testGroupConsumption(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testGroupConsumption(groupProtocol: String): Unit = {
val producer = createProducer()
val startingTimestamp = System.currentTimeMillis()
sendRecords(producer, numRecords = 10, tp, startingTimestamp = startingTimestamp)
@@ -126,9 +126,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = 1, startingOffset = 0, startingTimestamp = startingTimestamp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPartitionsFor(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPartitionsFor(groupProtocol: String): Unit = {
val numParts = 2
createTopic("part-test", numParts)
val consumer = createConsumer()
@@ -137,9 +137,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(2, parts.size)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPartitionsForAutoCreate(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPartitionsForAutoCreate(groupProtocol: String): Unit = {
val consumer = createConsumer()
// First call would create the topic
consumer.partitionsFor("non-exist-topic")
@@ -148,16 +148,16 @@ class PlaintextConsumerTest extends BaseConsumerTest {
}, s"Timed out while awaiting non empty partitions.")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPartitionsForInvalidTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPartitionsForInvalidTopic(groupProtocol: String): Unit = {
val consumer = createConsumer()
assertThrows(classOf[InvalidTopicException], () => consumer.partitionsFor(";3# ads,{234"))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSeek(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSeek(groupProtocol: String): Unit = {
val consumer = createConsumer()
val totalRecords = 50L
val mid = totalRecords / 2
@@ -211,9 +211,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
producer.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPartitionPauseAndResume(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPartitionPauseAndResume(groupProtocol: String): Unit = {
val partitions = List(tp).asJava
val producer = createProducer()
var startingTimestamp = System.currentTimeMillis()
@@ -230,9 +230,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = 5, startingOffset = 5, startingTimestamp = startingTimestamp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testInterceptors(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testInterceptors(groupProtocol: String): Unit = {
val appendStr = "mock"
MockConsumerInterceptor.resetCounters()
MockProducerInterceptor.resetCounters()
@@ -290,9 +290,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
MockProducerInterceptor.resetCounters()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testInterceptorsWithWrongKeyValue(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testInterceptorsWithWrongKeyValue(groupProtocol: String): Unit = {
val appendStr = "mock"
// create producer with interceptor that has different key and value types from the producer
val producerProps = new Properties()
@@ -317,9 +317,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(s"value will not be modified", new String(record.value()))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeMessagesWithCreateTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeMessagesWithCreateTime(groupProtocol: String): Unit = {
val numRecords = 50
// Test non-compressed messages
val producer = createProducer()
@@ -335,9 +335,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = numRecords, tp = tp2, startingOffset = 0)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumeMessagesWithLogAppendTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumeMessagesWithLogAppendTime(groupProtocol: String): Unit = {
val topicName = "testConsumeMessagesWithLogAppendTime"
val topicProps = new Properties()
topicProps.setProperty(TopicConfig.MESSAGE_TIMESTAMP_TYPE_CONFIG, "LogAppendTime")
@@ -364,9 +364,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
startingTimestamp = startTime, timestampType = TimestampType.LOG_APPEND_TIME)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testListTopics(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testListTopics(groupProtocol: String): Unit = {
val numParts = 2
val topic1 = "part-test-topic-1"
val topic2 = "part-test-topic-2"
@@ -385,9 +385,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(2, topics.get(topic3).size)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPauseStateNotPreservedByRebalance(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPauseStateNotPreservedByRebalance(groupProtocol: String): Unit = {
if (groupProtocol.equals(GroupProtocol.CLASSIC.name)) {
this.consumerConfig.setProperty(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "100") // timeout quickly to avoid slow test
this.consumerConfig.setProperty(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, "30")
@@ -409,9 +409,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumeAndVerifyRecords(consumer = consumer, numRecords = 0, startingOffset = 5, startingTimestamp = startingTimestamp)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLeadMetricsCleanUpWithSubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLeadMetricsCleanUpWithSubscribe(groupProtocol: String): Unit = {
val numMessages = 1000
val topic2 = "topic2"
createTopic(topic2, 2, brokerCount)
@@ -449,9 +449,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertNull(consumer.metrics.get(new MetricName("records-lead", "consumer-fetch-manager-metrics", "", tags2)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLagMetricsCleanUpWithSubscribe(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLagMetricsCleanUpWithSubscribe(groupProtocol: String): Unit = {
val numMessages = 1000
val topic2 = "topic2"
createTopic(topic2, 2, brokerCount)
@@ -490,9 +490,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertNull(consumer.metrics.get(new MetricName("records-lag", "consumer-fetch-manager-metrics", "", tags2)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLeadMetricsCleanUpWithAssign(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLeadMetricsCleanUpWithAssign(groupProtocol: String): Unit = {
val numMessages = 1000
// Test assign
// send some messages.
@@ -520,9 +520,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertNull(consumer.metrics.get(new MetricName("records-lead", "consumer-fetch-manager-metrics", "", tags)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLagMetricsCleanUpWithAssign(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLagMetricsCleanUpWithAssign(groupProtocol: String): Unit = {
val numMessages = 1000
// Test assign
// send some messages.
@@ -552,9 +552,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertNull(consumer.metrics.get(new MetricName("records-lag", "consumer-fetch-manager-metrics", "", tags)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testPerPartitionLagMetricsWhenReadCommitted(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testPerPartitionLagMetricsWhenReadCommitted(groupProtocol: String): Unit = {
val numMessages = 1000
// send some messages.
val producer = createProducer()
@@ -576,9 +576,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertNotNull(fetchLag)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testQuotaMetricsNotCreatedIfNoQuotasConfigured(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testQuotaMetricsNotCreatedIfNoQuotasConfigured(groupProtocol: String): Unit = {
val numRecords = 1000
val producer = createProducer()
val startingTimestamp = System.currentTimeMillis()
@@ -608,9 +608,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
brokers.foreach(assertNoMetric(_, "throttle-time", QuotaType.REQUEST, consumerClientId))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumingWithNullGroupId(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumingWithNullGroupId(groupProtocol: String): Unit = {
val topic = "test_topic"
val partition = 0
val tp = new TopicPartition(topic, partition)
@@ -674,9 +674,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(2, numRecords3, "Expected consumer3 to consume from offset 1")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNullGroupIdNotSupportedIfCommitting(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNullGroupIdNotSupportedIfCommitting(groupProtocol: String): Unit = {
val consumer1Config = new Properties(consumerConfig)
consumer1Config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
consumer1Config.put(ConsumerConfig.CLIENT_ID_CONFIG, "consumer1")
@@ -688,9 +688,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertThrows(classOf[InvalidGroupIdException], () => consumer1.commitSync())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testStaticConsumerDetectsNewPartitionCreatedAfterRestart(quorum:String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testStaticConsumerDetectsNewPartitionCreatedAfterRestart(groupProtocol: String): Unit = {
val foo = "foo"
val foo0 = new TopicPartition(foo, 0)
val foo1 = new TopicPartition(foo, 1)
@@ -718,9 +718,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
consumer2.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testEndOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testEndOffsets(groupProtocol: String): Unit = {
val producer = createProducer()
val startingTimestamp = System.currentTimeMillis()
val numRecords = 10000
@@ -740,18 +740,18 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(numRecords, endOffsets.get(tp))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSeekThrowsIllegalStateIfPartitionsNotAssigned(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSeekThrowsIllegalStateIfPartitionsNotAssigned(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic, 0)
val consumer = createConsumer(configOverrides = consumerConfig)
val e: Exception = assertThrows(classOf[IllegalStateException], () => consumer.seekToEnd(Collections.singletonList(tp)))
assertEquals("No current assignment for partition " + tp, e.getMessage)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchOffsetsForTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchOffsetsForTime(groupProtocol: String): Unit = {
val numPartitions = 2
val producer = createProducer()
val timestampsToSearch = new util.HashMap[TopicPartition, java.lang.Long]()
@@ -781,10 +781,10 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertEquals(Optional.of(0), timestampTp1.leaderEpoch)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
@Timeout(15)
- def testPositionRespectsTimeout(quorum: String, groupProtocol: String): Unit = {
+ def testPositionRespectsTimeout(groupProtocol: String): Unit = {
val topicPartition = new TopicPartition(topic, 15)
val consumer = createConsumer()
consumer.assign(List(topicPartition).asJava)
@@ -794,10 +794,10 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertThrows(classOf[TimeoutException], () => consumer.position(topicPartition, Duration.ofSeconds(3)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
@Timeout(15)
- def testPositionRespectsWakeup(quorum: String, groupProtocol: String): Unit = {
+ def testPositionRespectsWakeup(groupProtocol: String): Unit = {
val topicPartition = new TopicPartition(topic, 15)
val consumer = createConsumer()
consumer.assign(List(topicPartition).asJava)
@@ -810,10 +810,10 @@ class PlaintextConsumerTest extends BaseConsumerTest {
assertThrows(classOf[WakeupException], () => consumer.position(topicPartition, Duration.ofSeconds(3)))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
@Timeout(15)
- def testPositionWithErrorConnectionRespectsWakeup(quorum: String, groupProtocol: String): Unit = {
+ def testPositionWithErrorConnectionRespectsWakeup(groupProtocol: String): Unit = {
val topicPartition = new TopicPartition(topic, 15)
val properties = new Properties()
properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:12345") // make sure the connection fails
@@ -829,9 +829,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
}
@Flaky("KAFKA-18031")
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCloseLeavesGroupOnInterrupt(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCloseLeavesGroupOnInterrupt(groupProtocol: String): Unit = {
val adminClient = createAdminClient()
val consumer = createConsumer()
val listener = new TestConsumerReassignmentListener()
diff --git a/core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala b/core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala
index 65eedf96e3a..6487197df37 100644
--- a/core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala
+++ b/core/src/test/scala/integration/kafka/api/PlaintextProducerSendTest.scala
@@ -37,9 +37,9 @@ import java.nio.charset.StandardCharsets
class PlaintextProducerSendTest extends BaseProducerSendTest {
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testWrongSerializer(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testWrongSerializer(groupProtocol: String): Unit = {
val producerProps = new Properties()
producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers())
producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer")
@@ -49,9 +49,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
assertThrows(classOf[SerializationException], () => producer.send(record))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testBatchSizeZero(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testBatchSizeZero(groupProtocol: String): Unit = {
val producer = createProducer(
lingerMs = Int.MaxValue,
deliveryTimeoutMs = Int.MaxValue,
@@ -60,9 +60,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
}
@Timeout(value = 15, unit = TimeUnit.SECONDS, threadMode = Timeout.ThreadMode.SEPARATE_THREAD)
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testBatchSizeZeroNoPartitionNoRecordKey(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testBatchSizeZeroNoPartitionNoRecordKey(groupProtocol: String): Unit = {
val producer = createProducer(batchSize = 0)
val numRecords = 10
try {
@@ -83,9 +83,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendCompressedMessageWithLogAppendTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendCompressedMessageWithLogAppendTime(groupProtocol: String): Unit = {
val producer = createProducer(
compressionType = "gzip",
lingerMs = Int.MaxValue,
@@ -93,9 +93,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
sendAndVerifyTimestamp(producer, TimestampType.LOG_APPEND_TIME)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendNonCompressedMessageWithLogAppendTime(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendNonCompressedMessageWithLogAppendTime(groupProtocol: String): Unit = {
val producer = createProducer(lingerMs = Int.MaxValue, deliveryTimeoutMs = Int.MaxValue)
sendAndVerifyTimestamp(producer, TimestampType.LOG_APPEND_TIME)
}
@@ -105,9 +105,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
*
* The topic should be created upon sending the first message
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAutoCreateTopic(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAutoCreateTopic(groupProtocol: String): Unit = {
val producer = createProducer()
try {
// Send a message to auto-create the topic
@@ -121,9 +121,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("quorumAndTimestampConfigProvider"))
- def testSendWithInvalidBeforeAndAfterTimestamp(quorum: String, groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("timestampConfigProvider"))
+ def testSendWithInvalidBeforeAndAfterTimestamp(groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
val topicProps = new Properties()
// set the TopicConfig for timestamp validation to have 1 minute threshold. Note that recordTimestamp has 5 minutes diff
val oneMinuteInMs: Long = 1 * 60 * 60 * 1000L
@@ -150,9 +150,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("quorumAndTimestampConfigProvider"))
- def testValidBeforeAndAfterTimestampsAtThreshold(quorum: String, groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("timestampConfigProvider"))
+ def testValidBeforeAndAfterTimestampsAtThreshold(groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
val topicProps = new Properties()
// set the TopicConfig for timestamp validation to be the same as the record timestamp
@@ -170,9 +170,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
compressedProducer.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("quorumAndTimestampConfigProvider"))
- def testValidBeforeAndAfterTimestampsWithinThreshold(quorum: String, groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("timestampConfigProvider"))
+ def testValidBeforeAndAfterTimestampsWithinThreshold(groupProtocol: String, messageTimeStampConfig: String, recordTimestamp: Long): Unit = {
val topicProps = new Properties()
// set the TopicConfig for timestamp validation to have 10 minute threshold. Note that recordTimestamp has 5 minutes diff
@@ -194,9 +194,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
// Test that producer with max.block.ms=0 can be used to send in non-blocking mode
// where requests are failed immediately without blocking if metadata is not available
// or buffer is full.
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNonBlockingProducer(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNonBlockingProducer(groupProtocol: String): Unit = {
def send(producer: KafkaProducer[Array[Byte],Array[Byte]]): Future[RecordMetadata] = {
producer.send(new ProducerRecord(topic, 0, "key".getBytes, new Array[Byte](1000)))
@@ -250,9 +250,9 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
verifySendSuccess(future2) // previous batch should be completed and sent now
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendRecordBatchWithMaxRequestSizeAndHigher(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendRecordBatchWithMaxRequestSizeAndHigher(groupProtocol: String): Unit = {
val producerProps = new Properties()
producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers())
val producer = registerProducer(new KafkaProducer(producerProps, new ByteArraySerializer, new ByteArraySerializer))
@@ -275,13 +275,13 @@ class PlaintextProducerSendTest extends BaseProducerSendTest {
object PlaintextProducerSendTest {
- def quorumAndTimestampConfigProvider: java.util.stream.Stream[Arguments] = {
+ def timestampConfigProvider: java.util.stream.Stream[Arguments] = {
val now: Long = System.currentTimeMillis()
val fiveMinutesInMs: Long = 5 * 60 * 60 * 1000L
val data = new java.util.ArrayList[Arguments]()
for (groupProtocol <- GroupProtocol.values().map(gp => gp.name.toLowerCase(Locale.ROOT))) {
- data.add(Arguments.of("kraft", groupProtocol, TopicConfig.MESSAGE_TIMESTAMP_BEFORE_MAX_MS_CONFIG, Long.box(now - fiveMinutesInMs)))
- data.add(Arguments.of("kraft", groupProtocol, TopicConfig.MESSAGE_TIMESTAMP_AFTER_MAX_MS_CONFIG, Long.box(now + fiveMinutesInMs)))
+ data.add(Arguments.of(groupProtocol, TopicConfig.MESSAGE_TIMESTAMP_BEFORE_MAX_MS_CONFIG, Long.box(now - fiveMinutesInMs)))
+ data.add(Arguments.of(groupProtocol, TopicConfig.MESSAGE_TIMESTAMP_AFTER_MAX_MS_CONFIG, Long.box(now + fiveMinutesInMs)))
}
data.stream()
}
diff --git a/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala b/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
index 1826df1c6dc..7f578ad98eb 100644
--- a/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
+++ b/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
@@ -87,9 +87,9 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
/**
* With ack == 0 the future metadata will have no exceptions with offset -1
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTooLargeRecordWithAckZero(quorum: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTooLargeRecordWithAckZero(groupProtocol: String): Unit = {
// create topic
createTopic(topic1, replicationFactor = numServers)
@@ -105,9 +105,9 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
/**
* With ack == 1 the future metadata will throw ExecutionException caused by RecordTooLargeException
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTooLargeRecordWithAckOne(quorum: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTooLargeRecordWithAckOne(groupProtocol: String): Unit = {
// create topic
createTopic(topic1, replicationFactor = numServers)
@@ -151,9 +151,9 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
/**
* With non-exist-topic the future metadata should return ExecutionException caused by TimeoutException
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testNonExistentTopic(quorum: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testNonExistentTopic(groupProtocol: String): Unit = {
// send a record with non-exist topic
val record = new ProducerRecord(topic2, null, "key".getBytes, "value".getBytes)
assertThrows(classOf[ExecutionException], () => producer1.send(record).get)
diff --git a/core/src/test/scala/integration/kafka/api/ProducerIdExpirationTest.scala b/core/src/test/scala/integration/kafka/api/ProducerIdExpirationTest.scala
index c9271b87601..906de28e34f 100644
--- a/core/src/test/scala/integration/kafka/api/ProducerIdExpirationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/ProducerIdExpirationTest.scala
@@ -79,9 +79,9 @@ class ProducerIdExpirationTest extends KafkaServerTestHarness {
super.tearDown()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProducerIdExpirationWithNoTransactions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProducerIdExpirationWithNoTransactions(groupProtocol: String): Unit = {
producer = TestUtils.createProducer(bootstrapServers(), enableIdempotence = true)
// Send records to populate producer state cache.
@@ -103,9 +103,9 @@ class ProducerIdExpirationTest extends KafkaServerTestHarness {
assertEquals(1, producerState.size)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTransactionAfterTransactionIdExpiresButProducerIdRemains(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTransactionAfterTransactionIdExpiresButProducerIdRemains(groupProtocol: String): Unit = {
producer = TestUtils.createTransactionalProducer("transactionalProducer", brokers)
producer.initTransactions()
@@ -158,9 +158,9 @@ class ProducerIdExpirationTest extends KafkaServerTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDynamicProducerIdExpirationMs(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDynamicProducerIdExpirationMs(groupProtocol: String): Unit = {
producer = TestUtils.createProducer(bootstrapServers(), enableIdempotence = true)
// Send records to populate producer state cache.
diff --git a/core/src/test/scala/integration/kafka/api/SaslClientsWithInvalidCredentialsTest.scala b/core/src/test/scala/integration/kafka/api/SaslClientsWithInvalidCredentialsTest.scala
index 03a987c54b4..cf44bffbdc4 100644
--- a/core/src/test/scala/integration/kafka/api/SaslClientsWithInvalidCredentialsTest.scala
+++ b/core/src/test/scala/integration/kafka/api/SaslClientsWithInvalidCredentialsTest.scala
@@ -121,25 +121,25 @@ class SaslClientsWithInvalidCredentialsTest extends AbstractSaslTest {
assertThrows(classOf[KafkaException], () => txProducer.initTransactions())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsumerWithAuthenticationFailure(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsumerWithAuthenticationFailure(groupProtocol: String): Unit = {
val consumer = createConsumer()
consumer.subscribe(List(topic).asJava)
verifyConsumerWithAuthenticationFailure(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testManualAssignmentConsumerWithAuthenticationFailure(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testManualAssignmentConsumerWithAuthenticationFailure(groupProtocol: String): Unit = {
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
verifyConsumerWithAuthenticationFailure(consumer)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testManualAssignmentConsumerWithAutoCommitDisabledWithAuthenticationFailure(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testManualAssignmentConsumerWithAutoCommitDisabledWithAuthenticationFailure(groupProtocol: String): Unit = {
this.consumerConfig.setProperty(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false.toString)
val consumer = createConsumer()
consumer.assign(List(tp).asJava)
diff --git a/core/src/test/scala/integration/kafka/api/SaslEndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/SaslEndToEndAuthorizationTest.scala
index ec81a98d725..c2ff04d4497 100644
--- a/core/src/test/scala/integration/kafka/api/SaslEndToEndAuthorizationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/SaslEndToEndAuthorizationTest.scala
@@ -58,9 +58,9 @@ abstract class SaslEndToEndAuthorizationTest extends EndToEndAuthorizationTest {
* the second one connects ok, but fails to consume messages due to the ACL.
*/
@Timeout(15)
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTwoConsumersWithDifferentSaslCredentials(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTwoConsumersWithDifferentSaslCredentials(groupProtocol: String): Unit = {
setAclsAndProduce(tp)
consumerConfig.putIfAbsent(ConsumerConfig.GROUP_PROTOCOL_CONFIG, groupProtocol)
val consumer1 = createConsumer()
diff --git a/core/src/test/scala/integration/kafka/api/SaslMultiMechanismConsumerTest.scala b/core/src/test/scala/integration/kafka/api/SaslMultiMechanismConsumerTest.scala
index b41ccb6316c..d98c2b00c04 100644
--- a/core/src/test/scala/integration/kafka/api/SaslMultiMechanismConsumerTest.scala
+++ b/core/src/test/scala/integration/kafka/api/SaslMultiMechanismConsumerTest.scala
@@ -43,9 +43,9 @@ class SaslMultiMechanismConsumerTest extends BaseConsumerTest with SaslSetup {
closeSasl()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMultipleBrokerMechanisms(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMultipleBrokerMechanisms(groupProtocol: String): Unit = {
val plainSaslProducer = createProducer()
val plainSaslConsumer = createConsumer()
diff --git a/core/src/test/scala/integration/kafka/api/SaslScramSslEndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/SaslScramSslEndToEndAuthorizationTest.scala
index 9d72f2b060c..473c4a86e30 100644
--- a/core/src/test/scala/integration/kafka/api/SaslScramSslEndToEndAuthorizationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/SaslScramSslEndToEndAuthorizationTest.scala
@@ -27,9 +27,7 @@ import org.apache.kafka.test.TestSslUtils
import scala.jdk.CollectionConverters._
import org.junit.jupiter.api.Assertions._
-import org.junit.jupiter.api.{BeforeEach, TestInfo}
-import org.junit.jupiter.params.ParameterizedTest
-import org.junit.jupiter.params.provider.ValueSource
+import org.junit.jupiter.api.{BeforeEach, Test, TestInfo}
class SaslScramSslEndToEndAuthorizationTest extends SaslEndToEndAuthorizationTest {
override protected def kafkaClientSaslMechanism = "SCRAM-SHA-256"
@@ -68,9 +66,8 @@ class SaslScramSslEndToEndAuthorizationTest extends SaslEndToEndAuthorizationTes
createScramCredentialsViaPrivilegedAdminClient(JaasTestUtils.KAFKA_SCRAM_USER_2, JaasTestUtils.KAFKA_SCRAM_PASSWORD_2)
}
- @ParameterizedTest
- @ValueSource(strings = Array("kraft"))
- def testAuthentications(quorum: String): Unit = {
+ @Test
+ def testAuthentications(): Unit = {
val successfulAuths = TestUtils.totalMetricValue(brokers.head, "successful-authentication-total")
assertTrue(successfulAuths > 0, "No successful authentications")
val failedAuths = TestUtils.totalMetricValue(brokers.head, "failed-authentication-total")
diff --git a/core/src/test/scala/integration/kafka/api/TransactionsBounceTest.scala b/core/src/test/scala/integration/kafka/api/TransactionsBounceTest.scala
index a6cd0d905de..8c95aaf49bc 100644
--- a/core/src/test/scala/integration/kafka/api/TransactionsBounceTest.scala
+++ b/core/src/test/scala/integration/kafka/api/TransactionsBounceTest.scala
@@ -75,9 +75,9 @@ class TransactionsBounceTest extends IntegrationTestHarness {
override protected def brokerCount: Int = 4
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testWithGroupMetadata(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testWithGroupMetadata(groupProtocol: String): Unit = {
testBrokerFailure((producer, _, consumer) =>
producer.sendOffsetsToTransaction(TestUtils.consumerPositions(consumer).asJava, consumer.groupMetadata()))
}
diff --git a/core/src/test/scala/integration/kafka/api/TransactionsTest.scala b/core/src/test/scala/integration/kafka/api/TransactionsTest.scala
index 88bae9604f0..3be1f4a2eb3 100644
--- a/core/src/test/scala/integration/kafka/api/TransactionsTest.scala
+++ b/core/src/test/scala/integration/kafka/api/TransactionsTest.scala
@@ -110,9 +110,9 @@ class TransactionsTest extends IntegrationTestHarness {
super.tearDown()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testBasicTransactions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testBasicTransactions(groupProtocol: String): Unit = {
val producer = transactionalProducers.head
val consumer = transactionalConsumers.head
val unCommittedConsumer = nonTransactionalConsumers.head
@@ -171,9 +171,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testReadCommittedConsumerShouldNotSeeUndecidedData(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testReadCommittedConsumerShouldNotSeeUndecidedData(groupProtocol: String): Unit = {
val producer1 = transactionalProducers.head
val producer2 = createTransactionalProducer("other")
val readCommittedConsumer = transactionalConsumers.head
@@ -239,9 +239,9 @@ class TransactionsTest extends IntegrationTestHarness {
assertNull(readCommittedOffsetsForTimes.get(tp2))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDelayedFetchIncludesAbortedTransaction(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDelayedFetchIncludesAbortedTransaction(groupProtocol: String): Unit = {
val producer1 = transactionalProducers.head
val producer2 = createTransactionalProducer("other")
val tp10 = new TopicPartition(topic1, 0)
@@ -297,9 +297,9 @@ class TransactionsTest extends IntegrationTestHarness {
assertEquals(3L, second.offset)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendOffsetsWithGroupMetadata(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendOffsetsWithGroupMetadata(groupProtocol: String): Unit = {
sendOffset((producer, _, consumer) =>
producer.sendOffsetsToTransaction(TestUtils.consumerPositions(consumer).asJava, consumer.groupMetadata()))
}
@@ -377,9 +377,9 @@ class TransactionsTest extends IntegrationTestHarness {
assertEquals(valueSeq.size, valueSet.size, s"Expected ${valueSeq.size} unique messages in $topic2.")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFencingOnCommit(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFencingOnCommit(groupProtocol: String): Unit = {
val producer1 = transactionalProducers(0)
val producer2 = transactionalProducers(1)
val consumer = transactionalConsumers(0)
@@ -408,9 +408,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFencingOnSendOffsets(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFencingOnSendOffsets(groupProtocol: String): Unit = {
val producer1 = transactionalProducers(0)
val producer2 = transactionalProducers(1)
val consumer = transactionalConsumers(0)
@@ -440,9 +440,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testOffsetMetadataInSendOffsetsToTransaction(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testOffsetMetadataInSendOffsetsToTransaction(groupProtocol: String): Unit = {
val tp = new TopicPartition(topic1, 0)
val groupId = "group"
@@ -466,28 +466,28 @@ class TransactionsTest extends IntegrationTestHarness {
TestUtils.waitUntilTrue(() => offsetAndMetadata.equals(consumer.committed(Set(tp).asJava).get(tp)), "cannot read committed offset")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testInitTransactionsTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testInitTransactionsTimeout(groupProtocol: String): Unit = {
testTimeout(needInitAndSendMsg = false, producer => producer.initTransactions())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSendOffsetsToTransactionTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSendOffsetsToTransactionTimeout(groupProtocol: String): Unit = {
testTimeout(needInitAndSendMsg = true, producer => producer.sendOffsetsToTransaction(
Map(new TopicPartition(topic1, 0) -> new OffsetAndMetadata(0)).asJava, new ConsumerGroupMetadata("test-group")))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCommitTransactionTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCommitTransactionTimeout(groupProtocol: String): Unit = {
testTimeout(needInitAndSendMsg = true, producer => producer.commitTransaction())
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testAbortTransactionTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testAbortTransactionTimeout(groupProtocol: String): Unit = {
testTimeout(needInitAndSendMsg = true, producer => producer.abortTransaction())
}
@@ -506,9 +506,9 @@ class TransactionsTest extends IntegrationTestHarness {
producer.close(Duration.ZERO)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFencingOnSend(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFencingOnSend(groupProtocol: String): Unit = {
val producer1 = transactionalProducers(0)
val producer2 = transactionalProducers(1)
val consumer = transactionalConsumers(0)
@@ -551,9 +551,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFencingOnAddPartitions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFencingOnAddPartitions(groupProtocol: String): Unit = {
val producer1 = transactionalProducers(0)
val producer2 = transactionalProducers(1)
val consumer = transactionalConsumers(0)
@@ -601,9 +601,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFencingOnTransactionExpiration(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFencingOnTransactionExpiration(groupProtocol: String): Unit = {
val producer = createTransactionalProducer("expiringProducer", transactionTimeoutMs = 300)
producer.initTransactions()
@@ -645,9 +645,9 @@ class TransactionsTest extends IntegrationTestHarness {
assertTrue(transactionalRecords.isEmpty)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMultipleMarkersOneLeader(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMultipleMarkersOneLeader(groupProtocol: String): Unit = {
val firstProducer = transactionalProducers.head
val consumer = transactionalConsumers.head
val unCommittedConsumer = nonTransactionalConsumers.head
@@ -683,9 +683,9 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsecutivelyRunInitTransactions(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsecutivelyRunInitTransactions(groupProtocol: String): Unit = {
val producer = createTransactionalProducer(transactionalId = "normalProducer")
producer.initTransactions()
@@ -694,10 +694,10 @@ class TransactionsTest extends IntegrationTestHarness {
@ParameterizedTest
@CsvSource(Array(
- "kraft,classic,false",
- "kraft,consumer,false",
+ "classic,false",
+ "consumer,false",
))
- def testBumpTransactionalEpochWithTV2Disabled(quorum: String, groupProtocol: String, isTV2Enabled: Boolean): Unit = {
+ def testBumpTransactionalEpochWithTV2Disabled(groupProtocol: String, isTV2Enabled: Boolean): Unit = {
val defaultLinger = 5;
val producer = createTransactionalProducer("transactionalProducer",
deliveryTimeoutMs = 5000 + defaultLinger, requestTimeoutMs = 5000)
@@ -774,10 +774,10 @@ class TransactionsTest extends IntegrationTestHarness {
@ParameterizedTest
@CsvSource(Array(
- "kraft, classic, true",
- "kraft, consumer, true"
+ "classic, true",
+ "consumer, true"
))
- def testBumpTransactionalEpochWithTV2Enabled(quorum: String, groupProtocol: String, isTV2Enabled: Boolean): Unit = {
+ def testBumpTransactionalEpochWithTV2Enabled(groupProtocol: String, isTV2Enabled: Boolean): Unit = {
val defaultLinger = 5;
val producer = createTransactionalProducer("transactionalProducer",
deliveryTimeoutMs = 5000 + defaultLinger, requestTimeoutMs = 5000)
@@ -846,14 +846,14 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}.isTV2Enabled={2}")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}.isTV2Enabled={1}")
@CsvSource(Array(
- "kraft, classic, false",
- "kraft, consumer, false",
- "kraft, classic, true",
- "kraft, consumer, true",
+ "classic, false",
+ "consumer, false",
+ "classic, true",
+ "consumer, true",
))
- def testFailureToFenceEpoch(quorum: String, groupProtocol: String, isTV2Enabled: Boolean): Unit = {
+ def testFailureToFenceEpoch(groupProtocol: String, isTV2Enabled: Boolean): Unit = {
val producer1 = transactionalProducers.head
val producer2 = createTransactionalProducer("transactional-producer", maxBlockMs = 1000)
val initialProducerEpoch = 0
@@ -920,11 +920,11 @@ class TransactionsTest extends IntegrationTestHarness {
}
}
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}.isTV2Enabled={2}")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}.isTV2Enabled={1}")
@CsvSource(Array(
- "kraft, consumer, true",
+ "consumer, true",
))
- def testEmptyAbortAfterCommit(quorum: String, groupProtocol: String, isTV2Enabled: Boolean): Unit = {
+ def testEmptyAbortAfterCommit(groupProtocol: String, isTV2Enabled: Boolean): Unit = {
val producer = transactionalProducers.head
producer.initTransactions()
diff --git a/core/src/test/scala/integration/kafka/api/TransactionsWithMaxInFlightOneTest.scala b/core/src/test/scala/integration/kafka/api/TransactionsWithMaxInFlightOneTest.scala
index c59997bd37c..56a2a7181ea 100644
--- a/core/src/test/scala/integration/kafka/api/TransactionsWithMaxInFlightOneTest.scala
+++ b/core/src/test/scala/integration/kafka/api/TransactionsWithMaxInFlightOneTest.scala
@@ -72,9 +72,9 @@ class TransactionsWithMaxInFlightOneTest extends KafkaServerTestHarness {
super.tearDown()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTransactionalProducerSingleBrokerMaxInFlightOne(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTransactionalProducerSingleBrokerMaxInFlightOne(groupProtocol: String): Unit = {
// We want to test with one broker to verify multiple requests queued on a connection
assertEquals(1, brokers.size)
diff --git a/core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala b/core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala
index f413e5654d1..d5fbdf78de1 100644
--- a/core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala
+++ b/core/src/test/scala/integration/kafka/server/DynamicBrokerReconfigurationTest.scala
@@ -175,9 +175,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
closeSasl()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConfigDescribeUsingAdminClient(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConfigDescribeUsingAdminClient(groupProtocol: String): Unit = {
def verifyConfig(configName: String, configEntry: ConfigEntry, isSensitive: Boolean, isReadOnly: Boolean,
expectedProps: Properties): Unit = {
@@ -275,9 +275,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
assertEquals(List((CleanerConfig.LOG_CLEANER_THREADS_PROP, ConfigSource.DEFAULT_CONFIG)), synonymsList(logCleanerThreads))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUpdatesUsingConfigProvider(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUpdatesUsingConfigProvider(groupProtocol: String): Unit = {
val PollingIntervalVal = f"$${file:polling.interval:interval}"
val PollingIntervalUpdateVal = f"$${file:polling.interval:updinterval}"
val SslTruststoreTypeVal = f"$${file:ssl.truststore.type:storetype}"
@@ -340,9 +340,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testKeyStoreAlter(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testKeyStoreAlter(groupProtocol: String): Unit = {
val topic2 = "testtopic2"
TestUtils.createTopicWithAdmin(adminClients.head, topic2, servers, controllerServers, numPartitions, replicationFactor = numServers)
@@ -409,9 +409,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
stopAndVerifyProduceConsume(producerThread, consumerThread)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTrustStoreAlter(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTrustStoreAlter(groupProtocol: String): Unit = {
val producerBuilder = ProducerBuilder().listenerName(SecureInternal).securityProtocol(SecurityProtocol.SSL)
// Producer with new keystore should fail to connect before truststore update
@@ -485,9 +485,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
waitForAuthenticationFailure(producerBuilder.keyStoreProps(sslProperties1))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testSocketServerConfigTest(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testSocketServerConfigTest(groupProtocol: String): Unit = {
val updatedMaxConnections = "20"
val connectionsIpsOverride = "1.2.3.4:1234,1.2.4.5:2345"
val properties = new Properties()
@@ -509,9 +509,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testLogCleanerConfig(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testLogCleanerConfig(groupProtocol: String): Unit = {
val (producerThread, consumerThread) = startProduceConsume(retries = 0, groupProtocol)
verifyThreads("kafka-log-cleaner-thread-", countPerBroker = 1)
@@ -562,9 +562,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
verifyThreads("kafka-log-cleaner-thread-", countPerBroker = 2)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testConsecutiveConfigChange(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testConsecutiveConfigChange(groupProtocol: String): Unit = {
val topic2 = "testtopic2"
val topicProps = new Properties
topicProps.put(ServerLogConfigs.MIN_IN_SYNC_REPLICAS_CONFIG, "2")
@@ -606,9 +606,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
assertEquals("2", log.config.originals().get(ServerLogConfigs.MIN_IN_SYNC_REPLICAS_CONFIG).toString) // Verify topic-level config still survives
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testDefaultTopicConfig(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testDefaultTopicConfig(groupProtocol: String): Unit = {
val (producerThread, consumerThread) = startProduceConsume(retries = 0, groupProtocol)
val props = new Properties
@@ -727,9 +727,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionEnable(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionEnable(groupProtocol: String): Unit = {
// Create a topic with two replicas on brokers other than the controller
val topic = "testtopic2"
TestUtils.createTopicWithAdmin(adminClients.head, topic, servers, controllerServers, replicaAssignment = Map(0 -> Seq(0, 1)))
@@ -785,9 +785,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
consumer.commitSync()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testThreadPoolResize(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testThreadPoolResize(groupProtocol: String): Unit = {
// In kraft mode, the StripedReplicaPlacer#initialize includes some randomization,
// so the replica assignment is not deterministic.
@@ -939,9 +939,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testMetricsReporterUpdate(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testMetricsReporterUpdate(groupProtocol: String): Unit = {
// Add a new metrics reporter
val newProps = new Properties
newProps.put(TestMetricsReporter.PollingIntervalProp, "100")
@@ -1033,9 +1033,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
stopAndVerifyProduceConsume(producerThread, consumerThread)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testReconfigureRemovedListener(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testReconfigureRemovedListener(groupProtocol: String): Unit = {
val client = adminClients.head
val broker = servers.head
assertEquals(2, broker.config.dynamicConfig.reconfigurables.asScala.count(r => r.isInstanceOf[DataPlaneAcceptor]))
@@ -1062,9 +1062,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
s"failed to remove DataPlaneAcceptor. current: ${acceptors.map(_.endPoint.toString).mkString(",")}")
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTransactionVerificationEnable(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTransactionVerificationEnable(groupProtocol: String): Unit = {
def verifyConfiguration(enabled: Boolean): Unit = {
servers.foreach { server =>
TestUtils.waitUntilTrue(() => server.logManager.producerStateManagerConfig.transactionVerificationEnabled == enabled, "Configuration was not updated.")
@@ -1094,9 +1094,9 @@ class DynamicBrokerReconfigurationTest extends QuorumTestHarness with SaslSetup
verifyConfiguration(true)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testServersCanStartWithInvalidStaticConfigsAndValidDynamicConfigs(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testServersCanStartWithInvalidStaticConfigsAndValidDynamicConfigs(groupProtocol: String): Unit = {
// modify snapshot interval config to explicitly take snapshot on a broker with valid dynamic configs
val props = defaultStaticConfig(numServers)
props.put(KRaftConfigs.METADATA_SNAPSHOT_MAX_INTERVAL_MS_CONFIG, "10000")
diff --git a/core/src/test/scala/integration/kafka/server/FetchFromFollowerIntegrationTest.scala b/core/src/test/scala/integration/kafka/server/FetchFromFollowerIntegrationTest.scala
index b0878d5f9ee..ff86331e5cd 100644
--- a/core/src/test/scala/integration/kafka/server/FetchFromFollowerIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/server/FetchFromFollowerIntegrationTest.scala
@@ -56,10 +56,10 @@ class FetchFromFollowerIntegrationTest extends BaseFetchRequestTest {
.map(KafkaConfig.fromProps(_, overridingProps))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
@Timeout(15)
- def testFollowerCompleteDelayedFetchesOnReplication(quorum: String, groupProtocol: String): Unit = {
+ def testFollowerCompleteDelayedFetchesOnReplication(groupProtocol: String): Unit = {
// Create a topic with 2 replicas where broker 0 is the leader and 1 is the follower.
val admin = createAdminClient()
val partitionLeaders = TestUtils.createTopicWithAdmin(
@@ -101,9 +101,9 @@ class FetchFromFollowerIntegrationTest extends BaseFetchRequestTest {
}
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchFromLeaderWhilePreferredReadReplicaIsUnavailable(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchFromLeaderWhilePreferredReadReplicaIsUnavailable(groupProtocol: String): Unit = {
// Create a topic with 2 replicas where broker 0 is the leader and 1 is the follower.
val admin = createAdminClient()
TestUtils.createTopicWithAdmin(
@@ -129,9 +129,9 @@ class FetchFromFollowerIntegrationTest extends BaseFetchRequestTest {
assertEquals(-1, getPreferredReplica)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testFetchFromFollowerWithRoll(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testFetchFromFollowerWithRoll(groupProtocol: String): Unit = {
// Create a topic with 2 replicas where broker 0 is the leader and 1 is the follower.
val admin = createAdminClient()
TestUtils.createTopicWithAdmin(
@@ -182,9 +182,9 @@ class FetchFromFollowerIntegrationTest extends BaseFetchRequestTest {
}
@Disabled
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testRackAwareRangeAssignor(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testRackAwareRangeAssignor(groupProtocol: String): Unit = {
val partitionList = brokers.indices.toList
val topicWithAllPartitionsOnAllRacks = "topicWithAllPartitionsOnAllRacks"
diff --git a/core/src/test/scala/integration/kafka/server/GssapiAuthenticationTest.scala b/core/src/test/scala/integration/kafka/server/GssapiAuthenticationTest.scala
index 9868dd1d7d1..68b8e1108ff 100644
--- a/core/src/test/scala/integration/kafka/server/GssapiAuthenticationTest.scala
+++ b/core/src/test/scala/integration/kafka/server/GssapiAuthenticationTest.scala
@@ -180,9 +180,9 @@ class GssapiAuthenticationTest extends IntegrationTestHarness with SaslSetup {
* Test that when client fails to verify authenticity of the server, the resulting failed authentication exception
* is thrown immediately, and is not affected by <code>connection.failed.authentication.delay.ms</code>.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testServerAuthenticationFailure(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testServerAuthenticationFailure(groupProtocol: String): Unit = {
// Setup client with a non-existent service principal, so that server authentication fails on the client
val clientLoginContext = jaasClientLoginModule(kafkaClientSaslMechanism, Some("another-kafka-service"))
val configOverrides = new Properties()
diff --git a/core/src/test/scala/integration/kafka/server/MultipleListenersWithSameSecurityProtocolBaseTest.scala b/core/src/test/scala/integration/kafka/server/MultipleListenersWithSameSecurityProtocolBaseTest.scala
index b7cdbc757a1..bcde663eb52 100644
--- a/core/src/test/scala/integration/kafka/server/MultipleListenersWithSameSecurityProtocolBaseTest.scala
+++ b/core/src/test/scala/integration/kafka/server/MultipleListenersWithSameSecurityProtocolBaseTest.scala
@@ -179,9 +179,9 @@ abstract class MultipleListenersWithSameSecurityProtocolBaseTest extends QuorumT
* Tests that we can produce and consume to/from all broker-defined listeners and security protocols. We produce
* with acks=-1 to ensure that replication is also working.
*/
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceConsume(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceConsume(groupProtocol: String): Unit = {
producers.foreach { case (clientMetadata, producer) =>
val producerRecords = (1 to 10).map(i => new ProducerRecord(clientMetadata.topic, s"key$i".getBytes,
s"value$i".getBytes))
diff --git a/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala b/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
index b99b84152f1..1f4e94811c1 100755
--- a/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
+++ b/core/src/test/scala/integration/kafka/server/QuorumTestHarness.scala
@@ -410,16 +410,6 @@ object QuorumTestHarness {
s"${unexpected.mkString("`", ",", "`")}")
}
- // We want to test the following combinations:
- // * KRaft and the classic group protocol
- // * KRaft and the consumer group protocol
- def getTestQuorumAndGroupProtocolParametersAll: java.util.stream.Stream[Arguments] = {
- stream.Stream.of(
- Arguments.of("kraft", GroupProtocol.CLASSIC.name.toLowerCase(Locale.ROOT)),
- Arguments.of("kraft", GroupProtocol.CONSUMER.name.toLowerCase(Locale.ROOT))
- )
- }
-
def getTestGroupProtocolParametersAll: java.util.stream.Stream[Arguments] = {
stream.Stream.of(
Arguments.of(GroupProtocol.CLASSIC.name.toLowerCase(Locale.ROOT)),
@@ -427,25 +417,17 @@ object QuorumTestHarness {
)
}
- // For tests that only work with the classic group protocol, we want to test the following combinations:
- // * KRaft and the classic group protocol
- def getTestQuorumAndGroupProtocolParametersClassicGroupProtocolOnly: java.util.stream.Stream[Arguments] = {
- stream.Stream.of(
- Arguments.of("kraft", GroupProtocol.CLASSIC.name.toLowerCase(Locale.ROOT))
- )
- }
-
+ // For tests that only work with the classic group protocol
def getTestGroupProtocolParametersClassicGroupProtocolOnly: java.util.stream.Stream[Arguments] = {
stream.Stream.of(
Arguments.of(GroupProtocol.CLASSIC.name.toLowerCase(Locale.ROOT))
)
}
- // For tests that only work with the consumer group protocol, we want to test the following combination:
- // * KRaft and the consumer group protocol
- def getTestQuorumAndGroupProtocolParametersConsumerGroupProtocolOnly: stream.Stream[Arguments] = {
+ // For tests that only work with the consumer group protocol
+ def getTestGroupProtocolParametersConsumerGroupProtocolOnly: java.util.stream.Stream[Arguments] = {
stream.Stream.of(
- Arguments.of("kraft", GroupProtocol.CONSUMER.name.toLowerCase(Locale.ROOT))
+ Arguments.of(GroupProtocol.CONSUMER.name.toLowerCase(Locale.ROOT))
)
}
}
diff --git a/core/src/test/scala/kafka/utils/TestInfoUtils.scala b/core/src/test/scala/kafka/utils/TestInfoUtils.scala
index 9356e79315b..83cbf869051 100644
--- a/core/src/test/scala/kafka/utils/TestInfoUtils.scala
+++ b/core/src/test/scala/kafka/utils/TestInfoUtils.scala
@@ -31,8 +31,6 @@ class EmptyTestInfo extends TestInfo {
}
object TestInfoUtils {
-
- final val TestWithParameterizedQuorumAndGroupProtocolNames = "{displayName}.quorum={0}.groupProtocol={1}"
final val TestWithParameterizedGroupProtocolNames = "{displayName}.groupProtocol={0}"
diff --git a/core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala b/core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala
index 18ef5eafc1a..e7a8e10d80e 100755
--- a/core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala
+++ b/core/src/test/scala/unit/kafka/integration/UncleanLeaderElectionTest.scala
@@ -119,9 +119,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
admin = TestUtils.createAdminClient(brokers, ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT), adminConfigs)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionEnabled(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionEnabled(groupProtocol: String): Unit = {
// enable unclean leader election
configProps1.put("unclean.leader.election.enable", "true")
configProps2.put("unclean.leader.election.enable", "true")
@@ -132,9 +132,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
verifyUncleanLeaderElectionEnabled()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionDisabled(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionDisabled(groupProtocol: String): Unit = {
// unclean leader election is disabled by default
startBrokers(Seq(configProps1, configProps2))
@@ -144,9 +144,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
verifyUncleanLeaderElectionDisabled()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionEnabledByTopicOverride(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionEnabledByTopicOverride(groupProtocol: String): Unit = {
// disable unclean leader election globally, but enable for our specific test topic
configProps1.put("unclean.leader.election.enable", "false")
configProps2.put("unclean.leader.election.enable", "false")
@@ -160,9 +160,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
verifyUncleanLeaderElectionEnabled()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionDisabledByTopicOverride(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionDisabledByTopicOverride(groupProtocol: String): Unit = {
// enable unclean leader election globally, but disable for our specific test topic
configProps1.put("unclean.leader.election.enable", "true")
configProps2.put("unclean.leader.election.enable", "true")
@@ -176,9 +176,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
verifyUncleanLeaderElectionDisabled()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testUncleanLeaderElectionInvalidTopicOverride(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testUncleanLeaderElectionInvalidTopicOverride(groupProtocol: String): Unit = {
startBrokers(Seq(configProps1))
// create topic with an invalid value for unclean leader election
@@ -323,9 +323,9 @@ class UncleanLeaderElectionTest extends QuorumTestHarness {
} finally consumer.close()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testTopicUncleanLeaderElectionEnableWithAlterTopicConfigs(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testTopicUncleanLeaderElectionEnableWithAlterTopicConfigs(groupProtocol: String): Unit = {
// unclean leader election is disabled by default
startBrokers(Seq(configProps1, configProps2))
diff --git a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
index 5c795a0e68f..0b838296811 100644
--- a/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
+++ b/core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
@@ -166,9 +166,9 @@ class MetricsTest extends KafkaServerTestHarness with Logging {
assert(metric.getMBeanName.endsWith(expectedMBeanName))
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testBrokerTopicMetricsBytesInOut(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testBrokerTopicMetricsBytesInOut(groupProtocol: String): Unit = {
val topic = "test-bytes-in-out"
val replicationBytesIn = BrokerTopicMetrics.REPLICATION_BYTES_IN_PER_SEC
val replicationBytesOut = BrokerTopicMetrics.REPLICATION_BYTES_OUT_PER_SEC
diff --git a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
index 0f981cd6cee..cbc6df7180e 100644
--- a/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
+++ b/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala
@@ -62,15 +62,15 @@ class LogDirFailureTest extends IntegrationTestHarness {
ensureConsistentKRaftMetadata()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceErrorFromFailureOnLogRoll(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceErrorFromFailureOnLogRoll(groupProtocol: String): Unit = {
testProduceErrorsFromLogDirFailureOnLeader(Roll)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testLogDirNotificationTimeout(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testLogDirNotificationTimeout(groupProtocol: String): Unit = {
// Disable retries to allow exception to bubble up for validation
this.producerConfig.setProperty(ProducerConfig.RETRIES_CONFIG, "0")
this.producerConfig.setProperty(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "false")
@@ -93,27 +93,27 @@ class LogDirFailureTest extends IntegrationTestHarness {
leaderServer.awaitShutdown()
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testIOExceptionDuringLogRoll(quorum: String, groupProtocol: String): Unit = {
- testProduceAfterLogDirFailureOnLeader(Roll, quorum)
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testIOExceptionDuringLogRoll(groupProtocol: String): Unit = {
+ testProduceAfterLogDirFailureOnLeader(Roll)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testProduceErrorFromFailureOnCheckpoint(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testProduceErrorFromFailureOnCheckpoint(groupProtocol: String): Unit = {
testProduceErrorsFromLogDirFailureOnLeader(Checkpoint)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testIOExceptionDuringCheckpoint(quorum: String, groupProtocol: String): Unit = {
- testProduceAfterLogDirFailureOnLeader(Checkpoint, quorum)
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testIOExceptionDuringCheckpoint(groupProtocol: String): Unit = {
+ testProduceAfterLogDirFailureOnLeader(Checkpoint)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testReplicaFetcherThreadAfterLogDirFailureOnFollower(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testReplicaFetcherThreadAfterLogDirFailureOnFollower(groupProtocol: String): Unit = {
this.producerConfig.setProperty(ProducerConfig.RETRIES_CONFIG, "0")
this.producerConfig.setProperty(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "false")
val producer = createProducer()
@@ -165,7 +165,7 @@ class LogDirFailureTest extends IntegrationTestHarness {
e.getCause.isInstanceOf[NotLeaderOrFollowerException])
}
- def testProduceAfterLogDirFailureOnLeader(failureType: LogDirFailureType, quorum: String): Unit = {
+ def testProduceAfterLogDirFailureOnLeader(failureType: LogDirFailureType): Unit = {
val consumer = createConsumer()
subscribeAndWaitForAssignment(topic, consumer)
diff --git a/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala b/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala
index cb3ebc93785..a6b71d912b3 100644
--- a/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ServerShutdownTest.scala
@@ -74,9 +74,9 @@ class ServerShutdownTest extends KafkaServerTestHarness {
super.setUp(testInfo)
}
- @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
- @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
- def testCleanShutdown(quorum: String, groupProtocol: String): Unit = {
+ @ParameterizedTest(name = TestInfoUtils.TestWithParameterizedGroupProtocolNames)
+ @MethodSource(Array("getTestGroupProtocolParametersAll"))
+ def testCleanShutdown(groupProtocol: String): Unit = {
def createProducer(): KafkaProducer[Integer, String] =
TestUtils.createProducer(
diff --git a/storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestHarness.java b/storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestHarness.java
index ebf4a3f1269..7d8877f6d5b 100644
--- a/storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestHarness.java
+++ b/storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestHarness.java
@@ -105,10 +105,10 @@ public abstract class TieredStorageTestHarness extends IntegrationTestHarness {
context = new TieredStorageTestContext(this);
}
- // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedQuorumName() in the ParameterizedTest name.
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}")
- @MethodSource("getTestQuorumAndGroupProtocolParametersAll")
- public void executeTieredStorageTest(String quorum, String groupProtocol) {
+ // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedGroupProtocolNames() in the ParameterizedTest name.
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}")
+ @MethodSource("getTestGroupProtocolParametersAll")
+ public void executeTieredStorageTest(String groupProtocol) {
TieredStorageTestBuilder builder = new TieredStorageTestBuilder();
writeTestSpecifications(builder);
try {
diff --git a/storage/src/test/java/org/apache/kafka/tiered/storage/integration/DisableRemoteLogOnTopicTest.java b/storage/src/test/java/org/apache/kafka/tiered/storage/integration/DisableRemoteLogOnTopicTest.java
index 797233cae7e..1f0520a48e6 100644
--- a/storage/src/test/java/org/apache/kafka/tiered/storage/integration/DisableRemoteLogOnTopicTest.java
+++ b/storage/src/test/java/org/apache/kafka/tiered/storage/integration/DisableRemoteLogOnTopicTest.java
@@ -41,11 +41,11 @@ public final class DisableRemoteLogOnTopicTest extends TieredStorageTestHarness
return 2;
}
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}")
- @MethodSource("getTestQuorumAndGroupProtocolParametersAll")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}")
+ @MethodSource("getTestGroupProtocolParametersAll")
@Override
- public void executeTieredStorageTest(String quorum, String groupProtocol) {
- super.executeTieredStorageTest(quorum, groupProtocol);
+ public void executeTieredStorageTest(String groupProtocol) {
+ super.executeTieredStorageTest(groupProtocol);
}
@Override
diff --git a/storage/src/test/java/org/apache/kafka/tiered/storage/integration/ListOffsetsTest.java b/storage/src/test/java/org/apache/kafka/tiered/storage/integration/ListOffsetsTest.java
index f441d7fbcbe..c65a8913d09 100644
--- a/storage/src/test/java/org/apache/kafka/tiered/storage/integration/ListOffsetsTest.java
+++ b/storage/src/test/java/org/apache/kafka/tiered/storage/integration/ListOffsetsTest.java
@@ -44,15 +44,13 @@ public class ListOffsetsTest extends TieredStorageTestHarness {
/**
* We are running this test only for the Kraft mode, since ZK mode is deprecated now. Note that:
- * 1. In ZK mode, the leader-epoch gets bumped during reassignment (0 -> 1 -> 2) and leader-election (2 -> 3).
- * 2. In Kraft mode, the leader-epoch gets bumped only for leader-election (0 -> 1) and not for reassignment.
- * @param quorum The quorum to use for the test.
+ * 1. In Kraft mode, the leader-epoch gets bumped only for leader-election (0 -> 1) and not for reassignment.
*/
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}")
- @MethodSource("getTestQuorumAndGroupProtocolParametersAll")
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}")
+ @MethodSource("getTestGroupProtocolParametersAll")
@Override
- public void executeTieredStorageTest(String quorum, String groupProtocol) {
- super.executeTieredStorageTest(quorum, groupProtocol);
+ public void executeTieredStorageTest(String groupProtocol) {
+ super.executeTieredStorageTest(groupProtocol);
}
@Override
diff --git a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTestUtils.java b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTestUtils.java
index 4d9eb4af8e3..075bbc3a734 100644
--- a/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTestUtils.java
+++ b/tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTestUtils.java
@@ -46,7 +46,7 @@ import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.OFFSETS_
import static org.apache.kafka.coordinator.group.GroupCoordinatorConfig.OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG;
/**
- * The old test framework {@link kafka.api.BaseConsumerTest#getTestQuorumAndGroupProtocolParametersAll} test for the following cases:
+ * The old test framework {@link kafka.api.BaseConsumerTest#getTestGroupProtocolParametersAll} test for the following cases:
* <ul>
* <li>(KRAFT server) with (group.coordinator.new.enable=true) with (classic group protocol) = 1 case</li>
* <li>(KRAFT server) with (group.coordinator.new.enable=true) with (consumer group protocol) = 1 case</li>
diff --git a/tools/src/test/java/org/apache/kafka/tools/consumer/group/SaslClientsWithInvalidCredentialsTest.java b/tools/src/test/java/org/apache/kafka/tools/consumer/group/SaslClientsWithInvalidCredentialsTest.java
index 4aad4af5751..1dc368c5070 100644
--- a/tools/src/test/java/org/apache/kafka/tools/consumer/group/SaslClientsWithInvalidCredentialsTest.java
+++ b/tools/src/test/java/org/apache/kafka/tools/consumer/group/SaslClientsWithInvalidCredentialsTest.java
@@ -134,10 +134,10 @@ public class SaslClientsWithInvalidCredentialsTest extends AbstractSaslTest {
closeSasl();
}
- // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedQuorumName() in the ParameterizedTest name.
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}")
- @MethodSource("getTestQuorumAndGroupProtocolParametersAll")
- public void testConsumerGroupServiceWithAuthenticationFailure(String quorum, String groupProtocol) throws Exception {
+ // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedGroupProtocolNames() in the ParameterizedTest name.
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}")
+ @MethodSource("getTestGroupProtocolParametersAll")
+ public void testConsumerGroupServiceWithAuthenticationFailure(String groupProtocol) throws Exception {
try (
ConsumerGroupCommand.ConsumerGroupService consumerGroupService = prepareConsumerGroupService();
Consumer<byte[], byte[]> consumer = createConsumer()
@@ -147,10 +147,10 @@ public class SaslClientsWithInvalidCredentialsTest extends AbstractSaslTest {
}
}
- // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedQuorumName() in the ParameterizedTest name.
- @ParameterizedTest(name = "{displayName}.quorum={0}.groupProtocol={1}")
- @MethodSource("getTestQuorumAndGroupProtocolParametersAll")
- public void testConsumerGroupServiceWithAuthenticationSuccess(String quorum, String groupProtocol) throws Exception {
+ // NOTE: Not able to refer TestInfoUtils#TestWithParameterizedGroupProtocolNames() in the ParameterizedTest name.
+ @ParameterizedTest(name = "{displayName}.groupProtocol={0}")
+ @MethodSource("getTestGroupProtocolParametersAll")
+ public void testConsumerGroupServiceWithAuthenticationSuccess(String groupProtocol) throws Exception {
createScramCredentialsViaPrivilegedAdminClient(JaasTestUtils.KAFKA_SCRAM_USER_2, JaasTestUtils.KAFKA_SCRAM_PASSWORD_2);
try (
ConsumerGroupCommand.ConsumerGroupService consumerGroupService = prepareConsumerGroupService();