Fixed failing reactive test
This commit is contained in:
parent
73026b6565
commit
6bbb4cfef4
|
@ -92,7 +92,7 @@ public class ReactorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() {
|
public void givenFlux_whenInParalle_shouldSubscribeInDifferentThreads() throws InterruptedException {
|
||||||
List<Integer> elements = new ArrayList<>();
|
List<Integer> elements = new ArrayList<>();
|
||||||
|
|
||||||
Flux.just(1, 2, 3, 4)
|
Flux.just(1, 2, 3, 4)
|
||||||
|
@ -101,6 +101,8 @@ public class ReactorTest {
|
||||||
.subscribeOn(Schedulers.parallel())
|
.subscribeOn(Schedulers.parallel())
|
||||||
.subscribe(elements::add);
|
.subscribe(elements::add);
|
||||||
|
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
assertThat(elements).containsExactly(2, 4, 6, 8);
|
assertThat(elements).containsExactly(2, 4, 6, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue