19452: Contramap and fromFunction
This commit is contained in:
parent
d9b47c3a8d
commit
6c69fba61e
8 changed files with 71 additions and 3 deletions
|
|
@ -803,6 +803,15 @@ public class FlowTest extends StreamTest {
|
|||
assertEquals((Object) 0, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldBePossibleToCreateFromFunction() throws Exception {
|
||||
List<Integer> out = Source.range(0, 2).via(Flow.fromFunction((Integer x) -> x + 1))
|
||||
.runWith(Sink.seq(), materializer).toCompletableFuture().get(3, TimeUnit.SECONDS);
|
||||
|
||||
assertEquals(Arrays.asList(1, 2, 3), out);
|
||||
|
||||
}
|
||||
|
||||
public void mustSuitablyOverrideAttributeHandlingMethods() {
|
||||
@SuppressWarnings("unused")
|
||||
final Flow<Integer, Integer, NotUsed> f =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue