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;
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);
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 ->
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;
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 ->