Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
I
- 40. Improved productivity and cleaner tests with "stricter" Mockito (Since 2.+) - Search tag in class org.mockito.Mockito
- Section
- IdentitySet - Class in org.mockito.internal.util.collections
- IdentitySet() - Constructor for class org.mockito.internal.util.collections.IdentitySet
- ignoreForVerification() - Method in class org.mockito.internal.invocation.InterceptedInvocation
- ignoreForVerification() - Method in interface org.mockito.invocation.Invocation
-
Configures this invocation to be ignored for verify-no-more-invocations or verification in order.
- ignoreStubs(Object...) - Method in class org.mockito.internal.MockitoCore
- ignoreStubs(Object...) - Static method in class org.mockito.Mockito
-
Ignores stubbed methods of given mocks for the sake of verification.
- IMockitoConfiguration - Interface in org.mockito.configuration
-
Use it to configure Mockito.
- Important gotcha on spying real objects! - Search tag in annotation type org.mockito.Spy
- Section
- Important gotcha on spying real objects! - Search tag in class org.mockito.Mockito
- Section
- Important gotcha on spying real objects! - Search tag in org.mockito.Mockito.spy(T)
- Section
- incorrectUseOfAdditionalMatchers(String, int, Collection<LocalizedMatcher>) - Static method in class org.mockito.internal.exceptions.Reporter
- incorrectUseOfApi() - Static method in class org.mockito.internal.exceptions.Reporter
- Incubating - Annotation Type in org.mockito
-
The annotation conveys following information: The API is fairly new and we would appreciate your feedback.
- IndependentAnnotationEngine - Class in org.mockito.internal.configuration
- IndependentAnnotationEngine() - Constructor for class org.mockito.internal.configuration.IndependentAnnotationEngine
- inferFrom(Type) - Static method in class org.mockito.internal.util.reflection.GenericMetadataSupport
-
Create an new instance of
GenericMetadataSupport
inferred from aType
. - inheritValue(T) - Method in class org.mockito.internal.util.concurrent.DetachedThreadLocal
- initialize() - Method in class org.mockito.internal.util.reflection.FieldInitializer
-
Initialize field if not initialized and return the actual instance.
- initialValue(Thread) - Method in class org.mockito.internal.util.concurrent.DetachedThreadLocal
- initMocks(Object) - Method in class org.mockito.internal.session.DefaultMockitoSessionBuilder
- initMocks(Object) - Static method in class org.mockito.MockitoAnnotations
-
Deprecated.
- initMocks(Object) - Method in interface org.mockito.session.MockitoSessionBuilder
-
Adds the test class instance for initialization of fields annotated with Mockito annotations like
Mock
. - initMocks(Object...) - Method in class org.mockito.internal.session.DefaultMockitoSessionBuilder
- initMocks(Object...) - Method in interface org.mockito.session.MockitoSessionBuilder
-
Adds the test class instances for initialization of fields annotated with Mockito annotations like
Mock
. - InjectingAnnotationEngine - Class in org.mockito.internal.configuration
- InjectingAnnotationEngine() - Constructor for class org.mockito.internal.configuration.InjectingAnnotationEngine
- InjectionBase - Class in org.mockito.codegen
-
This class is required to resolve a method handle lookup for the
org.mockito.codegen
package what requires a preexisting class for the package. - injectMocks(Object) - Method in class org.mockito.internal.configuration.InjectingAnnotationEngine
-
Deprecated.Use
InjectingAnnotationEngine.injectCloseableMocks(Object)
. - InjectMocks - Annotation Type in org.mockito
-
Mark a field on which injection should be performed.
- InjectMocksException - Exception Class in org.mockito.exceptions.misusing
-
Thrown when creation of test subject annotated with InjectMocks fails.
- InjectMocksException(String, Throwable) - Constructor for exception class org.mockito.exceptions.misusing.InjectMocksException
- injectMocksOnFields(Set<Field>, Set<Object>, Object) - Method in class org.mockito.internal.configuration.DefaultInjectionEngine
- InjectMocksScanner - Class in org.mockito.internal.configuration.injection.scanner
-
Scan field for injection.
- InjectMocksScanner(Class<?>) - Constructor for class org.mockito.internal.configuration.injection.scanner.InjectMocksScanner
-
Create a new InjectMocksScanner for the given clazz on the given instance
- INLINE - Enum constant in enum org.mockito.internal.util.concurrent.DetachedThreadLocal.Cleaner
- INLINE - Enum constant in enum org.mockito.internal.util.concurrent.WeakConcurrentSet.Cleaner
- INLINE - Static variable in class org.mockito.MockMakers
-
Inline mock maker which can mock final types, enums and final methods.
- InlineByteBuddyMockMaker - Class in org.mockito.internal.creation.bytebuddy
- InlineByteBuddyMockMaker() - Constructor for class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
- InlineBytecodeGenerator - Class in org.mockito.internal.creation.bytebuddy
- InlineBytecodeGenerator(Instrumentation, WeakConcurrentMap<Object, MockMethodInterceptor>, DetachedThreadLocal<Map<Class<?>, MockMethodInterceptor>>, Predicate<Class<?>>, ConstructionCallback) - Constructor for class org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator
- inlineClassWithoutUnboxImpl(Class<?>, Exception) - Static method in class org.mockito.internal.exceptions.Reporter
- InlineMockMaker - Interface in org.mockito.plugins
-
Extension to
MockMaker
for mock makers that changes inline method implementations and need keep track of created mock objects. - inOrder(Object...) - Method in class org.mockito.internal.MockitoCore
- inOrder(Object...) - Static method in class org.mockito.Mockito
-
Creates
InOrder
object that allows verifying mocks in order. - InOrder - Interface in org.mockito
-
Allows verification in order.
- InOrderContext - Interface in org.mockito.internal.verification.api
- InOrderContextImpl - Class in org.mockito.internal.verification
- InOrderContextImpl() - Constructor for class org.mockito.internal.verification.InOrderContextImpl
- InOrderImpl - Class in org.mockito.internal
-
Allows verifying in order.
- InOrderImpl(List<?>) - Constructor for class org.mockito.internal.InOrderImpl
- inOrderRequiresFamiliarMock() - Static method in class org.mockito.internal.exceptions.Reporter
- InOrderWrapper - Class in org.mockito.internal.verification
- InOrderWrapper(VerificationInOrderMode, InOrderImpl) - Constructor for class org.mockito.internal.verification.InOrderWrapper
- INSTANCE - Enum constant in enum org.mockito.internal.invocation.RealMethod.IsIllegal
- INSTANCE - Enum constant in enum org.mockito.mock.MockType
-
Mock created as an instance of the mocked type
- InstanceField - Class in org.mockito.internal.util.reflection
-
Represents an accessible instance field.
- InstanceField(Field, Object) - Constructor for class org.mockito.internal.util.reflection.InstanceField
-
Create a new InstanceField.
- InstanceOf - Class in org.mockito.internal.matchers
- InstanceOf(Class<?>) - Constructor for class org.mockito.internal.matchers.InstanceOf
- InstanceOf(Class<?>, String) - Constructor for class org.mockito.internal.matchers.InstanceOf
- InstantiationException - Exception Class in org.mockito.creation.instance
-
Exception generated when
Instantiator.newInstance(Class)
failed. - InstantiationException(String) - Constructor for exception class org.mockito.creation.instance.InstantiationException
- InstantiationException(String, Throwable) - Constructor for exception class org.mockito.creation.instance.InstantiationException
- Instantiator - Interface in org.mockito.creation.instance
-
Provides instances of classes.
- InstantiatorProvider2 - Interface in org.mockito.plugins
-
Mockito will invoke this interface in order to fetch an instance instantiator provider.
- interceptAbstract(Object, MockMethodInterceptor, Object, Method, Object[]) - Static method in class org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.DispatcherDefaultingToRealMethod
- InterceptedInvocation - Class in org.mockito.internal.invocation
- InterceptedInvocation(MockReference<Object>, MockitoMethod, Object[], RealMethod, Location, int) - Constructor for class org.mockito.internal.invocation.InterceptedInvocation
- interceptSuperCallable(Object, MockMethodInterceptor, Method, Object[], Callable<?>) - Static method in class org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.DispatcherDefaultingToRealMethod
- interfaceBounds() - Method in interface org.mockito.internal.util.reflection.GenericMetadataSupport.BoundedType
- interfaceBounds() - Method in class org.mockito.internal.util.reflection.GenericMetadataSupport.TypeVarBoundedType
-
On a Type Variable (typeVar extends C_0 & I_1 & I_2 & etc), will return an array containing I_1 and I_2.
- interfaceBounds() - Method in class org.mockito.internal.util.reflection.GenericMetadataSupport.WildCardBoundedType
- InternalRunner - Interface in org.mockito.internal.runners
-
I'm using this surrogate interface to hide internal Runner implementations.
- intThat(Matcher<Integer>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
-
Enables integrating hamcrest matchers that match primitive
int
arguments. - intThat(ArgumentMatcher<Integer>) - Static method in class org.mockito.ArgumentMatchers
-
Allows creating custom
int
argument matchers. - invalidArgumentPositionRangeAtInvocationTime(InvocationOnMock, boolean, int) - Static method in class org.mockito.internal.exceptions.Reporter
- invalidArgumentRangeAtIdentityAnswerCreationTime() - Static method in class org.mockito.internal.exceptions.Reporter
- invalidUseOfMatchers(int, List<LocalizedMatcher>) - Static method in class org.mockito.internal.exceptions.Reporter
- InvalidUseOfMatchersException - Exception Class in org.mockito.exceptions.misusing
- InvalidUseOfMatchersException() - Constructor for exception class org.mockito.exceptions.misusing.InvalidUseOfMatchersException
- InvalidUseOfMatchersException(String) - Constructor for exception class org.mockito.exceptions.misusing.InvalidUseOfMatchersException
- Invocation - Interface in org.mockito.invocation
-
A method call on a mock object.
- InvocationComparator - Class in org.mockito.internal.invocation
-
Compares invocations based on the sequence number
- InvocationComparator() - Constructor for class org.mockito.internal.invocation.InvocationComparator
- InvocationContainer - Interface in org.mockito.invocation
-
Although this class is a part of public API, please don't provide your own implementations.
- InvocationContainerImpl - Class in org.mockito.internal.stubbing
- InvocationContainerImpl(MockCreationSettings<?>) - Constructor for class org.mockito.internal.stubbing.InvocationContainerImpl
- InvocationFactory - Interface in org.mockito.invocation
-
Available via
MockitoFramework.getInvocationFactory()
. - InvocationFactory.RealMethodBehavior<R> - Interface in org.mockito.invocation
-
Behavior of the real method.
- InvocationInfo - Class in org.mockito.internal.stubbing.answers
- InvocationInfo(InvocationOnMock) - Constructor for class org.mockito.internal.stubbing.answers.InvocationInfo
- InvocationListener - Interface in org.mockito.listeners
-
This listener can be notified of method invocations on a mock.
- invocationListeners - Variable in class org.mockito.internal.creation.settings.CreationSettings
- invocationListeners(InvocationListener...) - Method in class org.mockito.internal.creation.MockSettingsImpl
- invocationListeners(InvocationListener...) - Method in interface org.mockito.MockSettings
-
Registers a listener for method invocations on this mock.
- invocationListenerThrewException(InvocationListener, Throwable) - Static method in class org.mockito.internal.exceptions.Reporter
- InvocationMarker - Class in org.mockito.internal.invocation
- InvocationMatcher - Class in org.mockito.internal.invocation
-
In addition to all content of the invocation, the invocation matcher contains the argument matchers.
- InvocationMatcher(Invocation) - Constructor for class org.mockito.internal.invocation.InvocationMatcher
- InvocationMatcher(Invocation, List<ArgumentMatcher>) - Constructor for class org.mockito.internal.invocation.InvocationMatcher
- InvocationOnMock - Interface in org.mockito.invocation
-
An invocation on a mock.
- InvocationsFinder - Class in org.mockito.internal.invocation
- InvocationsPrinter - Class in org.mockito.internal.debugging
-
Prints invocations in human-readable, printable way
- InvocationsPrinter() - Constructor for class org.mockito.internal.debugging.InvocationsPrinter
- invoke() - Method in class org.mockito.internal.invocation.RealMethod.FromBehavior
- invoke() - Method in interface org.mockito.internal.invocation.RealMethod
- invoke() - Method in enum org.mockito.internal.invocation.RealMethod.IsIllegal
- invoke(Method, Object, Object...) - Method in class org.mockito.internal.util.reflection.ModuleMemberAccessor
- invoke(Method, Object, Object...) - Method in class org.mockito.internal.util.reflection.ReflectionMemberAccessor
- invoke(Method, Object, Object...) - Method in interface org.mockito.plugins.MemberAccessor
- invoke(MemberAccessor.ConstructionDispatcher) - Method in interface org.mockito.plugins.MemberAccessor.OnConstruction
- invokedMock() - Method in class org.mockito.internal.stubbing.InvocationContainerImpl
- invokeSuper(Object, Object[]) - Method in interface org.mockito.internal.creation.util.MockitoMethodProxy
- IOUtil - Class in org.mockito.internal.util.io
-
IO utils.
- isA(Class<T>) - Static method in class org.mockito.ArgumentMatchers
-
Object
argument that implements the given class. - isAbstract() - Method in class org.mockito.internal.creation.DelegatingMethod
- isAbstract() - Method in interface org.mockito.internal.invocation.AbstractAwareMethod
- isAbstract() - Method in class org.mockito.internal.invocation.SerializableMethod
- isAbstract() - Method in class org.mockito.internal.stubbing.answers.InvocationInfo
- isAndroid() - Static method in class org.mockito.internal.util.Platform
- isAndroidMockMakerRequired() - Static method in class org.mockito.internal.util.Platform
- isAnnotatedBy(Class<? extends Annotation>) - Method in class org.mockito.internal.util.reflection.InstanceField
-
Check if the field is annotated by the given annotation.
- isAssignableFromWrapper(Class<?>, Class<?>) - Static method in class org.mockito.internal.util.Primitives
- isClosed() - Method in class org.mockito.internal.MockedConstructionImpl
- isClosed() - Method in class org.mockito.internal.MockedStaticImpl
- isClosed() - Method in interface org.mockito.ScopedMock
-
Checks if this mock is closed.
- isCompareToMethod(Method) - Static method in class org.mockito.internal.util.ObjectMethodsGuru
- isCompatibleTypes(Type, Type, Field) - Method in class org.mockito.internal.configuration.injection.filter.TypeBasedCandidateFilter
- isConstructorMock(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isConstructorMock(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.MockMethodAdvice
- isConstructorMock(String, Class<?>) - Static method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isCounting() - Method in class org.mockito.internal.util.Timer
-
Informs whether the timer is still counting down.
- isDeclaredOnInterface() - Method in class org.mockito.internal.stubbing.answers.InvocationInfo
- isDefault() - Method in class org.mockito.internal.util.MockNameImpl
- isDefault() - Method in interface org.mockito.mock.MockName
-
default name means generated by Mockito.
- isDisrespectingOpenness() - Method in interface org.mockito.internal.creation.bytebuddy.SubclassLoader
-
Checks if this loader does not require a module to be open.
- isEmpty() - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
- isEmpty() - Method in class org.mockito.internal.verification.DefaultRegisteredInvocations
- isEmpty() - Method in interface org.mockito.internal.verification.RegisteredInvocations
- isEmpty() - Method in class org.mockito.internal.verification.SingleRegisteredInvocation
- isEnabled(String) - Method in interface org.mockito.plugins.PluginSwitch
-
Mockito invokes this method for every plugin found in the classpath (except from the
PluginSwitch
implementation itself). - isGroovyMethod(boolean) - Static method in interface org.mockito.internal.creation.bytebuddy.BytecodeGenerator
- isIgnoredForVerification() - Method in class org.mockito.internal.invocation.InterceptedInvocation
- isIgnoredForVerification() - Method in interface org.mockito.invocation.Invocation
-
Informs if the invocation participates in verify-no-more-invocations or verification in order.
- isIn(StackTraceElement) - Method in interface org.mockito.exceptions.stacktrace.StackTraceCleaner
-
Decides if element is included.
- isIn(StackTraceElement) - Method in class org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleaner
- isIn(StackTraceCleaner.StackFrameMetadata) - Method in interface org.mockito.exceptions.stacktrace.StackTraceCleaner
-
It's recommended to override this method in subclasses to avoid potentially costly re-boxing operations.
- isIn(StackTraceCleaner.StackFrameMetadata) - Method in class org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleaner
- isInlineClassWithAssignableUnderlyingType(Class<?>, Class<?>) - Static method in class org.mockito.internal.util.KotlinInlineClassUtil
- isInvokable() - Method in class org.mockito.internal.invocation.RealMethod.FromBehavior
- isInvokable() - Method in enum org.mockito.internal.invocation.RealMethod.IsIllegal
- isInvokable() - Method in interface org.mockito.internal.invocation.RealMethod
- isLenient() - Method in class org.mockito.internal.creation.settings.CreationSettings
- isLenient() - Method in interface org.mockito.mock.MockCreationSettings
-
Deprecated.Use
MockCreationSettings.getStrictness()
instead. Informs if the mock was created with "lenient" strictness, e.g. havingStrictness.LENIENT
characteristic. For more information about using mocks with lenient strictness, seeMockSettings.lenient()
. - isListenerDirty() - Method in class org.mockito.internal.junit.UniversalTestListener
- isListenerDirty() - Method in interface org.mockito.internal.listeners.AutoCleanableListener
-
Indicates that the listener is dirty and should be removed from the subscribers
- isMock() - Method in class org.mockito.internal.util.DefaultMockingDetails
- isMock() - Method in interface org.mockito.MockingDetails
-
Informs if the object is a mock.
- isMock(Object) - Method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isMock(Object) - Method in class org.mockito.internal.creation.bytebuddy.MockMethodAdvice
- isMock(Object) - Static method in class org.mockito.internal.util.MockUtil
- isMocked(Object) - Method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isMocked(Object) - Method in class org.mockito.internal.creation.bytebuddy.MockMethodAdvice
- isMockedStatic(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isMockedStatic(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.MockMethodAdvice
- isMultiline() - Method in class org.mockito.internal.reporting.PrintSettings
- isNotNull() - Static method in class org.mockito.ArgumentMatchers
-
Not
null
argument. - isNotNull(Class<T>) - Static method in class org.mockito.ArgumentMatchers
-
Not
null
argument. - isNull() - Static method in class org.mockito.ArgumentMatchers
-
null
argument. - isNull() - Method in class org.mockito.internal.util.reflection.FieldReader
- isNull() - Method in class org.mockito.internal.util.reflection.InstanceField
-
Check that the field is not null.
- isNull(Class<T>) - Static method in class org.mockito.ArgumentMatchers
-
null
argument. - isOverridden(Object, Method) - Method in class org.mockito.internal.creation.bytebuddy.inject.MockMethodDispatcher
- isOverridden(Object, Method) - Method in class org.mockito.internal.creation.bytebuddy.MockMethodAdvice
- isPrimitiveOrWrapper(Class<?>) - Static method in class org.mockito.internal.util.Primitives
-
Indicates if the given class is primitive type or a primitive wrapper.
- isReturnOnSuccess() - Method in class org.mockito.internal.verification.VerificationOverTimeImpl
- isSerializable() - Method in class org.mockito.internal.creation.settings.CreationSettings
- isSerializable() - Method in interface org.mockito.mock.MockCreationSettings
-
if the mock is serializable, see
MockSettings.serializable()
. - isSpy() - Method in class org.mockito.internal.util.DefaultMockingDetails
- isSpy() - Method in interface org.mockito.MockingDetails
-
Informs if the object is a spy.
- isSpy(Object) - Static method in class org.mockito.internal.util.MockUtil
- isStripAnnotations() - Method in class org.mockito.internal.creation.settings.CreationSettings
- isStripAnnotations() - Method in interface org.mockito.mock.MockCreationSettings
-
Whether the mock should not make a best effort to preserve annotations.
- isStubOnly() - Method in class org.mockito.internal.creation.MockSettingsImpl
- isStubOnly() - Method in class org.mockito.internal.creation.settings.CreationSettings
- isStubOnly() - Method in interface org.mockito.mock.MockCreationSettings
-
Whether the mock is only for stubbing, i.e.
- isSuccessful() - Method in class org.mockito.internal.runners.util.FailureDetector
- isSynthetic() - Method in class org.mockito.internal.util.reflection.InstanceField
-
Check if the field is synthetic.
- isToStringMethod(Method) - Static method in class org.mockito.internal.util.ObjectMethodsGuru
- isTypeMockable(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker
- isTypeMockable(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker
- isTypeMockable(Class<?>) - Method in class org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
- isTypeMockable(Class<?>) - Method in class org.mockito.internal.creation.proxy.ProxyMockMaker
- isTypeMockable(Class<?>) - Method in interface org.mockito.plugins.MockMaker
-
Indicates if the given type can be mocked by this mockmaker.
- isUsingConstructor() - Method in class org.mockito.internal.creation.MockSettingsImpl
- isUsingConstructor() - Method in class org.mockito.internal.creation.settings.CreationSettings
- isUsingConstructor() - Method in interface org.mockito.mock.MockCreationSettings
-
Informs whether the mock instance should be created via constructor
- isValidException(Throwable) - Method in class org.mockito.internal.stubbing.answers.InvocationInfo
- isValidReturnType(Class<?>) - Method in class org.mockito.internal.stubbing.answers.InvocationInfo
- isVarArgs() - Method in class org.mockito.internal.creation.DelegatingMethod
- isVarArgs() - Method in interface org.mockito.internal.invocation.MockitoMethod
- isVarArgs() - Method in class org.mockito.internal.invocation.SerializableMethod
- isVerified() - Method in interface org.mockito.internal.exceptions.VerificationAwareInvocation
- isVerified() - Method in class org.mockito.internal.invocation.InterceptedInvocation
- isVerified() - Method in interface org.mockito.invocation.Invocation
- isVerified(Invocation) - Method in class org.mockito.internal.InOrderImpl
- isVerified(Invocation) - Method in interface org.mockito.internal.verification.api.InOrderContext
- isVerified(Invocation) - Method in class org.mockito.internal.verification.InOrderContextImpl
- isVoid() - Method in class org.mockito.internal.stubbing.answers.InvocationInfo
- Iterables - Class in org.mockito.internal.util.collections
-
Utilities for Iterables
- iterator() - Method in class org.mockito.internal.util.collections.HashCodeAndEqualsSafeSet
- iterator() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap
- iterator() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentMap.WithInlinedExpunction
- iterator() - Method in class org.mockito.internal.util.concurrent.WeakConcurrentSet
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
MockitoAnnotations.openMocks(Object)
instead. This method is equivalent toopenMocks(testClass).close()
. The close method should however only be called after completed usage oftestClass
. If using static-mocks or customMockMaker
s, using this method might cause misbehavior of mocks injected into the test class.