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.Object
Utility for use as anActorRef
when *synchronously* testingBehavior
withBehaviorTestKit
.If you plan to use a real
ActorSystem
then useTestProbe
for asynchronous testing.Use
TestInbox.create
factory 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 boolean
hasMessages()
protected abstract scala.collection.immutable.Seq<T>
internalReceiveAll()
abstract T
receiveMessage()
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()
-
-