Missing Java API: Source.empty

This commit is contained in:
Seeta Ramayya 2019-01-07 15:02:24 +01:00 committed by Johan Andrén
parent 2af9b6bd35
commit 75713c3469
2 changed files with 14 additions and 1 deletions

View file

@ -770,6 +770,14 @@ public class SourceTest extends StreamTest {
future.toCompletableFuture().get(3, TimeUnit.SECONDS);
}
@Test
public void createEmptySource() throws Exception {
List<Integer> actual = Source.empty(Integer.class)
.runWith(Sink.seq(), materializer)
.toCompletableFuture().get();
assertThat(actual, is(Collections.emptyList()));
}
@Test
public void cycleSourceMustGenerateSameSequenceInRepeatedFashion() throws Exception {
//#cycle
@ -781,7 +789,7 @@ public class SourceTest extends StreamTest {
}
@Test(expected = IllegalArgumentException.class)
public void cycleSourceMustThr() throws Throwable {
public void cycleSourceMustThrow() throws Throwable {
try {
//#cycle-error