describeMismatch

invoke

Invokes the expectation: records that the invocation has
occurred and fakes some behaviour in response.

Parameters:

invocation - The invocation to record and fake.

Returns:

A result that is eventually returned from the method call
that caused the invocation.

Throws:

Throwable - An exception that is eventually thrown from the method call
that caused the invocation.

IllegalStateException - The expectation has been invoked with a method that it doesn't
match or the faked behaviour has been set up incorrectly.
For example, IllegalStateException is thrown when trying to return
a value or throw a checked exception that is incompatible with the
return type of the method being mocked