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.
      • testActorName

        protected java.lang.String testActorName()
        Description copied from interface: TestKitBase
        Defines the testActor name.
      • 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.
      • forward

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

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

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

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