Fixed failing reactive test

This commit is contained in:
Andrew Morgan 2017-02-22 20:36:42 +00:00
parent 73026b6565
commit 6bbb4cfef4
1 changed files with 3 additions and 1 deletions

View File

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