Skip to content

Commit bf4f385

Browse files
MirrorCheckpointConnectorTest failures
1 parent 4bcdd34 commit bf4f385

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Diff for: connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnectorTest.java

+13-10
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
*/
1717
package org.apache.kafka.connect.mirror;
1818

19-
import org.apache.kafka.clients.admin.ConsumerGroupListing;
19+
import org.apache.kafka.clients.admin.GroupListing;
2020
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
21+
import org.apache.kafka.clients.consumer.internals.ConsumerProtocol;
22+
import org.apache.kafka.common.GroupType;
2123
import org.apache.kafka.common.TopicPartition;
2224
import org.apache.kafka.connect.errors.ConnectException;
2325
import org.apache.kafka.connect.errors.RetriableException;
@@ -31,6 +33,7 @@
3133
import java.util.HashSet;
3234
import java.util.List;
3335
import java.util.Map;
36+
import java.util.Optional;
3437
import java.util.Set;
3538
import java.util.function.Function;
3639
import java.util.stream.Collectors;
@@ -144,9 +147,9 @@ public void testFindConsumerGroups() throws Exception {
144147
MirrorCheckpointConnector connector = new MirrorCheckpointConnector(Collections.emptySet(), config);
145148
connector = spy(connector);
146149

147-
Collection<ConsumerGroupListing> groups = Arrays.asList(
148-
new ConsumerGroupListing("g1", true),
149-
new ConsumerGroupListing("g2", false));
150+
Collection<GroupListing> groups = Arrays.asList(
151+
new GroupListing("g1", Optional.of(GroupType.CLASSIC), "", Optional.empty()),
152+
new GroupListing("g2", Optional.of(GroupType.CLASSIC), ConsumerProtocol.PROTOCOL_TYPE, Optional.empty()));
150153
Map<TopicPartition, OffsetAndMetadata> offsets = new HashMap<>();
151154
offsets.put(new TopicPartition("t1", 0), new OffsetAndMetadata(0));
152155
doReturn(groups).when(connector).listConsumerGroups();
@@ -159,7 +162,7 @@ public void testFindConsumerGroups() throws Exception {
159162
doReturn(groupToOffsets).when(connector).listConsumerGroupOffsets(anyList());
160163
Set<String> groupFound = connector.findConsumerGroups();
161164

162-
Set<String> expectedGroups = groups.stream().map(ConsumerGroupListing::groupId).collect(Collectors.toSet());
165+
Set<String> expectedGroups = groups.stream().map(GroupListing::groupId).collect(Collectors.toSet());
163166
assertEquals(expectedGroups, groupFound,
164167
"Expected groups are not the same as findConsumerGroups");
165168

@@ -174,11 +177,11 @@ public void testFindConsumerGroupsInCommonScenarios() throws Exception {
174177
MirrorCheckpointConnector connector = new MirrorCheckpointConnector(Collections.emptySet(), config);
175178
connector = spy(connector);
176179

177-
Collection<ConsumerGroupListing> groups = Arrays.asList(
178-
new ConsumerGroupListing("g1", true),
179-
new ConsumerGroupListing("g2", false),
180-
new ConsumerGroupListing("g3", false),
181-
new ConsumerGroupListing("g4", false));
180+
Collection<GroupListing> groups = Arrays.asList(
181+
new GroupListing("g1", Optional.of(GroupType.CLASSIC), "", Optional.empty()),
182+
new GroupListing("g2", Optional.of(GroupType.CLASSIC), ConsumerProtocol.PROTOCOL_TYPE, Optional.empty()),
183+
new GroupListing("g3", Optional.of(GroupType.CLASSIC), ConsumerProtocol.PROTOCOL_TYPE, Optional.empty()),
184+
new GroupListing("g4", Optional.of(GroupType.CLASSIC), ConsumerProtocol.PROTOCOL_TYPE, Optional.empty()));
182185
Map<TopicPartition, OffsetAndMetadata> offsetsForGroup1 = new HashMap<>();
183186
Map<TopicPartition, OffsetAndMetadata> offsetsForGroup2 = new HashMap<>();
184187
Map<TopicPartition, OffsetAndMetadata> offsetsForGroup3 = new HashMap<>();

0 commit comments

Comments
 (0)