The original behavior that might be overwritten. It is always possible to restore this behavior
Function that will be called independently of the current active behavior type parameter A:
Applies the current behavior, and invokes the callback.
Applies the current behavior, and invokes the callback.
The parameters of this behavior.
The result of this behavior wrapped in a future.
Restores the previous behavior.
Changes the current behavior to the provided one.
Changes the current behavior to the provided one.
Function that takes a parameter type A and returns a Future[B].
Changes the behavior to return a completed future with the given constant value.
Changes the behavior to return a completed future with the given constant value.
The constant the future will be completed with.
Enables control of the completion of the previously active behavior.
Enables control of the completion of the previously active behavior. Wraps the previous behavior in a new one, returns a control promise that starts the original behavior after the control promise is completed.
A promise, which delays the completion of the original future until after this promise is completed.
Changes the current behavior to return a failed future containing the given Throwable.
Changes the current behavior to return a failed future containing the given Throwable.
The throwable the failed future will contain.
Test utility to make behavior of functions that return some Future[B] controllable from tests. This tool is able to overwrite default behavior with any generic behavior, including failure, and exposes control to the timing of the completion of the returned future.
The utility is implemented as a stack of behaviors, where the behavior on the top of the stack represents the currently active behavior. The bottom of the stack always contains the defaultBehavior which can not be popped out.