The arguments passed to this invocation of the spy.
The number of times the spy was invoked.
When the spy was invoked.
true
if the spy was invoked.
Collection of data about each call.
The this
context used for this invocation of the spy.
Calls the specified method when the {@link Spy} is invoked.
The original context, for chaining.
Changes the behaviors for a specific invocation of the Spy.
The index of the call whose behavior should be changed.
The possible behaviors to invoke for this call.
Returns all calls to their default behaviors and clears call history.
Returns the specified value when the {@link Spy} is invoked.
The value to return.
The original context, for chaining.
Throws the specified value when the {@link Spy} is invoked.
The original context, for chaining.
Used to provide custom behaviors at test time to control code flow and ensure code coverage. Can also be used to verify individual call data (args and context) as well as overall invocation counts.