From d89b86b82b4c57245dcc2042eea168aaad727087 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 1 Mar 2024 19:55:16 +0100 Subject: [PATCH] WIP:test: HandoverIT-POC - Refactored `TestWriter` to use a `Flux` --- .../java/de/juplo/kafka/chat/backend/TestWriter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java index 08634b8a..267519e1 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -44,6 +44,11 @@ public class TestWriter implements Runnable .flatMap(message -> sendMessage(chatRoom, message) .delayElement(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) .retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1)))) + .doOnNext(message -> log.info( + "{} sent a message to {}: {}", + user, + chatRoom, + message)) .doOnError(throwable -> { WebClientResponseException e = (WebClientResponseException)throwable.getCause(); @@ -52,11 +57,6 @@ public class TestWriter implements Runnable user, e.getResponseBodyAsString(Charset.defaultCharset())); }) - .doOnNext(message -> log.info( - "{} sent a message to {}: {}", - user, - chatRoom, - message)) .then() .block(); } -- 2.20.1