public interface StubbingLookupListener
MockSettings.stubbingLookupListeners(StubbingLookupListener...)
.
This API is used by Mockito to implement PotentialStubbingProblem
(part of Mockito Strictness
).
Details: When method is called on the mock object, Mockito looks for any answer (stubbing) declared on that mock. If the stubbed answer is found, that answer is then invoked (value returned, thrown exception, etc.). If the answer is not found (e.g. that invocation was not stubbed on the mock), mock's default answer is used. This listener implementation is notified when Mockito attempts to find an answer for invocation on a mock.
The listeners can be accessed via MockCreationSettings.getStubbingLookupListeners()
.
Modifier and Type | Method and Description |
---|---|
void |
onStubbingLookup(StubbingLookupEvent stubbingLookupEvent)
Called by the framework when Mockito looked up an answer for invocation on a mock.
|
void onStubbingLookup(StubbingLookupEvent stubbingLookupEvent)
StubbingLookupListener
.stubbingLookupEvent
- - Information about the looked up stubbing