From: Kai Moritz Date: Wed, 30 Aug 2023 06:06:06 +0000 (+0200) Subject: WIP X-Git-Tag: rebase--2023-09-02--10-22~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=9eb262cb7b1a83f8d3d0484d951d5252202a4b59;p=demos%2Fkafka%2Fchat WIP --- 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 0a0b6249..8e7cecb2 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 @@ -6,6 +6,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.junit.jupiter.SpringExtension; import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; import java.util.UUID; @@ -27,7 +28,9 @@ public class ChatHomeTestBase UUID chatRoomId = UUID.fromString("5c73531c-6fc4-426c-adcb-afc5c140a0f7"); // When - Mono mono = chatHome.getChatRoom(chatRoomId); + Mono mono = chatHome + .getChatRoom(chatRoomId) + .retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof LoadInProgressException)); // Then assertThat(mono).emitsCount(1); @@ -41,7 +44,9 @@ public class ChatHomeTestBase UUID chatRoomId = UUID.fromString("7f59ec77-832e-4a17-8d22-55ef46242c17"); // When - Mono mono = chatHome.getChatRoom(chatRoomId); + Mono mono = chatHome + .getChatRoom(chatRoomId) + .retryWhen(Retry.indefinitely().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 c7f8c119..7de73cad 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 @@ -3,6 +3,7 @@ package de.juplo.kafka.chat.backend.domain; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; import java.util.UUID; @@ -24,7 +25,9 @@ public class ChatHomeWithShardsTestBase extends ChatHomeTestBase UUID chatRoomId = UUID.fromString("4e7246a6-29ae-43ea-b56f-669c3481ac19"); // When - Mono mono = chatHome.getChatRoom(chatRoomId); + Mono mono = chatHome + .getChatRoom(chatRoomId) + .retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof LoadInProgressException)); // Then assertThat(mono).sendsError(e ->