Class TestProbe

java.lang.Object
org.apache.pekko.testkit.TestKit
org.apache.pekko.testkit.TestProbe
All Implemented Interfaces:
TestKitBase

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

  • Method Details

    • apply

      public static TestProbe apply(ActorSystem system)
    • apply

      public static TestProbe apply(String name, ActorSystem system)
    • ref

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

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

      public void send(ActorRef actor, 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, Object msg)
      Forward this message as if in the TestActor's receive method with self.forward.
    • forward$default$2

      public Object forward$default$2()
    • sender

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

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