3232import org .apache .kafka .common .protocol .Errors ;
3333import org .apache .kafka .common .serialization .ByteArrayDeserializer ;
3434import org .apache .kafka .common .test .ClusterInstance ;
35- import org .apache .kafka .common .test .api .ClusterConfig ;
36- import org .apache .kafka .common .test .api .ClusterTemplate ;
35+ import org .apache .kafka .common .test .api .ClusterConfigProperty ;
36+ import org .apache .kafka .common .test .api .ClusterTest ;
37+ import org .apache .kafka .common .test .api .ClusterTestDefaults ;
38+ import org .apache .kafka .common .test .api .Type ;
3739import org .apache .kafka .coordinator .group .GroupCoordinatorConfig ;
3840
3941import org .junit .jupiter .api .Assertions ;
4042
4143import java .time .Duration ;
4244import java .util .Collections ;
4345import java .util .HashMap ;
44- import java .util .List ;
4546import java .util .Map ;
4647import java .util .Map .Entry ;
4748
49+ import static org .apache .kafka .coordinator .group .GroupCoordinatorConfig .CONSUMER_GROUP_HEARTBEAT_INTERVAL_MS_CONFIG ;
50+ import static org .apache .kafka .coordinator .group .GroupCoordinatorConfig .CONSUMER_GROUP_MIN_HEARTBEAT_INTERVAL_MS_CONFIG ;
51+ import static org .apache .kafka .coordinator .group .GroupCoordinatorConfig .GROUP_INITIAL_REBALANCE_DELAY_MS_CONFIG ;
52+ import static org .apache .kafka .coordinator .group .GroupCoordinatorConfig .OFFSETS_TOPIC_PARTITIONS_CONFIG ;
53+ import static org .apache .kafka .coordinator .group .GroupCoordinatorConfig .OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG ;
4854import static org .apache .kafka .test .TestUtils .DEFAULT_MAX_WAIT_MS ;
4955import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
5056import static org .junit .jupiter .api .Assertions .assertEquals ;
5157import static org .junit .jupiter .api .Assertions .assertNull ;
5258
59+ @ ClusterTestDefaults (
60+ types = {Type .CO_KRAFT },
61+ serverProperties = {
62+ @ ClusterConfigProperty (key = OFFSETS_TOPIC_PARTITIONS_CONFIG , value = "1" ),
63+ @ ClusterConfigProperty (key = OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG , value = "1" ),
64+ @ ClusterConfigProperty (key = GROUP_INITIAL_REBALANCE_DELAY_MS_CONFIG , value = "1000" ),
65+ @ ClusterConfigProperty (key = CONSUMER_GROUP_HEARTBEAT_INTERVAL_MS_CONFIG , value = "500" ),
66+ @ ClusterConfigProperty (key = CONSUMER_GROUP_MIN_HEARTBEAT_INTERVAL_MS_CONFIG , value = "500" ),
67+ }
68+ )
5369public class DeleteOffsetsConsumerGroupCommandIntegrationTest {
5470 public static final String TOPIC_PREFIX = "foo." ;
5571 public static final String GROUP_PREFIX = "test.group." ;
@@ -59,11 +75,7 @@ public class DeleteOffsetsConsumerGroupCommandIntegrationTest {
5975 this .clusterInstance = clusterInstance ;
6076 }
6177
62- private static List <ClusterConfig > generator () {
63- return ConsumerGroupCommandTestUtils .generator ();
64- }
65-
66- @ ClusterTemplate ("generator" )
78+ @ ClusterTest
6779 public void testDeleteOffsetsNonExistingGroup () {
6880 String group = "missing.group" ;
6981 String topic = "foo:1" ;
@@ -73,7 +85,7 @@ public void testDeleteOffsetsNonExistingGroup() {
7385 }
7486 }
7587
76- @ ClusterTemplate ( "generator" )
88+ @ ClusterTest
7789 public void testDeleteOffsetsOfStableConsumerGroupWithTopicPartition () {
7890 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
7991 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -85,7 +97,7 @@ public void testDeleteOffsetsOfStableConsumerGroupWithTopicPartition() {
8597 }
8698 }
8799
88- @ ClusterTemplate ( "generator" )
100+ @ ClusterTest
89101 public void testDeleteOffsetsOfStableConsumerGroupWithTopicOnly () {
90102 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
91103 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -97,7 +109,7 @@ public void testDeleteOffsetsOfStableConsumerGroupWithTopicOnly() {
97109 }
98110 }
99111
100- @ ClusterTemplate ( "generator" )
112+ @ ClusterTest
101113 public void testDeleteOffsetsOfStableConsumerGroupWithUnknownTopicPartition () {
102114 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
103115 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -107,7 +119,7 @@ public void testDeleteOffsetsOfStableConsumerGroupWithUnknownTopicPartition() {
107119 }
108120 }
109121
110- @ ClusterTemplate ( "generator" )
122+ @ ClusterTest
111123 public void testDeleteOffsetsOfStableConsumerGroupWithUnknownTopicOnly () {
112124 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
113125 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -117,7 +129,7 @@ public void testDeleteOffsetsOfStableConsumerGroupWithUnknownTopicOnly() {
117129 }
118130 }
119131
120- @ ClusterTemplate ( "generator" )
132+ @ ClusterTest
121133 public void testDeleteOffsetsOfEmptyConsumerGroupWithTopicPartition () {
122134 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
123135 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -129,7 +141,7 @@ public void testDeleteOffsetsOfEmptyConsumerGroupWithTopicPartition() {
129141 }
130142 }
131143
132- @ ClusterTemplate ( "generator" )
144+ @ ClusterTest
133145 public void testDeleteOffsetsOfEmptyConsumerGroupWithTopicOnly () {
134146 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
135147 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -141,7 +153,7 @@ public void testDeleteOffsetsOfEmptyConsumerGroupWithTopicOnly() {
141153 }
142154 }
143155
144- @ ClusterTemplate ( "generator" )
156+ @ ClusterTest
145157 public void testDeleteOffsetsOfEmptyConsumerGroupWithUnknownTopicPartition () {
146158 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
147159 String topic = TOPIC_PREFIX + groupProtocol .name ();
@@ -151,7 +163,7 @@ public void testDeleteOffsetsOfEmptyConsumerGroupWithUnknownTopicPartition() {
151163 }
152164 }
153165
154- @ ClusterTemplate ( "generator" )
166+ @ ClusterTest
155167 public void testDeleteOffsetsOfEmptyConsumerGroupWithUnknownTopicOnly () {
156168 for (GroupProtocol groupProtocol : clusterInstance .supportedGroupProtocols ()) {
157169 String topic = TOPIC_PREFIX + groupProtocol .name ();
0 commit comments