From: Kai Moritz Date: Fri, 24 Feb 2023 11:00:02 +0000 (+0100) Subject: WIP:test X-Git-Tag: wip-sharding~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=3ef91c31cc754b744d1f0d8aa9fb2eec6a7bc123;p=demos%2Fkafka%2Fchat WIP:test --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTest.java b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTest.java index 8ae19fdc..5d9dfafc 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTest.java +++ b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTest.java @@ -8,7 +8,6 @@ import java.time.Clock; import java.util.UUID; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static pl.rzrz.assertj.reactor.Assertions.assertThat; @@ -29,7 +28,7 @@ public class ChatHomeTest Clock.systemDefaultZone(), mock(ChatRoomService.class), 8); - when(chatHomeService.getChatRoom(anyInt(), any(UUID.class))).thenReturn(Mono.just(chatRoom)); + when(chatHomeService.getChatRoom(any(UUID.class))).thenReturn(Mono.just(chatRoom)); ChatHome chatHome = new ChatHome(chatHomeService); // When @@ -45,7 +44,7 @@ public class ChatHomeTest { // Given ChatHomeService chatHomeService = mock(ChatHomeService.class); - when(chatHomeService.getChatRoom(anyInt(), any(UUID.class))).thenReturn(Mono.empty()); + when(chatHomeService.getChatRoom(any(UUID.class))).thenReturn(Mono.empty()); ChatHome chatHome = new ChatHome(chatHomeService); // When diff --git a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractInMemoryStorageIT.java b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractInMemoryStorageIT.java index dd76324c..a68445b6 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractInMemoryStorageIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/persistence/AbstractInMemoryStorageIT.java @@ -24,6 +24,7 @@ public abstract class AbstractInMemoryStorageIT extends AbstractStorageStrategyI InMemoryChatHomeService chatHomeService = new InMemoryChatHomeService( 1, new int[] { 0 }, + id -> 0, getStorageStrategy().read()); InMemoryChatRoomFactory chatRoomFactory = new InMemoryChatRoomFactory(