Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- 19. Aliases for behavior driven development (Since 1.8.0) - Search tag in class org.mockito.Mockito
- Section
- 23. Automatic instantiation of Spies, InjectMocks and constructor injection goodness (Since 1.9.0) - Search tag in class org.mockito.Mockito
- Section
- 3. Argument matchers - Search tag in class org.mockito.Mockito
- Section
- 41. Advanced public API for framework integrations (Since 2.10.+) - Search tag in class org.mockito.Mockito
- Section
- 50. Avoiding code generation when only interfaces are mocked (since 3.12.2) - Search tag in class org.mockito.Mockito
- Section
- AbstractAwareMethod - Interface in org.mockito.internal.invocation
- AbstractThrowsException - Class in org.mockito.internal.stubbing.answers
- AbstractThrowsException() - Constructor for class org.mockito.internal.stubbing.answers.AbstractThrowsException
- accept(T) - Method in interface org.mockito.ThrowingConsumer
- acceptThrows(T) - Method in interface org.mockito.ThrowingConsumer
- ACROSS_CLASSLOADERS - Enum constant in enum org.mockito.mock.SerializableMode
-
Useful if the mock is deserialized in a different classloader / vm.
- 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
- add(V) - Method in class org.mockito.internal.util.concurrent.WeakConcurrentSet
- addAll(Collection<?>) - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
- addAnswer(Answer) - Method in class org.mockito.internal.stubbing.StubbedInvocationMatcher
- addAnswer(Answer<?>, boolean, Strictness) - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
-
Adds new stubbed answer and returns the invocation matcher the answer was added to.
- addAnswer(Answer<?>, Strictness) - 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 answers.
- AdditionalMatchers - Class in org.mockito
-
See
ArgumentMatchers
for general info about matchers. - Additional matchers - Search tag in class org.mockito.ArgumentMatchers
- Section
- addListener(MockitoListener) - Method in class org.mockito.internal.framework.DefaultMockitoFramework
- addListener(MockitoListener) - Method in interface org.mockito.internal.progress.MockingProgress
- addListener(MockitoListener) - Method in class org.mockito.internal.progress.MockingProgressImpl
- addListener(MockitoListener) - Method in interface org.mockito.MockitoFramework
-
Adds listener to Mockito.
- 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
-
Verification will be triggered after given amount of millis, allowing testing of async code.
- 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
- AllInvocationsFinder - Class in org.mockito.internal.invocation.finder
- 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(ArgumentMatcher<?>, ArgumentMatcher<?>) - Constructor for class org.mockito.internal.matchers.And
- 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.plugins
-
Configures test via annotations.
- AnnotationEngine.NoAction - Class in org.mockito.plugins
- answer() - Element in annotation type org.mockito.Mock
-
Mock will have custom answer, see
MockSettings.defaultAnswer(Answer)
. - answer(A0) - Method in interface org.mockito.stubbing.Answer1
- answer(A0) - Method in interface org.mockito.stubbing.VoidAnswer1
- answer(A0, A1) - Method in interface org.mockito.stubbing.Answer2
- answer(A0, A1) - Method in interface org.mockito.stubbing.VoidAnswer2
- answer(A0, A1, A2) - Method in interface org.mockito.stubbing.Answer3
- answer(A0, A1, A2) - Method in interface org.mockito.stubbing.VoidAnswer3
- answer(A0, A1, A2, A3) - Method in interface org.mockito.stubbing.Answer4
- answer(A0, A1, A2, A3) - Method in interface org.mockito.stubbing.VoidAnswer4
- answer(A0, A1, A2, A3, A4) - Method in interface org.mockito.stubbing.Answer5
- answer(A0, A1, A2, A3, A4) - Method in interface org.mockito.stubbing.VoidAnswer5
- answer(A0, A1, A2, A3, A4, A5) - Method in interface org.mockito.stubbing.Answer6
- answer(A0, A1, A2, A3, A4, A5) - Method in interface org.mockito.stubbing.VoidAnswer6
- answer(InvocationOnMock) - Method in enum org.mockito.Answers
- answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.AbstractThrowsException
- answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.answers.AnswersWithDelay
- 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.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.defaultanswers.TriesToReturnSelf
- answer(InvocationOnMock) - Method in class org.mockito.internal.stubbing.StubbedInvocationMatcher
- answer(InvocationOnMock) - Method in interface org.mockito.stubbing.Answer
- answer(Answer1<T, A>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answer(Answer2<T, A, B>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answer(Answer3<T, A, B, C>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answer(Answer4<T, A, B, C, D>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answer(Answer5<T, A, B, C, D, E>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answer(Answer6<T, A, B, C, D, E, F>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created idiomatically in Java 8
- Answer<T> - Interface in org.mockito.stubbing
-
Generic interface to be used for configuring mock's answer.
- Answer1<T,
A0> - Interface in org.mockito.stubbing -
Generic interface to be used for configuring mock's answer for a single argument invocation.
- Answer2<T,
A0, - Interface in org.mockito.stubbingA1> -
Generic interface to be used for configuring mock's answer for a two argument invocation.
- Answer3<T,
A0, - Interface in org.mockito.stubbingA1, A2> -
Generic interface to be used for configuring mock's answer for a three argument invocation.
- Answer4<T,
A0, - Interface in org.mockito.stubbingA1, A2, A3> -
Generic interface to be used for configuring mock's answer for a four argument invocation.
- Answer5<T,
A0, - Interface in org.mockito.stubbingA1, A2, A3, A4> -
Generic interface to be used for configuring mock's answer for a five argument invocation.
- Answer6<T,
A0, - Interface in org.mockito.stubbingA1, A2, A3, A4, A5> -
Generic interface to be used for configuring mock's answer for a six argument invocation.
- AnswerFunctionalInterfaces - Class in org.mockito.internal.stubbing.answers
-
Functional interfaces to make it easy to implement answers in Java 8
- Answers - Enum in org.mockito
-
Enumeration of pre-configured mock answers
- answersWithDelay(long, Answer<T>) - Static method in class org.mockito.AdditionalAnswers
-
Returns an answer after a delay with a defined length.
- AnswersWithDelay - Class in org.mockito.internal.stubbing.answers
-
Returns as the provided answer would return, after delaying the specified amount.
- AnswersWithDelay(long, Answer<Object>) - Constructor for class org.mockito.internal.stubbing.answers.AnswersWithDelay
- answerVoid(VoidAnswer1<A>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answerVoid(VoidAnswer2<A, B>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answerVoid(VoidAnswer3<A, B, C>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answerVoid(VoidAnswer4<A, B, C, D>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answerVoid(VoidAnswer5<A, B, C, D, E>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8
- answerVoid(VoidAnswer6<A, B, C, D, E, F>) - Static method in class org.mockito.AdditionalAnswers
-
Creates an answer from a functional interface - allows for a strongly typed answer to be created idiomatically in Java 8
- any() - Static method in class org.mockito.ArgumentMatchers
-
Matches anything, including nulls.
- any(Class<T>) - Static method in class org.mockito.ArgumentMatchers
-
Matches any object of given type, excluding nulls.
- Any - Class in org.mockito.internal.matchers
- Any() - Constructor for class org.mockito.internal.matchers.Any
- ANY - Static variable in class org.mockito.internal.matchers.Any
- anyBoolean() - Static method in class org.mockito.ArgumentMatchers
-
Any
boolean
or non-nullBoolean
- anyByte() - Static method in class org.mockito.ArgumentMatchers
-
Any
byte
or non-nullByte
. - anyChar() - Static method in class org.mockito.ArgumentMatchers
-
Any
char
or non-nullCharacter
. - anyCollection() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
Collection
. - anyDouble() - Static method in class org.mockito.ArgumentMatchers
-
Any
double
or non-nullDouble
. - anyFloat() - Static method in class org.mockito.ArgumentMatchers
-
Any
float
or non-nullFloat
. - anyInt() - Static method in class org.mockito.ArgumentMatchers
-
Any int or non-null
Integer
. - anyIterable() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
Iterable
. - anyList() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
List
. - anyLong() - Static method in class org.mockito.ArgumentMatchers
-
Any
long
or non-nullLong
. - anyMap() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
Map
. - anySet() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
Set
. - anyShort() - Static method in class org.mockito.ArgumentMatchers
-
Any
short
or non-nullShort
. - anyString() - Static method in class org.mockito.ArgumentMatchers
-
Any non-null
String
- apply() - Method in class org.mockito.internal.configuration.injection.MockInjection.OngoingMockInjection
- apply() - Method in interface org.mockito.MockedStatic.Verification
-
Apply the verification operation.
- apply(Class<?>, Object, Object[], String[]) - Method in interface org.mockito.internal.creation.bytebuddy.ConstructionCallback
- apply(Statement, Description) - Method in class org.mockito.internal.junit.JUnitTestRule
- apply(Statement, Description) - Method in class org.mockito.internal.junit.VerificationCollectorImpl
- apply(Statement, FrameworkMethod, Object) - Method in class org.mockito.internal.junit.JUnitRule
- apply(ArgumentMatcher<?>, Object) - Method in interface org.mockito.internal.invocation.ArgumentMatcherAction
-
Implementations must apply the given matcher to the argument and return
true
if the operation was successful orfalse
if not. - apply(ArgumentMatcher, Object) - Method in class org.mockito.internal.invocation.TypeSafeMatching
- approximateSize() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap
-
Returns the approximate size of this map where the returned number is at least as big as the actual number of entries.
- approximateSize() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap.WithInlinedExpunction
- approximateSize() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentSet
-
Returns the approximate size of this set where the returned number is at least as big as the actual number of entries.
- areEqual(Object, Object) - Static method in class org.mockito.internal.matchers.Equality
- areSameMocks(Object, Object) - Static method in class org.mockito.internal.util.MockUtil
- argThat(Matcher<T>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
-
Allows matching arguments with hamcrest matchers.
- argThat(Matcher<T>, Class<T>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
-
Allows matching arguments with hamcrest matchers.
- argThat(ArgumentMatcher<T>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom argument matchers.
- ArgumentCaptor<T> - Class in org.mockito
-
Use it to capture argument values for further assertions.
- ArgumentMatcher<T> - Interface in org.mockito
-
Allows creating customized argument matchers.
- ArgumentMatcherAction - Interface in org.mockito.internal.invocation
- ArgumentMatchers - Class in org.mockito
-
Allow flexible verification or stubbing.
- ArgumentMatchers() - Constructor for class org.mockito.ArgumentMatchers
- 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
- arguments() - Method in interface org.mockito.MockedConstruction.Context
-
Get the arguments that were passed to the constructor.
- argumentsAreDifferent(Invocation, MatchableInvocation, String, List<String>, List<Location>) - Static method in class org.mockito.internal.exceptions.Reporter
- ArgumentsAreDifferent - Exception Class in org.mockito.exceptions.verification
- ArgumentsAreDifferent - Exception Class in org.mockito.exceptions.verification.junit
- ArgumentsAreDifferent - Exception Class in org.mockito.exceptions.verification.opentest4j
- ArgumentsAreDifferent(String) - Constructor for exception class org.mockito.exceptions.verification.ArgumentsAreDifferent
- ArgumentsAreDifferent(String, String, String) - Constructor for exception class org.mockito.exceptions.verification.ArgumentsAreDifferent
-
Three-arg constructor for compatibility with ExceptionFactory's three-arg create method.
- ArgumentsAreDifferent(String, String, String) - Constructor for exception class org.mockito.exceptions.verification.junit.ArgumentsAreDifferent
- ArgumentsAreDifferent(String, String, String) - Constructor for exception class org.mockito.exceptions.verification.opentest4j.ArgumentsAreDifferent
- ArgumentsProcessor - Class in org.mockito.internal.invocation
-
by Szczepan Faber, created at: 3/31/12
- 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
- aryEq(boolean[]) - Static method in class org.mockito.AdditionalMatchers
-
boolean 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(char[]) - Static method in class org.mockito.AdditionalMatchers
-
char 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(float[]) - Static method in class org.mockito.AdditionalMatchers
-
float 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(long[]) - Static method in class org.mockito.AdditionalMatchers
-
long 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(T[]) - Static method in class org.mockito.AdditionalMatchers
-
Object array argument that is equal to the given array, i.e.
- assertArg(Consumer<T>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom argument matchers where matching is considered successful when the consumer given by parameter does not throw an exception.
- assertArg(ThrowingConsumer<T>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom argument matchers where matching is considered successful when the consumer given by parameter does not throw an exception.
- assertLazily() - Method in class org.mockito.internal.junit.VerificationCollectorImpl
- assertLazily() - Method in interface org.mockito.junit.VerificationCollector
-
Enforce all verifications are performed lazily.
- atLeast(int) - Static method in class org.mockito.internal.verification.VerificationModeFactory
- atLeast(int) - Method in class org.mockito.internal.verification.VerificationWrapper
- 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 - Class in org.mockito.internal.verification
- AtLeast(int) - Constructor for class org.mockito.internal.verification.AtLeast
- 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() - Method in class org.mockito.internal.verification.VerificationWrapper
- 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.
- AtLeastXNumberOfInvocationsChecker - Class in org.mockito.internal.verification.checkers
- atMost(int) - Static method in class org.mockito.internal.verification.VerificationModeFactory
- atMost(int) - Method in class org.mockito.internal.verification.VerificationWrapper
- 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 - Class in org.mockito.internal.verification
- AtMost(int) - Constructor for class org.mockito.internal.verification.AtMost
- atMostAndNeverShouldNotBeUsedWithTimeout() - Static method in class org.mockito.internal.exceptions.Reporter
- atMostOnce() - Static method in class org.mockito.internal.verification.VerificationModeFactory
- atMostOnce() - Method in class org.mockito.internal.verification.VerificationWrapper
- atMostOnce() - Static method in class org.mockito.Mockito
-
Allows at-most-once verification.
- atMostOnce() - Method in interface org.mockito.verification.VerificationAfterDelay
-
Verifies that there is most 1 invocation during the given period.
- AutoCleanableListener - Interface in org.mockito.internal.listeners
-
Listener that is automatically cleaned up (removed from the the global list of subscribers).
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form