Skip to content

Commit 5bc2ac6

Browse files
committed
GH-1587: Remove Java 11 Test Elements
1 parent ad24675 commit 5bc2ac6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/TransactionalContainerTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.Collection;
4343
import java.util.Collections;
4444
import java.util.HashMap;
45+
import java.util.HashSet;
4546
import java.util.List;
4647
import java.util.Map;
4748
import java.util.Set;
@@ -542,7 +543,10 @@ public void testRollbackRecord() throws Exception {
542543
container.setApplicationEventPublisher(event -> {
543544
if (event instanceof ListenerContainerIdleEvent) {
544545
Consumer<?, ?> consumer = ((ListenerContainerIdleEvent) event).getConsumer();
545-
committed.set(consumer.committed(Set.of(new TopicPartition(topic1, 0), new TopicPartition(topic1, 1))));
546+
Set<TopicPartition> parts = new HashSet<>();
547+
parts.add(new TopicPartition(topic1, 0));
548+
parts.add(new TopicPartition(topic1, 1));
549+
committed.set(consumer.committed(parts));
546550
if (committed.get().get(new TopicPartition(topic1, 0)) != null) {
547551
idleLatch.countDown();
548552
}

0 commit comments

Comments
 (0)