chore: Add collect operator test for stream javadsl. (#963)
This commit is contained in:
parent
7c82c2a1c4
commit
d313eef0a9
1 changed files with 14 additions and 0 deletions
|
|
@ -948,6 +948,20 @@ public class FlowTest extends StreamTest {
|
||||||
probe.expectMsgEquals("2C");
|
probe.expectMsgEquals("2C");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void mustBeAbleToUseCollect() {
|
||||||
|
Source.from(Arrays.asList(1, 2, 3, 4, 5))
|
||||||
|
.collect(
|
||||||
|
PFBuilder.<Integer, Integer>create()
|
||||||
|
.match(Integer.class, elem -> elem % 2 != 0, elem -> elem)
|
||||||
|
.build())
|
||||||
|
.runWith(TestSink.create(system), system)
|
||||||
|
.ensureSubscription()
|
||||||
|
.request(5)
|
||||||
|
.expectNext(1, 3, 5)
|
||||||
|
.expectComplete();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mustBeAbleToUseCollectType() throws Exception {
|
public void mustBeAbleToUseCollectType() throws Exception {
|
||||||
final TestKit probe = new TestKit(system);
|
final TestKit probe = new TestKit(system);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue