convert watchTermination to CompletionStage for Java
This commit is contained in:
parent
41d8b1fadd
commit
d49d2545ec
3 changed files with 7 additions and 7 deletions
|
|
@ -490,11 +490,11 @@ public class FlowTest extends StreamTest {
|
|||
@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())
|
||||
CompletionStage<Done> future = Source.from(input)
|
||||
.watchTermination(Keep.right())
|
||||
.to(Sink.ignore()).run(materializer);
|
||||
|
||||
assertEquals(Done.getInstance(), Await.result(future, FiniteDuration.create(3, TimeUnit.SECONDS)));
|
||||
assertEquals(Done.getInstance(), future.toCompletableFuture().get(3, TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue