Skip to content

Commit c2453a5

Browse files
Update apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java
Co-authored-by: Liam Williams <liam.williams@zoho.com>
1 parent 1394665 commit c2453a5

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/ExtSeqWithTimeWindowIntegrationTest.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,7 @@ static void setup() throws ExecutionException, InterruptedException {
6262
admin = Admin.create(adminProperties);
6363
producer = new KafkaProducer<>(producerProperties);
6464
consumer = new KafkaConsumer<>(consumerProperties);
65-
List<NewTopic> topicList = new ArrayList<>();
66-
NewTopic newTopic = new NewTopic(Config.MULTI_PARTITION_TOPIC, Config.MULTIPLE_PARTITIONS, Config.REPLICATION_FACTOR);
67-
topicList.add(newTopic);
68-
CreateTopicsResult result = admin.createTopics(topicList);
69-
KafkaFuture<Void> future = result.values().get(Config.MULTI_PARTITION_TOPIC);
70-
future.whenComplete((voidResult, exception) -> {
71-
if (exception != null) {
72-
System.err.println("Error creating the topic: " + exception.getMessage());
73-
} else {
74-
System.out.println("Topic created successfully!");
75-
}
76-
}).get();
65+
admin.createTopics(ImmutableList.of(new NewTopic(Config.MULTI_PARTITION_TOPIC, Config.MULTIPLE_PARTITIONS, Config.REPLICATION_FACTOR))).all().get();
7766
}
7867

7968
@AfterAll

0 commit comments

Comments
 (0)