Mockito 2.0.23-beta API
A B C D E F G H I J L M N O P R S T U V W 

A

AbstractAwareMethod - Interface in org.mockito.internal.invocation
 
AccessibilityChanger - Class in org.mockito.internal.util.reflection
 
AccessibilityChanger() - Constructor for class org.mockito.internal.util.reflection.AccessibilityChanger
 
actualParameterizedType(Object) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs
 
actualTypeArguments() - Method in class org.mockito.internal.util.reflection.GenericMetadataSupport
 
add(Object) - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
add(Object) - Method in class org.mockito.internal.util.collections.IdentitySet
 
add(Invocation) - Method in class org.mockito.internal.verification.DefaultRegisteredInvocations
 
add(Invocation) - Method in interface org.mockito.internal.verification.RegisteredInvocations
 
add(Invocation) - Method in class org.mockito.internal.verification.SingleRegisteredInvocation
 
addAll(Collection<?>) - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
 
addAnswer(Answer) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
 
addAnswer(Answer, boolean) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
 
addAnswer(Answer) - Method in class org.mockito.internal.stubbing.StubbedInvocationMatcher
 
addAnswerForVoidMethod(Answer) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
 
addConsecutiveAnswer(Answer) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
 
AdditionalAnswers - Class in org.mockito
Additional answers provides factory methods for less common answers.
AdditionalAnswers() - Constructor for class org.mockito.AdditionalAnswers
 
AdditionalMatchers - Class in org.mockito
See Matchers for general info about matchers.
AdditionalMatchers() - Constructor for class org.mockito.AdditionalMatchers
 
addPreparedMocks(Set<Object>) - Method in class org.mockito.internal.configuration.injection.scanner.MockScanner
Add the scanned and prepared mock instance to the given collection.
addTo(Set<Field>) - Method in class org.mockito.internal.configuration.injection.scanner.InjectMocksScanner
Add the fields annotated by @InjectMocks
after(long) - Static method in class org.mockito.Mockito
Allows verifying over a given period.
After - Class in org.mockito.verification
See the javadoc for VerificationAfterDelay
After(long, VerificationMode) - Constructor for class org.mockito.verification.After
See the javadoc for VerificationAfterDelay
allDeclaredFieldsOf(Object) - Static method in class org.mockito.internal.util.reflection.Fields
Instance fields declared in the class and superclasses of the given instance.
AllInvocationsFinder - Class in org.mockito.internal.invocation.finder
 
AllInvocationsFinder() - Constructor for class org.mockito.internal.invocation.finder.AllInvocationsFinder
 
and(boolean, boolean) - Static method in class org.mockito.AdditionalMatchers
boolean argument that matches both given matchers.
and(byte, byte) - Static method in class org.mockito.AdditionalMatchers
byte argument that matches both given argument matchers.
and(char, char) - Static method in class org.mockito.AdditionalMatchers
char argument that matches both given argument matchers.
and(double, double) - Static method in class org.mockito.AdditionalMatchers
double argument that matches both given argument matchers.
and(float, float) - Static method in class org.mockito.AdditionalMatchers
float argument that matches both given argument matchers.
and(int, int) - Static method in class org.mockito.AdditionalMatchers
int argument that matches both given argument matchers.
and(long, long) - Static method in class org.mockito.AdditionalMatchers
long argument that matches both given argument matchers.
and(short, short) - Static method in class org.mockito.AdditionalMatchers
short argument that matches both given argument matchers.
and(T, T) - Static method in class org.mockito.AdditionalMatchers
Object argument that matches both given argument matchers.
And - Class in org.mockito.internal.matchers
 
And(List<ArgumentMatcher>) - Constructor for class org.mockito.internal.matchers.And
 
