refactor: `ChatRoomService.persistMessage(..)` returns a `Mono<Message>`
[demos/kafka/chat] / src / test / java / de / juplo / kafka / chat / backend / persistence / InMemoryWithMongoDbStorageIT.java
index ecc64d5..e56aff7 100644 (file)
@@ -42,6 +42,8 @@ public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT
   @Autowired
   MongoDbStorageStrategy storageStrategy;
   @Autowired
+  ChatRoomRepository repository;
+  @Autowired
   Clock clock;
 
 
@@ -55,7 +57,6 @@ public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT
   protected Supplier<ChatHomeService> getChatHomeServiceSupplier()
   {
     return () -> new InMemoryChatHomeService(
-        chatRoomId -> 0,
         1,
         new int[] { 0 },
         getStorageStrategy().read());
@@ -80,6 +81,7 @@ public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT
           chatRoomRepository,
           clock,
           8,
+          chatRoomId -> 0,
           messageFlux -> new InMemoryChatRoomService(messageFlux));
     }
 
@@ -116,5 +118,6 @@ public class InMemoryWithMongoDbStorageIT extends AbstractStorageStrategyIT
   {
     Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log);
     CONTAINER.followOutput(logConsumer);
+    repository.deleteAll();
   }
 }