Evaluate the given assert every interval
until it does not throw an exception and return the
result.
Evaluate the given assert every interval
until it does not throw an exception and return the
result.
If the max
timeout expires the last exception is thrown.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "akka.test.timefactor".
Receive one message from the test actor and assert that it equals the given object.
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionError being thrown in case of timeout.
the received object
Receive one message from the test actor and assert that it equals the given object.
Receive one message from the test actor and assert that it equals the given object. Wait time is bounded by the given duration, with an AssertionError being thrown in case of timeout.
the received object
Same as expectMessage(remainingOrDefault, obj)
, but correctly treating the timeFactor.
INTERNAL API
INTERNAL API
Assert that no message is received.
Assert that no message is received. Waits for the default period configured as akka.actor.testkit.typed.expect-no-message-default
That value is dilated.
Assert that no message is received for the specified time.
Assert that no message is received for the specified time. Supplied value is not dilated.
Expect the given actor to be stopped or stop withing the given timeout or throw an AssertionError.
INTERNAL API
INTERNAL API
Obtain time remaining for execution of the innermost enclosing within
block or throw an AssertionError if no within
block surrounds this
call.
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the given duration.
Obtain time remaining for execution of the innermost enclosing within
block or missing that it returns the properly dilated default for this
case from settings (key "akka.actor.testkit.typed.single-expect-default").
ActorRef for this TestProbe
INTERNAL API
INTERNAL API
Evaluate the given assert every 100 milliseconds until it does not throw an exception and return the result.
Evaluate the given assert every 100 milliseconds until it does not throw an exception and return the
result. A max time is taken it from the innermost enclosing within
block.
Evaluate the given assert every 100 milliseconds until it does not throw an exception and return the result.
Evaluate the given assert every 100 milliseconds until it does not throw an exception and return the result.
If the max
timeout expires the last exception is thrown.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "akka.test.timefactor".
Wait for a message of type M and return it when it arrives, or fail if the max
timeout is hit.
Wait for a message of type M and return it when it arrives, or fail if the max
timeout is hit.
The timeout is dilated.
Same as expectMessageType(clazz, remainingOrDefault)
, but correctly treating the timeFactor.
Same as the other fishForMessageJava
but includes the provided hint in all error messages
Java API: Allows for flexible matching of multiple messages within a timeout, the fisher function is fed each incoming message, and returns one of the following effects to decide on what happens next:
Java API: Allows for flexible matching of multiple messages within a timeout, the fisher function is fed each incoming message, and returns one of the following effects to decide on what happens next:
* FishingOutcomes.continue() - continue with the next message given that the timeout has not been reached * FishingOutcomes.complete() - successfully complete and return the message * FishingOutcomes.fail(errorMsg) - fail the test with a custom message
Additionally failures includes the list of messages consumed. If a message of type M
but not of type T
is
received this will also fail the test, additionally if the fisher
function throws a match error the error
is decorated with some fishing details and the test is failed (making it convenient to use this method with a
partial function).
Max total time without the fisher function returning CompleteFishing
before failing
The timeout is dilated.
The messages accepted in the order they arrived
ActorRef for this TestProbe
Same as calling within(0 seconds, max)(f)
.
Execute code block while bounding its execution time between min
and
max
.
Execute code block while bounding its execution time between min
and
max
. within
blocks may be nested. All methods in this trait which
take maximum wait times are available in a version which implicitly uses
the remaining time governed by the innermost enclosing within
block.
Note that the timeout is scaled using Duration.dilated, which uses the configuration entry "akka.actor.testkit.typed.timefactor", while the min Duration is not.
val ret = within(50 millis) { test ! Ping expectMessageType[Pong] }
Java API: * Create instances through the
create
factories in the TestProbe companion.A test probe is essentially a queryable mailbox which can be used in place of an actor and the received messages can then be asserted etc.
Not for user extension