Package akka.testkit

Class TestProbe

  • All Implemented Interfaces:
    TestKitBase

    public class TestProbe
    extends TestKit
    TestKit-based probe which allows sending, reception and reply.
    • Constructor Detail

      • TestProbe

        public TestProbe​(ActorSystem _application,
                         java.lang.String name)
      • TestProbe

        public TestProbe​(ActorSystem _application)
    • Method Detail

      • ref

        public ActorRef ref()
        Shorthand to get the testActor.
        Returns:
        (undocumented)
      • testActorName

        protected java.lang.String testActorName()
        Description copied from interface: TestKitBase
        Defines the testActor name.
        Returns:
        (undocumented)
      • send

        public void send​(ActorRef actor,
                         java.lang.Object msg)
        Send message to an actor while using the probe's TestActor as the sender. Replies will be available for inspection with all of TestKit's assertion methods.
        Parameters:
        actor - (undocumented)
        msg - (undocumented)
      • forward

        public void forward​(ActorRef actor,
                            java.lang.Object msg)
        Forward this message as if in the TestActor's receive method with self.forward.
        Parameters:
        actor - (undocumented)
        msg - (undocumented)
      • forward$default$2

        public java.lang.Object forward$default$2()
      • sender

        public ActorRef sender()
        Get sender of last received message.
        Returns:
        (undocumented)
      • reply

        public void reply​(java.lang.Object msg)
        Send message to the sender of the last dequeued message.
        Parameters:
        msg - (undocumented)