Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see
Mockito class for usage. |
org.mockito.internal.hamcrest | |
org.mockito.internal.invocation |
Invocation machinery and related classes.
|
org.mockito.internal.matchers |
Argument matchers for verification and stubbing.
|
org.mockito.internal.matchers.apachecommons |
Argument matchers that use Apache Commons Lang reflection-equality.
|
org.mockito.internal.matchers.text | |
org.mockito.internal.progress |
Mocking progress stateful classes.
|
org.mockito.internal.reporting |
Deals with nicely printing verification errors.
|
org.mockito.internal.verification.argumentmatching |
Deals with matching arguments.
|
org.mockito.invocation |
Public API related to mock method invocations.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
ArgumentMatchers.argThat(ArgumentMatcher<T> matcher)
Allows creating custom argument matchers.
|
static boolean |
ArgumentMatchers.booleanThat(ArgumentMatcher<java.lang.Boolean> matcher)
Allows creating custom
boolean argument matchers. |
static byte |
ArgumentMatchers.byteThat(ArgumentMatcher<java.lang.Byte> matcher)
Allows creating custom
byte argument matchers. |
static char |
ArgumentMatchers.charThat(ArgumentMatcher<java.lang.Character> matcher)
Allows creating custom
char argument matchers. |
static double |
ArgumentMatchers.doubleThat(ArgumentMatcher<java.lang.Double> matcher)
Allows creating custom
double argument matchers. |
static float |
ArgumentMatchers.floatThat(ArgumentMatcher<java.lang.Float> matcher)
Allows creating custom
float argument matchers. |
static int |
ArgumentMatchers.intThat(ArgumentMatcher<java.lang.Integer> matcher)
Allows creating custom
int argument matchers. |
static long |
ArgumentMatchers.longThat(ArgumentMatcher<java.lang.Long> matcher)
Allows creating custom
long argument matchers. |
private static void |
ArgumentMatchers.reportMatcher(ArgumentMatcher<?> matcher) |
private static void |
AdditionalMatchers.reportMatcher(ArgumentMatcher<?> matcher) |
static short |
ArgumentMatchers.shortThat(ArgumentMatcher<java.lang.Short> matcher)
Allows creating custom
short argument matchers. |
Modifier and Type | Class and Description |
---|---|
class |
HamcrestArgumentMatcher<T> |
Modifier and Type | Field and Description |
---|---|
private java.util.List<ArgumentMatcher<?>> |
InvocationMatcher.matchers |
private java.util.List<ArgumentMatcher<?>> |
MatcherApplicationStrategy.matchers |
Modifier and Type | Method and Description |
---|---|
private static ArgumentMatcher<?> |
MatcherApplicationStrategy.lastMatcher(java.util.List<ArgumentMatcher<?>> matchers) |
Modifier and Type | Method and Description |
---|---|
private static java.util.List<ArgumentMatcher<?>> |
MatcherApplicationStrategy.appendLastMatcherNTimes(java.util.List<ArgumentMatcher<?>> matchers,
int timesToAppendLastMatcher) |
static java.util.List<ArgumentMatcher> |
ArgumentsProcessor.argumentsToMatchers(java.lang.Object[] arguments) |
java.util.List<ArgumentMatcher> |
InvocationMatcher.getMatchers() |
Modifier and Type | Method and Description |
---|---|
boolean |
ArgumentMatcherAction.apply(ArgumentMatcher<?> matcher,
java.lang.Object argument)
Implementations must apply the given matcher to the argument and return
true if the operation was successful or false
if not. |
boolean |
TypeSafeMatching.apply(ArgumentMatcher matcher,
java.lang.Object argument) |
private static java.lang.Class<?> |
TypeSafeMatching.getArgumentType(ArgumentMatcher<?> argumentMatcher)
Returns the type of
matches(Object) of the given
ArgumentMatcher implementation. |
private static boolean |
TypeSafeMatching.isCompatible(ArgumentMatcher<?> argumentMatcher,
java.lang.Object argument)
Returns
true if the given argument can be passed to
the given argumentMatcher without causing a
ClassCastException . |
Modifier and Type | Method and Description |
---|---|
private static java.util.List<ArgumentMatcher<?>> |
MatcherApplicationStrategy.appendLastMatcherNTimes(java.util.List<ArgumentMatcher<?>> matchers,
int timesToAppendLastMatcher) |
static MatcherApplicationStrategy |
MatcherApplicationStrategy.getMatcherApplicationStrategyFor(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers)
Returns the
MatcherApplicationStrategy that must be used to capture the
arguments of the given invocation using the given matchers. |
private static MatcherApplicationStrategy.MatcherApplicationType |
MatcherApplicationStrategy.getMatcherApplicationType(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers) |
private static boolean |
MatcherApplicationStrategy.isLastMatcherVarargMatcher(java.util.List<ArgumentMatcher<?>> matchers) |
private static ArgumentMatcher<?> |
MatcherApplicationStrategy.lastMatcher(java.util.List<ArgumentMatcher<?>> matchers) |
Constructor and Description |
---|
InvocationMatcher(Invocation invocation,
java.util.List<ArgumentMatcher> matchers) |
MatcherApplicationStrategy(Invocation invocation,
java.util.List<ArgumentMatcher<?>> matchers,
MatcherApplicationStrategy.MatcherApplicationType matchingType) |
Modifier and Type | Class and Description |
---|---|
class |
And |
class |
Any |
class |
ArrayEquals |
class |
CapturingMatcher<T> |
class |
CompareEqual<T extends java.lang.Comparable<T>> |
class |
CompareTo<T extends java.lang.Comparable<T>> |
class |
Contains |
class |
EndsWith |
class |
Equals |
class |
EqualsWithDelta |
class |
Find |
class |
GreaterOrEqual<T extends java.lang.Comparable<T>> |
class |
GreaterThan<T extends java.lang.Comparable<T>> |
class |
InstanceOf |
static class |
InstanceOf.VarArgAware |
class |
LessOrEqual<T extends java.lang.Comparable<T>> |
class |
LessThan<T extends java.lang.Comparable<T>> |
class |
Matches |
class |
Not |
class |
NotNull |
class |
Null |
class |
Or |
class |
Same |
class |
StartsWith |
Modifier and Type | Field and Description |
---|---|
private ArgumentMatcher |
And.m1 |
private ArgumentMatcher |
Or.m1 |
private ArgumentMatcher |
And.m2 |
private ArgumentMatcher |
Or.m2 |
private ArgumentMatcher<?> |
LocalizedMatcher.matcher |
private ArgumentMatcher |
Not.matcher |
Modifier and Type | Method and Description |
---|---|
ArgumentMatcher<?> |
LocalizedMatcher.getMatcher() |
Constructor and Description |
---|
And(ArgumentMatcher<?> m1,
ArgumentMatcher<?> m2) |
And(ArgumentMatcher<?> m1,
ArgumentMatcher<?> m2) |
LocalizedMatcher(ArgumentMatcher<?> matcher) |
Not(ArgumentMatcher<?> matcher) |
Or(ArgumentMatcher<?> m1,
ArgumentMatcher<?> m2) |
Or(ArgumentMatcher<?> m1,
ArgumentMatcher<?> m2) |
Modifier and Type | Class and Description |
---|---|
class |
ReflectionEquals |
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
MatcherToString.toString(ArgumentMatcher<?> matcher)
Attempts to provide more descriptive toString() for given matcher.
|
Modifier and Type | Method and Description |
---|---|
private java.util.Iterator<FormattedText> |
MatchersPrinter.applyPrintSettings(java.util.List<ArgumentMatcher> matchers,
PrintSettings printSettings) |
java.lang.String |
MatchersPrinter.getArgumentsBlock(java.util.List<ArgumentMatcher> matchers,
PrintSettings printSettings) |
java.lang.String |
MatchersPrinter.getArgumentsLine(java.util.List<ArgumentMatcher> matchers,
PrintSettings printSettings) |
Modifier and Type | Method and Description |
---|---|
private ArgumentMatcher<?> |
ArgumentMatcherStorageImpl.popMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
ArgumentMatcherStorage.reportMatcher(ArgumentMatcher<?> matcher) |
void |
ArgumentMatcherStorageImpl.reportMatcher(ArgumentMatcher<?> matcher) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
PrintSettings.print(java.util.List<ArgumentMatcher> matchers,
Invocation invocation) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
ArgumentMatchingTool.safelyMatches(ArgumentMatcher m,
java.lang.Object arg) |
private static boolean |
ArgumentMatchingTool.toStringEquals(ArgumentMatcher m,
java.lang.Object arg) |
Modifier and Type | Method and Description |
---|---|
static java.lang.Integer[] |
ArgumentMatchingTool.getSuspiciouslyNotMatchingArgsIndexes(java.util.List<ArgumentMatcher> matchers,
java.lang.Object[] arguments)
Suspiciously not matching arguments are those that don't match, the toString() representation is the same but types are different.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ArgumentMatcher> |
MatchableInvocation.getMatchers()
The argument matchers of this invocation.
|