Merge pull request #19498 from agolubev/agolubev-#18565-TerminationNotification-combinator

+str #18565 termination notification combinator
This commit is contained in:
drewhk 2016-01-25 10:52:48 +01:00
commit 41d8b1fadd
9 changed files with 173 additions and 3 deletions

View file

@ -487,6 +487,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);