Missing Java API: Source.empty
This commit is contained in:
parent
2af9b6bd35
commit
75713c3469
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue