/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. Don't forget to 'watch' * it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. Don't forget to 'watch' * it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Assert that the given ActorRef is Terminated within the specified time. * Don't forget to 'watch' it first! */ public Terminated expectTerminated(Duration max, ActorRef target) { return p.expectTerminated(target, max); }
/** * Same as {@link JavaTestKit#expectTerminated(ActorRef)}. * * @param target The actor expected to terminate. * @return The status of termination. */ public Terminated expectTerminated(ActorRef target) { return testProbe.expectTerminated(target, Duration.Undefined()); }
@Test public void testRecoveryAfterRestartSaveSnapshotFail() { system.stop(mockedActor); mockedActor = system.actorOf(MockedActor.props(id, initialBehavior)); probe.watch(mockedActor); probe.expectMsgClass(MockedSnapshotStore.LoadRequest.class); probe.reply(Optional.empty()); probe.expectMsgClass(MockedSnapshotStore.SaveRequest.class); probe.reply(new RuntimeException("save failed")); probe.expectMsgClass(MockedSnapshotStore.DeleteByMetadataRequest.class); probe.expectTerminated(mockedActor, TIMEOUT); }
@Test public void testRecoveryAfterRestartFrontendIdMismatch() { system.stop(mockedActor); //start actor again mockedActor = system.actorOf(MockedActor.props(id, initialBehavior)); probe.expectMsgClass(MockedSnapshotStore.LoadRequest.class); //offer snapshot with incorrect client id final SnapshotMetadata metadata = saveRequest.getMetadata(); final FrontendIdentifier anotherFrontend = FrontendIdentifier.create(MemberName.forName("another"), FrontendType.forName("type-2")); final ClientIdentifier incorrectClientId = ClientIdentifier.create(anotherFrontend, 0); probe.watch(mockedActor); probe.reply(Optional.of(new SelectedSnapshot(metadata, incorrectClientId))); //actor should be stopped probe.expectTerminated(mockedActor, TIMEOUT); }