Package org.mockito.internal.junit
Class DefaultStubbingLookupListener
java.lang.Object
org.mockito.internal.junit.DefaultStubbingLookupListener
- All Implemented Interfaces:
Serializable
,StubbingLookupListener
Default implementation of stubbing lookup listener.
Fails early if stub called with unexpected arguments, but only if current strictness is set to STRICT_STUBS.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Indicates that stubbing argument mismatch was reportedvoid
Called by the framework when Mockito looked up an answer for invocation on a mock.private static List<Invocation>
potentialArgMismatches
(Invocation invocation, Collection<Stubbing> stubbings) (package private) void
setCurrentStrictness
(Strictness currentStrictness) Enables resetting the strictness to desired level
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
currentStrictness
-
mismatchesReported
private boolean mismatchesReported
-
-
Constructor Details
-
DefaultStubbingLookupListener
DefaultStubbingLookupListener(Strictness strictness)
-
-
Method Details
-
onStubbingLookup
Description copied from interface:StubbingLookupListener
Called by the framework when Mockito looked up an answer for invocation on a mock. For details, seeStubbingLookupListener
.- Specified by:
onStubbingLookup
in interfaceStubbingLookupListener
- Parameters:
event
- - Information about the looked up stubbing
-
potentialArgMismatches
private static List<Invocation> potentialArgMismatches(Invocation invocation, Collection<Stubbing> stubbings) -
setCurrentStrictness
Enables resetting the strictness to desired level -
isMismatchesReported
boolean isMismatchesReported()Indicates that stubbing argument mismatch was reported
-