org.mockito.listeners
@Incubating public interface StubbingListener
Implementations are not required to be thread safe. Your implementation will be wrapped with a thread safe delegator when you register this listener.
Modifier and Type | Method and Description |
---|---|
void |
newStubbing(Invocation stubbing)
New stubbing event, some method on a mock is being stubbed now.
|
void |
stubbingNotFound(Invocation actual)
Method is called on a mock, but there is no stubbed behavior registered for this invocation.
|
void |
usedStubbing(Invocation stubbing,
Invocation actual)
New stubbing 'used' event, some existing stubbing on a mock is being realized now.
|
void newStubbing(Invocation stubbing)
void usedStubbing(Invocation stubbing, Invocation actual)
void stubbingNotFound(Invocation actual)
Warning: due to the nature of when() style of stubbing, 'stubbingNotFound' is also triggered during standard stubbing with when(). Example:
when(mock.foo()).thenReturn(1); // <-- 'stubbingNotFound' is triggered for 'mock.foo()'