Fixed failing reactive test
@@ -92,7 +92,7 @@ public class ReactorTest {
}
@Test
- public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() {
+ public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() throws InterruptedException {
List<Integer> elements = new ArrayList<>();
Flux.just(1, 2, 3, 4)
@@ -101,6 +101,8 @@ public class ReactorTest {
.subscribeOn(Schedulers.parallel())
.subscribe(elements::add);
+ Thread.sleep(1000);
+
assertThat(elements).containsExactly(2, 4, 6, 8);
}
