From c2453a503f9e7168469f5fa32084c632b1380913 Mon Sep 17 00:00:00 2001 From: Amol Gote Date: Sat, 4 Nov 2023 16:46:17 -0400 Subject: [PATCH] Update apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java Co-authored-by: Liam Williams --- .../ExtSeqWithTimeWindowIntegrationTest.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java b/apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java index a18efe9961..f723d290c2 100644 --- a/apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java +++ b/apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java @@ -62,18 +62,7 @@ public class ExtSeqWithTimeWindowIntegrationTest { admin = Admin.create(adminProperties); producer = new KafkaProducer<>(producerProperties); consumer = new KafkaConsumer<>(consumerProperties); - List topicList = new ArrayList<>(); - NewTopic newTopic = new NewTopic(Config.MULTI_PARTITION_TOPIC, Config.MULTIPLE_PARTITIONS, Config.REPLICATION_FACTOR); - topicList.add(newTopic); - CreateTopicsResult result = admin.createTopics(topicList); - KafkaFuture future = result.values().get(Config.MULTI_PARTITION_TOPIC); - future.whenComplete((voidResult, exception) -> { - if (exception != null) { - System.err.println("Error creating the topic: " + exception.getMessage()); - } else { - System.out.println("Topic created successfully!"); - } - }).get(); + admin.createTopics(ImmutableList.of(new NewTopic(Config.MULTI_PARTITION_TOPIC, Config.MULTIPLE_PARTITIONS, Config.REPLICATION_FACTOR))).all().get(); } @AfterAll