Package akka.actor.testkit.typed.javadsl
Class TestInbox<T>
- java.lang.Object
-
- akka.actor.testkit.typed.javadsl.TestInbox<T>
-
public abstract class TestInbox<T> extends java.lang.ObjectUtility for use as anActorRefwhen *synchronously* testingBehaviorwithBehaviorTestKit.If you plan to use a real
ActorSystemthen useTestProbefor asynchronous testing.Use
TestInbox.createfactory methods to create instancesNot for user extension
-
-
Constructor Summary
Constructors Constructor Description TestInbox()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T> TestInbox<T>create()static <T> TestInbox<T>create(java.lang.String name)abstract TestInbox<T>expectMessage(T expectedMessage)Assert and remove the the oldest message.java.util.List<T>getAllReceived()Collect all messages in the inbox and clear it outabstract ActorRef<T>getRef()The actor ref of the inboxabstract booleanhasMessages()protected abstract scala.collection.immutable.Seq<T>internalReceiveAll()abstract TreceiveMessage()Get and remove the oldest message
-
-
-
Method Detail
-
create
public static <T> TestInbox<T> create(java.lang.String name)
-
create
public static <T> TestInbox<T> create()
-
receiveMessage
public abstract T receiveMessage()
Get and remove the oldest message
-
expectMessage
public abstract TestInbox<T> expectMessage(T expectedMessage)
Assert and remove the the oldest message.
-
getAllReceived
public java.util.List<T> getAllReceived()
Collect all messages in the inbox and clear it out
-
internalReceiveAll
protected abstract scala.collection.immutable.Seq<T> internalReceiveAll()
-
hasMessages
public abstract boolean hasMessages()
-
-