From: Kai Moritz Date: Mon, 11 Mar 2024 17:14:17 +0000 (+0100) Subject: test: HandoverIT-POC - Added logging for complete/error to listener X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=295c4aeab33547e7fc2445da7b7e3c0ae2504920;p=demos%2Fkafka%2Fchat test: HandoverIT-POC - Added logging for complete/error to listener --- 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)); }); }