package de.juplo.kafka.chat.backend.api;
import de.juplo.kafka.chat.backend.domain.*;
+import de.juplo.kafka.chat.backend.persistence.inmemory.InMemoryChatHomeService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.mockito.Mockito.*;
-@SpringBootTest(properties = "spring.main.allow-bean-definition-overriding=true")
+@SpringBootTest(properties = {
+ "spring.main.allow-bean-definition-overriding=true",
+ "chat.backend.inmemory.sharding-strategy=none" })
@AutoConfigureWebTestClient
@Slf4j
public class ChatBackendControllerTest
{
@MockBean
- ChatHomeService chatHomeService;
+ InMemoryChatHomeService chatHomeService;
@MockBean
ChatRoomService chatRoomService;
.thenReturn(Mono.just(existingMessage));
// Needed for readable error-reports, in case of a bug that leads to according unwanted call
when(chatRoomService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class)))
- .thenReturn(mock(Message.class));
+ .thenReturn(Mono.just(mock(Message.class)));
// When
client
.thenReturn(Mono.empty());
// Needed for readable error-reports, in case of a bug that leads to according unwanted call
when(chatRoomService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class)))
- .thenReturn(mock(Message.class));
+ .thenReturn(Mono.just(mock(Message.class)));
// When
client