Skip to content

Commit 6bbb4cf

Browse files
committed
Fixed failing reactive test
1 parent 73026b6 commit 6bbb4cf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎reactor-core/src/test/java/com/baeldung/reactor/ReactorTest.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void onComplete() {
9292
}
9393

9494
@Test
95-
public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() {
95+
public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() throws InterruptedException {
9696
List<Integer> elements = new ArrayList<>();
9797

9898
Flux.just(1, 2, 3, 4)
@@ -101,6 +101,8 @@ public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() {
101101
.subscribeOn(Schedulers.parallel())
102102
.subscribe(elements::add);
103103

104+
Thread.sleep(1000);
105+
104106
assertThat(elements).containsExactly(2, 4, 6, 8);
105107
}
106108

0 commit comments

Comments
 (0)