From 2120daa55f05f237851e16eb0f8978457c301b76 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..95a8ff8f 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("Listening to {} was completed!", chatRoom)) + .doOnError(throwalbe -> log.error("Listening to {} failed!", chatRoom, throwalbe)); }); } -- 2.20.1