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, 15 Mar 2024 20:33:27 +0000 (21:33 +0100)
src/test/java/de/juplo/kafka/chat/backend/domain/ChatRoomDataTest.java

index 58c4b50..341f658 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