From 029c3910b0fbb9e3ce69f67f3a2ffef81f39206d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 24 Jan 2024 23:17:34 +0100 Subject: [PATCH] WIP --- .../java/de/juplo/kafka/ApplicationTests.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/test/java/de/juplo/kafka/ApplicationTests.java b/src/test/java/de/juplo/kafka/ApplicationTests.java index 75b9a31..370dbc2 100644 --- a/src/test/java/de/juplo/kafka/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/ApplicationTests.java @@ -38,34 +38,34 @@ public class ApplicationTests SimpleProducer instanceA = new SimpleProducer( bootstrapServers, TOPIC, - "A"); - SimpleProducer instanceB = new SimpleProducer( - bootstrapServers, - TOPIC, - "B"); + "FOO"); instanceA.begin(); - CompletableFuture resultA1 = instanceA.send("a","message #1"); + CompletableFuture resultA1 = instanceA.send("foo","message #1"); await("Sending of 1. message for A is completed") .atMost(Duration.ofSeconds(5)) .until(() -> resultA1.isDone()); Assertions.assertThat(resultA1.isCompletedExceptionally()).isFalse(); + SimpleProducer instanceB = new SimpleProducer( + bootstrapServers, + TOPIC, + "FOO"); + instanceB.begin(); - CompletableFuture resultB1 = instanceB.send("b","message #1"); + CompletableFuture resultB1 = instanceB.send("foo","message #1"); await("Sending of 1. message for B is completed") .atMost(Duration.ofSeconds(5)) .until(() -> resultB1.isDone()); Assertions.assertThat(resultB1.isCompletedExceptionally()).isFalse(); - CompletableFuture resultA2 = instanceA.send("a","message #2"); + CompletableFuture resultA2 = instanceA.send("foo","message #2"); await("Sending of 2. message for A is completed") .atMost(Duration.ofSeconds(5)) .until(() -> resultA2.isDone()); - // Assertions.assertThat(resultA2.isCompletedExceptionally()).isTrue(); - Assertions.assertThat(resultA2.isCompletedExceptionally()).isFalse(); + Assertions.assertThat(resultA2.isCompletedExceptionally()).isTrue(); - CompletableFuture resultB2 = instanceB.send("b","message #2"); + CompletableFuture resultB2 = instanceB.send("foo","message #2"); await("Sending of 2. message for B is completed") .atMost(Duration.ofSeconds(5)) .until(() -> resultB2.isDone()); -- 2.20.1