Class TestInbox<T>
java.lang.Object
org.apache.pekko.actor.testkit.typed.javadsl.TestInbox<T>
Utility for use as an
ActorRef when *synchronously* testing pekko.actor.typed.Behavior
with pekko.actor.testkit.typed.javadsl.BehaviorTestKit.
If you plan to use a real pekko.actor.typed.ActorSystem then use pekko.actor.testkit.typed.javadsl.TestProbe
for asynchronous testing.
Use TestInbox.create factory methods to create instances
Not for user extension
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TestInbox<T>create()static <T> TestInbox<T>expectMessage(T expectedMessage) Assert and remove the the oldest message.Collect all messages in the inbox and clear it outgetRef()The actor ref of the inboxabstract booleanprotected abstract scala.collection.immutable.Seq<T>abstract TGet and remove the oldest message
-
Constructor Details
-
TestInbox
public TestInbox()
-
-
Method Details
-
create
-
create
-
getRef
The actor ref of the inbox -
receiveMessage
Get and remove the oldest message -
expectMessage
Assert and remove the the oldest message. -
getAllReceived
Collect all messages in the inbox and clear it out -
internalReceiveAll
-
hasMessages
public abstract boolean hasMessages()
-