annotatedBy(Class<? extends Annotation>...) - Static method in class org.mockito.internal.util.reflection.Fields
Accept fields annotated by the given annotations.
annotation(Class<A>) - Method in class org.mockito.internal.util.reflection.InstanceField
Returns the annotation instance for the given annotation type.
AnnotationEngine - Interface in org.mockito.configuration
Configures mock creation logic behind @Mock, @Captor and @Spy annotations
answer(InvocationOnMock) - Method in enum org.mockito.Answers
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.AnswerReturnValuesAdapter
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.CallsRealMethods
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.ClonesArguments
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.DoesNothing
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.Returns
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.ReturnsArgumentAt
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.ReturnsElementsOf
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.ThrowsException
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.ThrowsExceptionClass
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ForwardsInvocations
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.GloballyConfiguredAnswer
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsEmptyValues
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsMocks
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsMoreEmptyValues
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.defaultanswers.ReturnsSmartNulls
 
answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.StubbedInvocationMatcher
 
Answer<T> - Interface in org.mockito.stubbing
Generic interface to be used for configuring mock's answer.
answer(InvocationOnMock) - Method in interface org.mockito.stubbing.Answer
 
AnswerReturnValuesAdapter - Class in org.mockito.internal.stubbing.answers
 
AnswerReturnValuesAdapter(ReturnValues) - Constructor for class org.mockito.internal.stubbing.answers.AnswerReturnValuesAdapter
 
Answers - Enum in org.mockito
Enumeration of pre-configured mock answers
Answers - Enum in org.mockito.internal.stubbing.defaultanswers
Deprecated.
- please use Answers from top Mockito package: Answers

WARNING Those answers no longer are used by the framework!!! Please use Answers

See Mockito for more information.

AnswersValidator - Class in org.mockito.internal.stubbing.answers
 
AnswersValidator() - Constructor for class org.mockito.internal.stubbing.answers.AnswersValidator
 
Any - Class in org.mockito.internal.matchers
 
ANY - Static variable in class org.mockito.internal.matchers.Any
 
any(Class<T>) - Static method in class org.mockito.Matchers
Matches any object, including nulls
any() - Static method in class org.mockito.Matchers
Matches anything, including nulls
ANY_VARARG - Static variable in class org.mockito.internal.matchers.AnyVararg
 
anyBoolean() - Static method in class org.mockito.Matchers
Any boolean or non-null Boolean
anyByte() - Static method in class org.mockito.Matchers
Any byte or non-null Byte.
anyChar() - Static method in class org.mockito.Matchers
Any char or non-null Character.
anyCollection() - Static method in class org.mockito.Matchers
Any non-null Collection.
anyCollectionOf(Class<T>) - Static method in class org.mockito.Matchers
Generic friendly alias to Matchers.anyCollection().
anyDouble() - Static method in class org.mockito.Matchers
Any double or non-null Double.
anyFloat() - Static method in class org.mockito.Matchers
Any float or non-null Float.
anyInt() - Static method in class org.mockito.Matchers
Any int or non-null Integer.
anyList() - Static method in class org.mockito.Matchers
Any non-null List.
anyListOf(Class<T>) - Static method in class org.mockito.Matchers
Generic friendly alias to Matchers.anyList().
anyLong() - Static method in class org.mockito.Matchers
Any long or non-null Long.
anyMap() - Static method in class org.mockito.Matchers
Any non-null Map.
anyMapOf(Class<K>, Class<V>) - Static method in class org.mockito.Matchers
Generic friendly alias to Matchers.anyMap().
anyObject() - Static method in class org.mockito.Matchers
Matches anything, including null.
anySet() - Static method in class org.mockito.Matchers
Any non-null Set.
anySetOf(Class<T>) - Static method in class org.mockito.Matchers
Generic friendly alias to Matchers.anySet().
anyShort() - Static method in class org.mockito.Matchers
Any short or non-null Short.
anyString() - Static method in class org.mockito.Matchers
Any non-null String
AnyVararg - Class in org.mockito.internal.matchers
 
AnyVararg() - Constructor for class org.mockito.internal.matchers.AnyVararg
 
anyVararg() - Static method in class org.mockito.Matchers
Any vararg, meaning any number and values of arguments.
appendWarnings(Failure, String) - Method in class org.mockito.internal.util.junit.JUnitFailureHacker
 
