From 89f1433b2cc15be946036326e20e49e7e4fe301b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 24 Jan 2024 22:59:08 +0100 Subject: [PATCH] WIP --- pom.xml | 5 ---- .../java/de/juplo/kafka/ApplicationTests.java | 27 +++++++------------ 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 458b0e3..00042cc 100644 --- a/pom.xml +++ b/pom.xml @@ -38,11 +38,6 @@ spring-kafka-test test - - org.awaitility - awaitility - test - org.assertj assertj-core diff --git a/src/test/java/de/juplo/kafka/ApplicationTests.java b/src/test/java/de/juplo/kafka/ApplicationTests.java index a93c974..5763f76 100644 --- a/src/test/java/de/juplo/kafka/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/ApplicationTests.java @@ -44,27 +44,20 @@ public class ApplicationTests TOPIC, "B"); + CompletableFuture result; + instanceA.begin(); - CompletableFuture resultA1 = instanceA.send("a","message #1"); - await("Sending of 1. message for A is completed") - .atMost(Duration.ofSeconds(5)) - .until(() -> resultA1.isDone()); - Assertions.assertThat(resultA1.get()) + result = instanceA.send("a","message #1"); + Assertions.assertThat(result.isCompletedExceptionally()).isFalse(); instanceB.begin(); - CompletableFuture resultB1 = instanceB.send("b","message #1"); - await("Sending of 1. message for B is completed") - .atMost(Duration.ofSeconds(5)) - .until(() -> resultB1.isDone()); + result = instanceB.send("b","message #1"); + Assertions.assertThat(result.isCompletedExceptionally()).isFalse(); - CompletableFuture resultA2 = instanceA.send("a","message #2"); - await("Sending of 2. message for A is completed") - .atMost(Duration.ofSeconds(5)) - .until(() -> resultA2.isDone()); + result = instanceA.send("a","message #2"); + Assertions.assertThat(result.isCompletedExceptionally()).isTrue(); - CompletableFuture resultB2 = instanceB.send("b","message #2"); - await("Sending of 2. message for B is completed") - .atMost(Duration.ofSeconds(5)) - .until(() -> resultB2.isDone()); + result = instanceB.send("b","message #2"); + Assertions.assertThat(result.isCompletedExceptionally()).isFalse(); } } -- 2.20.1