From 37d08aac0c5dca8728226072a76829da61302662 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 1 Sep 2023 18:27:07 +0200 Subject: [PATCH] WIP --- .../backend/persistence/kafka/ChatRoomChannel.java | 2 +- .../kafka/chat/backend/domain/ChatHomeTestBase.java | 10 ++++------ .../backend/domain/ChatHomeWithShardsTestBase.java | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java index 92f294b2..ad9531cb 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java @@ -375,7 +375,7 @@ public class ChatRoomChannel implements Runnable, ConsumerRebalanceListener if (!isShardOwned[shard]) { - log.error("Shard {} for chat-room {] not owned!", shard, id); + log.error("Shard {} for chat-room {} not owned!", shard, id); return Mono.error(new ShardNotOwnedException(shard)); } diff --git a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTestBase.java b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTestBase.java index bbe62a17..4bf11899 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTestBase.java +++ b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTestBase.java @@ -31,11 +31,10 @@ public class ChatHomeTestBase // When Mono mono = chatHome .getChatRoom(chatRoomId) - .log() + .log("testGetExistingChatroom") .retryWhen(Retry .backoff(5, Duration.ofSeconds(1)) - .filter(throwable -> throwable instanceof LoadInProgressException)) - .log(); + .filter(throwable -> throwable instanceof LoadInProgressException)); // Then assertThat(mono).emitsCount(1); @@ -51,11 +50,10 @@ public class ChatHomeTestBase // When Mono mono = chatHome .getChatRoom(chatRoomId) - .log() + .log("testGetNonExistentChatroom") .retryWhen(Retry .backoff(5, Duration.ofSeconds(1)) - .filter(throwable -> throwable instanceof LoadInProgressException)) - .log(); + .filter(throwable -> throwable instanceof LoadInProgressException)); // Then assertThat(mono).sendsError(e -> diff --git a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeWithShardsTestBase.java b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeWithShardsTestBase.java index 74445708..85e187b2 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeWithShardsTestBase.java +++ b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeWithShardsTestBase.java @@ -28,11 +28,10 @@ public class ChatHomeWithShardsTestBase extends ChatHomeTestBase // When Mono mono = chatHome .getChatRoom(chatRoomId) - .log() + .log("testGetChatroomForNotOwnedShard") .retryWhen(Retry .backoff(5, Duration.ofSeconds(1)) - .filter(throwable -> throwable instanceof LoadInProgressException)) - .log(); + .filter(throwable -> throwable instanceof LoadInProgressException)); // Then assertThat(mono).sendsError(e -> -- 2.20.1