WIP
authorKai Moritz <kai@juplo.de>
Wed, 30 Aug 2023 06:06:06 +0000 (08:06 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 30 Aug 2023 06:06:06 +0000 (08:06 +0200)
src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeTestBase.java
src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeWithShardsTestBase.java

index 0a0b624..8e7cecb 100644 (file)
@@ -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<ChatRoom> mono = chatHome.getChatRoom(chatRoomId);
+    Mono<ChatRoom> 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<ChatRoom> mono = chatHome.getChatRoom(chatRoomId);
+    Mono<ChatRoom> mono = chatHome
+        .getChatRoom(chatRoomId)
+        .retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof LoadInProgressException));
 
     // Then
     assertThat(mono).sendsError(e ->
index c7f8c11..7de73ca 100644 (file)
@@ -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<ChatRoom> mono = chatHome.getChatRoom(chatRoomId);
+    Mono<ChatRoom> mono = chatHome
+        .getChatRoom(chatRoomId)
+        .retryWhen(Retry.indefinitely().filter(throwable -> throwable instanceof LoadInProgressException));
 
     // Then
     assertThat(mono).sendsError(e ->