diff --git a/implementation/src/test/java/io/smallrye/mutiny/operators/MultiTransformToUniTest.java b/implementation/src/test/java/io/smallrye/mutiny/operators/MultiTransformToUniTest.java index 0c53f930e..12acbfc90 100644 --- a/implementation/src/test/java/io/smallrye/mutiny/operators/MultiTransformToUniTest.java +++ b/implementation/src/test/java/io/smallrye/mutiny/operators/MultiTransformToUniTest.java @@ -2,6 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.time.Duration; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; @@ -20,7 +21,7 @@ public void testTransformToUniAndConcatenate() { .onItem() .transformToUni(i -> Uni.createFrom().completionStage(CompletableFuture.supplyAsync(() -> i + 1))) .concatenate() - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactly(2, 3, 4); } @@ -98,7 +99,7 @@ public void testTransformToUniAndConcatenateSingleCall() { List list = Multi.createFrom().range(1, 4) .onItem() .transformToUniAndConcatenate(i -> Uni.createFrom().completionStage(CompletableFuture.supplyAsync(() -> i + 1))) - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactly(2, 3, 4); } @@ -109,7 +110,7 @@ public void testTransformToUniAndMerge() { .onItem() .transformToUni(i -> Uni.createFrom().completionStage(CompletableFuture.supplyAsync(() -> i + 1))) .merge() - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactlyInAnyOrder(2, 3, 4); } @@ -178,7 +179,7 @@ public void testTransformToUniAndMergeSingleCall() { List list = Multi.createFrom().range(1, 4) .onItem() .transformToUniAndMerge(i -> Uni.createFrom().completionStage(CompletableFuture.supplyAsync(() -> i + 1))) - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactlyInAnyOrder(2, 3, 4); } @@ -192,7 +193,7 @@ public void testTransformToUniAndMergeWithUniOfVoid() { return i; } }))) - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactlyInAnyOrder(1, 3, 5); } @@ -208,7 +209,7 @@ public void testTransformToUniAndConcatenateWithUniOfVoid() { return i; } }))) - .collect().asList().await().indefinitely(); + .collect().asList().await().atMost(Duration.ofSeconds(45)); assertThat(list).containsExactly(1, 3, 5); }