From 295c4aeab33547e7fc2445da7b7e3c0ae2504920 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 11 Mar 2024 18:14:17 +0100 Subject: [PATCH] test: HandoverIT-POC - Added logging for complete/error to listener --- src/test/java/de/juplo/kafka/chat/backend/TestListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java index 78d4c82f..e58cb2b6 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java @@ -28,7 +28,7 @@ public class TestListener .fromArray(chatRooms) .flatMap(chatRoom -> { - log.info("Requesting messages from chat-room {}", chatRoom); + log.info("Requesting messages for chat-room {}", chatRoom); List list = new LinkedList<>(); receivedMessages.put(chatRoom.getId(), list); return receiveMessages(chatRoom) @@ -43,7 +43,9 @@ public class TestListener return Mono.error(e); } }) - .doOnNext(message -> list.add(message)); + .doOnNext(message -> list.add(message)) + .doOnComplete(() -> log.info("{} was completed!", chatRoom)) + .doOnError(throwalbe -> log.error("{} failed: {}", chatRoom, throwalbe)); }); } -- 2.20.1