DIRTYFIX:subscribe rebase--2024-03-03--11-38
authorKai Moritz <kai@juplo.de>
Sun, 3 Mar 2024 10:21:06 +0000 (11:21 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 3 Mar 2024 10:21:06 +0000 (11:21 +0100)
src/test/java/de/juplo/kafka/chat/backend/TestListener.java

index f01e9b5..b7a5b85 100644 (file)
@@ -12,7 +12,6 @@ import org.springframework.http.codec.ServerSentEvent;
 import org.springframework.web.reactive.function.client.WebClient;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
-import reactor.core.scheduler.Schedulers;
 
 import java.util.*;
 
@@ -43,18 +42,8 @@ public class TestListener
                 {
                   return Mono.error(e);
                 }
-              })
-              .doOnNext(message ->
-              {
-                list.add(message);
-                log.info(
-                    "Received a message from chat-room {}: {}",
-                    chatRoom.getName(),
-                    message);
               });
-        })
-        .takeUntil(message -> !running)
-        .doOnComplete(() -> log.info("TestListener is done"));
+        });
   }
 
   Flux<ServerSentEvent<String>> receiveMessages(ChatRoomInfoTo chatRoom)
@@ -76,8 +65,6 @@ public class TestListener
 
   final Map<UUID, List<MessageTo>> receivedMessages = new HashMap<>();
 
-  volatile boolean running = true;
-
 
   TestListener(Integer port, ChatRoomInfoTo[] chatRooms)
   {