Package org.mockito.internal.junit
Class DefaultStubbingLookupListener
- java.lang.Object
-
- org.mockito.internal.junit.DefaultStubbingLookupListener
-
- All Implemented Interfaces:
java.io.Serializable
,StubbingLookupListener
class DefaultStubbingLookupListener extends java.lang.Object implements StubbingLookupListener, java.io.Serializable
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 Modifier and Type Field Description private Strictness
currentStrictness
private boolean
mismatchesReported
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description DefaultStubbingLookupListener(Strictness strictness)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
isMismatchesReported()
Indicates that stubbing argument mismatch was reportedvoid
onStubbingLookup(StubbingLookupEvent event)
Called by the framework when Mockito looked up an answer for invocation on a mock.private static java.util.List<Invocation>
potentialArgMismatches(Invocation invocation, java.util.Collection<Stubbing> stubbings)
(package private) void
setCurrentStrictness(Strictness currentStrictness)
Enables resetting the strictness to desired level
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
currentStrictness
private Strictness currentStrictness
-
mismatchesReported
private boolean mismatchesReported
-
-
Constructor Detail
-
DefaultStubbingLookupListener
DefaultStubbingLookupListener(Strictness strictness)
-
-
Method Detail
-
onStubbingLookup
public void onStubbingLookup(StubbingLookupEvent event)
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 java.util.List<Invocation> potentialArgMismatches(Invocation invocation, java.util.Collection<Stubbing> stubbings)
-
setCurrentStrictness
void setCurrentStrictness(Strictness currentStrictness)
Enables resetting the strictness to desired level
-
isMismatchesReported
boolean isMismatchesReported()
Indicates that stubbing argument mismatch was reported
-
-