WIP:test: `*ConfigurationIT` asserts, if restored messages can be seen
authorKai Moritz <kai@juplo.de>
Thu, 14 Mar 2024 11:05:11 +0000 (12:05 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 16 Mar 2024 09:34:23 +0000 (10:34 +0100)
src/test/java/de/juplo/kafka/chat/backend/AbstractConfigurationIT.java
src/test/java/de/juplo/kafka/chat/backend/InMemoryWithNoStorageAndShardingConfigurationIT.java
src/test/java/de/juplo/kafka/chat/backend/InMemoryWithNoStorageConfigurationIT.java

index 3e0efd3..9d87088 100644 (file)
@@ -251,37 +251,8 @@ public abstract class AbstractConfigurationIT
   }
 
   @Test
-  @DisplayName("Restored messages can be seen, when listening to restored chat-room")
-  void testListenToRestoredChatRoomYieldsRestoredMessages()
-  {
-    Awaitility
-        .await()
-        .atMost(Duration.ofSeconds(15))
-        .untilAsserted(() ->
-        {
-          Flux<MessageTo> result = webTestClient
-              .get()
-              .uri(
-                  "http://localhost:{port}/{chatRoomId}/listen",
-                  port,
-                  EXISTING_CHATROOM)
-              .accept(MediaType.TEXT_EVENT_STREAM)
-              .exchange()
-              .expectStatus().isOk()
-              .returnResult(MessageTo.class)
-              .getResponseBody();
-
-          List<MessageTo> messages = result
-              .take(expectedExistingMessages.length)
-              .collectList()
-              .block();
-          assertThat(messages).containsExactly(expectedExistingMessages);
-        });
-  }
-
-  @Test
-  @DisplayName("Newly send messages can be seen, when listening to restored chat-room")
-  void testListenToRestoredChatRoomYieldsAddedMessages()
+  @DisplayName("Only newly send messages can be seen, when listening to restored chat-room")
+  void testListenToRestoredChatRoomYieldsOnlyNewlyAddedMessages()
   {
     MessageTo sentMessage = webTestClient
         .put()
index 830a822..5696d7e 100644 (file)
@@ -31,9 +31,5 @@ class InMemoryWithNoStorageAndShardingConfigurationIT extends AbstractConfigurat
 
   @Override
   @Disabled("Chat-Rooms cannot be restored, if storage is disabled")
-  void testListenToRestoredChatRoomYieldsRestoredMessages() {}
-
-  @Override
-  @Disabled("Chat-Rooms cannot be restored, if storage is disabled")
-  void testListenToRestoredChatRoomYieldsAddedMessages() {}
+  void testListenToRestoredChatRoomYieldsOnlyNewlyAddedMessages() {}
 }
index b23da11..90c0b8d 100644 (file)
@@ -29,9 +29,5 @@ class InMemoryWithNoStorageConfigurationIT extends AbstractConfigurationIT
 
        @Override
        @Disabled("Chat-Rooms cannot be restored, if storage is disabled")
-       void testListenToRestoredChatRoomYieldsRestoredMessages() {}
-
-       @Override
-       @Disabled("Chat-Rooms cannot be restored, if storage is disabled")
-       void testListenToRestoredChatRoomYieldsAddedMessages() {}
+       void testListenToRestoredChatRoomYieldsOnlyNewlyAddedMessages() {}
 }