WIP:test: HandoverIT-POC - Refactored listening into class `TestListener`
authorKai Moritz <kai@juplo.de>
Fri, 1 Mar 2024 18:56:54 +0000 (19:56 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 1 Mar 2024 18:56:54 +0000 (19:56 +0100)
src/test/java/de/juplo/kafka/chat/backend/TestListener.java

index 0ea8628..1c993c1 100644 (file)
@@ -44,9 +44,14 @@ public class TestListener implements Runnable
                 return Mono.error(e);
               }
             })
+            .doOnNext(message -> log.info(
+                "Received a message from chat-room {}: {}",
+                chatRoom,
+                message))
             .take(30))
         .takeUntil(message -> !running)
-        .subscribe(message -> log.info("Received message: {}", message));
+        .then()
+        .block();
   }
 
   Flux<ServerSentEvent<String>> receiveMessages(ChatRoomInfoTo chatRoom)