use of akka.actor.ActorSystem in project flink by apache.
the class SupervisorActorTest method completesTerminationFutureIfActorStops.
@Test
public void completesTerminationFutureIfActorStops() {
final ActorSystem actorSystem = actorSystemResource.getActorSystem();
final ActorRef supervisor = SupervisorActor.startSupervisorActor(actorSystem, actorSystem.getDispatcher());
final SupervisorActor.ActorRegistration actorRegistration = startAkkaRpcActor(supervisor, "foobar");
final CompletableFuture<Void> terminationFuture = actorRegistration.getTerminationFuture();
assertThat(terminationFuture.isDone(), is(false));
actorRegistration.getActorRef().tell(TerminateWithFutureCompletion.normal(), ActorRef.noSender());
terminationFuture.join();
}
Aggregations