test: HandoverIT-POC - Added logging for complete/error to listener
authorKai Moritz <kai@juplo.de>
Mon, 11 Mar 2024 17:14:17 +0000 (18:14 +0100)
committerKai Moritz <kai@juplo.de>
Thu, 14 Mar 2024 08:11:21 +0000 (09:11 +0100)
src/test/java/de/juplo/kafka/chat/backend/TestListener.java

index 78d4c82..e58cb2b 100644 (file)
@@ -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<MessageTo> 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));
         });
   }