From 030e72ea51952a527dbab226d5dac095b8d0b8b1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 20 Mar 2024 18:02:18 +0100 Subject: [PATCH] test: HandoverIT-POC - `TestWriter` logs an error, if sending fails --- .../java/de/juplo/kafka/chat/backend/TestWriter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 aa3c6c10..8d65470a 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -45,7 +45,15 @@ public class TestWriter .delayElements(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) .map(i -> "Message #" + i) .concatMap(message -> sendMessage(chatRoom, message) - .log(user.getName()) + .doOnError(throwable -> + { + WebClientResponseException e = (WebClientResponseException)throwable; + log.info( + "could not send message {} for {}: {}", + message, + user.getName(), + e.getResponseBodyAsString()); + }) .retryWhen(Retry.fixedDelay(60, Duration.ofSeconds(1)))) .doOnNext(message -> { -- 2.20.1