apply() - Method in class org.mockito.internal.configuration.injection.MockInjection.OngoingMockInjection
 
apply(Statement, Object) - Method in class org.mockito.internal.junit.JUnitRule
 
apply(Statement, FrameworkMethod, Object) - Method in class org.mockito.junit.MockitoJUnitRule
Deprecated.
 
areEqual(Object, Object) - Static method in class org.mockito.internal.matchers.Equality
 
argThat(Matcher<T>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
Allows matching arguments with hamcrest matchers.
argThat(ArgumentMatcher<T>) - Static method in class org.mockito.Matchers
Allows creating custom argument matchers.
ArgumentCaptor<T> - Class in org.mockito
Use it to capture argument values for further assertions.
ArgumentCaptor() - Constructor for class org.mockito.ArgumentCaptor
Deprecated.
Please use factory method ArgumentCaptor.forClass(Class) to create captors

This is required to avoid NullPointerExceptions when autoUnboxing primitive types. See issue 99.

Example:


   ArgumentCaptor<Person> argument = ArgumentCaptor.forClass(Person.class);
   verify(mock).doSomething(argument.capture());
   assertEquals("John", argument.getValue().getName());
 
ArgumentMatcher<T> - Interface in org.mockito
Allows creating customized argument matchers.
ArgumentMatcherStorage - Interface in org.mockito.internal.progress
 
ArgumentMatcherStorageImpl - Class in org.mockito.internal.progress
 
ArgumentMatcherStorageImpl() - Constructor for class org.mockito.internal.progress.ArgumentMatcherStorageImpl
 
ArgumentMatchingTool - Class in org.mockito.internal.verification.argumentmatching
 
ArgumentMatchingTool() - Constructor for class org.mockito.internal.verification.argumentmatching.ArgumentMatchingTool
 
argumentsAreDifferent(String, String, Location) - Method in class org.mockito.exceptions.Reporter
 
ArgumentsAreDifferent - Error in org.mockito.exceptions.verification
 
ArgumentsAreDifferent(String) - Constructor for error org.mockito.exceptions.verification.ArgumentsAreDifferent
 
ArgumentsAreDifferent - Error in org.mockito.exceptions.verification.junit
 
ArgumentsAreDifferent(String, String, String) - Constructor for error org.mockito.exceptions.verification.junit.ArgumentsAreDifferent
 
ArgumentsComparator - Class in org.mockito.internal.invocation
 
ArgumentsComparator() - Constructor for class org.mockito.internal.invocation.ArgumentsComparator
 
argumentsMatch(InvocationMatcher, Invocation) - Method in class org.mockito.internal.invocation.ArgumentsComparator
 
argumentsMatch(InvocationMatcher, Object[]) - Method in class org.mockito.internal.invocation.ArgumentsComparator
 
ArgumentsProcessor - Class in org.mockito.internal.invocation
by Szczepan Faber, created at: 3/31/12
ArgumentsProcessor() - Constructor for class org.mockito.internal.invocation.ArgumentsProcessor
 
argumentsToMatchers(Object[]) - Static method in class org.mockito.internal.invocation.ArgumentsProcessor
 
ArrayEquals - Class in org.mockito.internal.matchers
 
ArrayEquals(Object) - Constructor for class org.mockito.internal.matchers.ArrayEquals
 
ArrayUtils - Class in org.mockito.internal.util.collections
 
ArrayUtils() - Constructor for class org.mockito.internal.util.collections.ArrayUtils
 
aryEq(T[]) - Static method in class org.mockito.AdditionalMatchers
Object array argument that is equal to the given array, i.e.
aryEq(short[]) - Static method in class org.mockito.AdditionalMatchers
short array argument that is equal to the given array, i.e.
aryEq(long[]) - Static method in class org.mockito.AdditionalMatchers
long array argument that is equal to the given array, i.e.
aryEq(int[]) - Static method in class org.mockito.AdditionalMatchers
int array argument that is equal to the given array, i.e.
aryEq(float[]) - Static method in class org.mockito.AdditionalMatchers
float array argument that is equal to the given array, i.e.
aryEq(double[]) - Static method in class org.mockito.AdditionalMatchers
double array argument that is equal to the given array, i.e.
aryEq(char[]) - Static method in class org.mockito.AdditionalMatchers
char array argument that is equal to the given array, i.e.
aryEq(byte[]) - Static method in class org.mockito.AdditionalMatchers
byte array argument that is equal to the given array, i.e.
aryEq(boolean[]) - Static method in class org.mockito.AdditionalMatchers
boolean array argument that is equal to the given array, i.e.
assignedValues() - Method in class org.mockito.internal.util.reflection.Fields.InstanceFields
 
AtLeast - Class in org.mockito.internal.verification
 
AtLeast(int) - Constructor for class org.mockito.internal.verification.AtLeast
 
atLeast(int) - Static method in class org.mockito.internal.verification.VerificationModeFactory
 
atLeast(int) - Static method in class org.mockito.Mockito
Allows at-least-x verification.
atLeast(int) - Method in interface org.mockito.verification.VerificationAfterDelay
Verifies that there is are least N invocations during the given period.
atLeast(int) - Method in interface org.mockito.verification.VerificationWithTimeout
Allows at-least-x verification within given timeout.
atLeast(int) - Method in class org.mockito.verification.VerificationWrapper
 
AtLeastDiscrepancy - Class in org.mockito.internal.verification.checkers
 
AtLeastDiscrepancy(int, int) - Constructor for class org.mockito.internal.verification.checkers.AtLeastDiscrepancy
 
atLeastOnce() - Static method in class org.mockito.internal.verification.VerificationModeFactory
 
atLeastOnce() - Static method in class org.mockito.Mockito
Allows at-least-once verification.
atLeastOnce() - Method in interface org.mockito.verification.VerificationAfterDelay
Verifies that there is at least 1 invocation during the given period.
atLeastOnce() - Method in interface org.mockito.verification.VerificationWithTimeout
Allows at-least-once verification within given timeout.
atLeastOnce() - Method in class org.mockito.verification.VerificationWrapper
 
AtLeastXNumberOfInvocationsChecker - Class in org.mockito.internal.verification.checkers
 
AtLeastXNumberOfInvocationsChecker() - Constructor for class org.mockito.internal.verification.checkers.AtLeastXNumberOfInvocationsChecker
 
AtLeastXNumberOfInvocationsInOrderChecker - Class in org.mockito.internal.verification.checkers
 
AtLeastXNumberOfInvocationsInOrderChecker(InOrderContext) - Constructor for class org.mockito.internal.verification.checkers.AtLeastXNumberOfInvocationsInOrderChecker
 
AtMost - Class in org.mockito.internal.verification
 
AtMost(int) - Constructor for class org.mockito.internal.verification.AtMost
 
atMost(int) - Static method in class org.mockito.internal.verification.VerificationModeFactory
 
atMost(int) - Static method in class org.mockito.Mockito
Allows at-most-x verification.
atMost(int) - Method in class org.mockito.verification.Timeout
 
atMost(int) - Method in interface org.mockito.verification.VerificationAfterDelay
Verifies that there is are most N invocations during the given period.
atMost(int) - Method in interface org.mockito.verification.VerificationWithTimeout
Deprecated.
Deprecated Validation with timeout combined with never simply does not make sense, as atMost() will typically immediately pass, and therefore not wait the timeout. The behaviour you may be looking for is actually provided by after().atMost().

To avoid compilation errors upon upgrade the method is deprecated and it throws a "friendly reminder" exception.

In a future release we will remove timeout(x).atMost(y) and timeout(x).never() from the API.

Do you want to find out more? See issue 235

atMost(int) - Method in class org.mockito.verification.VerificationWrapper
 
atMostAndNeverShouldNotBeUsedWithTimeout() - Method in class org.mockito.exceptions.Reporter
 
A B C D E F G H I J L M N O P R S T U V W 
Mockito 2.0.23-beta API