Bael 679 reactive streams (#1978)

* BAEL-679 code for reactive streams

* BAEL-679 typo

* BAEL-679 awaitility
This commit is contained in:
Tomasz Lelek 2017-06-02 21:42:30 +02:00 committed by Grzegorz Piwowarek
parent af40bd48f0
commit 49ce027993
2 changed files with 18 additions and 6 deletions

View File

@ -47,6 +47,13 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -90,6 +97,7 @@
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<awaitility.version>1.7.0</awaitility.version>
</properties>
</project>

View File

@ -24,8 +24,10 @@ public class ReactiveStreamsTest {
publisher.close();
//then
Thread.sleep(1000);
assertThat(subscriber.consumedElements).containsExactlyElementsOf(items);
await().atMost(1000, TimeUnit.MILLISECONDS).until(
() -> assertThat(subscriber.consumedElements).containsExactlyElementsOf(items)
);
}
@Test
@ -44,8 +46,9 @@ public class ReactiveStreamsTest {
publisher.close();
//then
Thread.sleep(1000);
assertThat(subscriber.consumedElements).containsExactlyElementsOf(expectedResult);
await().atMost(1000, TimeUnit.MILLISECONDS).until(
() -> assertThat(subscriber.consumedElements).containsExactlyElementsOf(expectedResult)
);
}
@Test
@ -63,7 +66,8 @@ public class ReactiveStreamsTest {
publisher.close();
//then
Thread.sleep(1000);
assertThat(subscriber.consumedElements).containsExactlyElementsOf(expected);
await().atMost(1000, TimeUnit.MILLISECONDS).until(
() -> assertThat(subscriber.consumedElements).containsExactlyElementsOf(expected)
);
}
}