test: Removed unnecessary Mockito-recordings in `ChatRoomDataTest`
authorKai Moritz <kai@juplo.de>
Fri, 8 Mar 2024 11:24:52 +0000 (12:24 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 22 Mar 2024 16:39:20 +0000 (17:39 +0100)
src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomDataTest.java

index 641dc6a..34626b1 100644 (file)
@@ -116,7 +116,6 @@ public class ChatRoomDataTest
     String messageText = "Bar";
     Message message = new Message(key, 0l, timestamp, messageText);
     when(chatMessageService.getMessage(any(Message.MessageKey.class))).thenReturn(Mono.just(message));
-    when(chatMessageService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class))).thenReturn(Mono.just(message));
 
     // When
     Mono<Message> mono = chatRoomData.addMessage(messageId, user, messageText);
@@ -133,7 +132,6 @@ public class ChatRoomDataTest
     String messageText = "Bar";
     Message message = new Message(key, 0l, timestamp, messageText);
     when(chatMessageService.getMessage(any(Message.MessageKey.class))).thenReturn(Mono.just(message));
-    when(chatMessageService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class))).thenReturn(Mono.just(message));
 
     // When
     chatRoomData
@@ -153,7 +151,6 @@ public class ChatRoomDataTest
     String mutatedText = "Boom!";
     Message message = new Message(key, 0l, timestamp, messageText);
     when(chatMessageService.getMessage(any(Message.MessageKey.class))).thenReturn(Mono.just(message));
-    when(chatMessageService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class))).thenReturn(Mono.just(message));
 
     // When
     Mono<Message> mono = chatRoomData.addMessage(messageId, user, mutatedText);
@@ -171,7 +168,6 @@ public class ChatRoomDataTest
     String mutatedText = "Boom!";
     Message message = new Message(key, 0l, timestamp, messageText);
     when(chatMessageService.getMessage(any(Message.MessageKey.class))).thenReturn(Mono.just(message));
-    when(chatMessageService.persistMessage(any(Message.MessageKey.class), any(LocalDateTime.class), any(String.class))).thenReturn(Mono.just(message));
 
     // When
     chatRoomData