}
@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()
@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() {}
}
@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() {}
}