test: `LocalJsonFilesStorageStrategyIT` asserts, that the state is restored
[demos/kafka/chat] / src / test / java / de / juplo / kafka / chat / backend / persistence / LocalJsonFilesStorageStrategyIT.java
index d136fa9..8177881 100644 (file)
@@ -64,6 +64,11 @@ public class LocalJsonFilesStorageStrategyIT
     assertThat(chathome.getChatroom(chatroom.getId()).get().getMessages().toStream()).containsExactlyElementsOf(List.of(m1, m2, m3, m4));
 
     stop();
+    start();
+
+    assertThat(chathome.list()).containsExactlyElementsOf(List.of(chatroom));
+    assertThat(chathome.getChatroom(chatroom.getId())).contains(chatroom);
+    assertThat(chathome.getChatroom(chatroom.getId()).get().getMessages().toStream()).containsExactlyElementsOf(List.of(m1, m2, m3, m4));
   }
 
   @BeforeEach