Support for null in mapAsync and fromCompletionStage #25475

This commit is contained in:
mszczygiel 2019-04-16 09:08:05 +02:00 committed by Johan Andrén
parent 549ccb78a6
commit d4813b91c3
9 changed files with 134 additions and 48 deletions

View file

@ -585,6 +585,15 @@ public class SourceTest extends StreamTest {
assertEquals("A", result);
}
@Test
public void mustWorkFromFutureVoid() throws Exception {
CompletionStage<Void> future = CompletableFuture.completedFuture(null);
CompletionStage<List<Void>> future2 =
Source.fromCompletionStage(future).runWith(Sink.seq(), materializer);
List<Void> result = future2.toCompletableFuture().get(3, TimeUnit.SECONDS);
assertEquals(0, result.size());
}
@Test
public void mustWorkFromRange() throws Exception {
CompletionStage<List<Integer>> f =