+str #18565 termination notification combinator

This commit is contained in:
Alexander Golubev 2016-01-16 11:46:36 -05:00
parent 4dd6efc6a8
commit 98c72e7d13
9 changed files with 173 additions and 3 deletions

View file

@ -508,6 +508,16 @@ public class FlowTest extends StreamTest {
assertEquals(input, result);
}
@Test
public void mustBeAbleToUseWatchTermination() throws Exception {
final List<String> input = Arrays.asList("A", "B", "C");
Future<Done> future = Source.from(input)
.watchTermination(Keep.<NotUsed, Future<Done>>right())
.to(Sink.ignore()).run(materializer);
assertEquals(Done.getInstance(), Await.result(future, FiniteDuration.create(3, TimeUnit.SECONDS)));
}
@Test
public void mustBeAbleToUseConflate() throws Exception {
final JavaTestKit probe = new JavaTestKit(system);