Interface TestInbox<T>
public interface 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 factory apply in companion to create instances
Not for user extension
-
Method Summary
Modifier and TypeMethodDescriptionexpectMessage(T expectedMessage) Assert and remove the the oldest message.booleanscala.collection.immutable.Seq<T>scala.collection.immutable.Seq<T>Collect all messages in the inbox and clear it outGet and remove the oldest messageref()The actor ref of the inbox
-
Method Details
-
ref
The actor ref of the inbox -
receiveMessage
T receiveMessage()Get and remove the oldest message -
expectMessage
Assert and remove the the oldest message. -
receiveAll
scala.collection.immutable.Seq<T> receiveAll()Collect all messages in the inbox and clear it out -
internalReceiveAll
scala.collection.immutable.Seq<T> internalReceiveAll() -
hasMessages
boolean hasMessages()
-