Skip navigation links
Mockito 2.28.0 API
A B C D E F G H I L M N O P R S T U V W 

I

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...) - 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.
Incubating - Annotation Type in org.mockito
The annotation conveys following information: The API is fairly new and we would appreciate your feedback.
initMocks(Object) - Static method in class org.mockito.MockitoAnnotations
Initializes objects annotated with Mockito annotations for given testClass: @Mock, @Spy, @Captor, @InjectMocks
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 interface org.mockito.session.MockitoSessionBuilder
Adds the test class instances for initialization of fields annotated with Mockito annotations like Mock.
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 - Annotation Type in org.mockito
Mark a field on which injection should be performed.
InjectMocksException - Exception in org.mockito.exceptions.misusing
Thrown when creation of test subject annotated with InjectMocks fails.
InjectMocksException(String, Throwable) - Constructor for exception org.mockito.exceptions.misusing.InjectMocksException
 
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 - Interface in org.mockito
Allows verification in order.
inOrder(Object...) - Static method in class org.mockito.Mockito
Creates InOrder object that allows verifying mocks in order.
InstantiationException - Exception in org.mockito.creation.instance
Exception generated when Instantiator.newInstance(Class) failed.
InstantiationException(String, Throwable) - Constructor for exception org.mockito.creation.instance.InstantiationException
 
Instantiator - Interface in org.mockito.creation.instance
Provides instances of classes.
InstantiatorProvider - Interface in org.mockito.plugins
Deprecated.
since 2.15.4 because this internal class was leaking from the public API. For more information why deprecated, see InstantiatorProvider2 and Issue 1303

Mockito will invoke this interface in order to fetch an instance instantiator provider.

By default, an internal byte-buddy/asm/objenesis based implementation is used.

Using the extension point

The plugin mechanism of mockito works in a similar way as the ServiceLoader, however instead of looking in the META-INF directory, Mockito will look in mockito-extensions directory. The reason for that is that Android SDK strips jar from the META-INF directory when creating an APK.

  1. The implementation itself, for example org.awesome.mockito.AwesomeInstantiatorProvider that implements the InstantiatorProvider.
  2. A file "mockito-extensions/org.mockito.plugins.InstantiatorProvider". The content of this file is exactly a one line with the qualified name: org.awesome.mockito.AwesomeInstantiatorProvider.

Note that if several mockito-extensions/org.mockito.plugins.InstantiatorProvider files exists in the classpath, Mockito will only use the first returned by the standard ClassLoader.getResource(java.lang.String) mechanism.

So just create a custom implementation of InstantiatorProvider and place the qualified name in the following file mockito-extensions/org.mockito.plugins.InstantiatorProvider.

This class is deprecated and was replaced by InstantiatorProvider2. Hence if there is both a mockito-extensions/org.mockito.plugins.InstantiatorProvider and mockito-extensions/org.mockito.plugins.InstantiatorProvider2 the second one takes preference.

InstantiatorProvider2 - Interface in org.mockito.plugins
Mockito will invoke this interface in order to fetch an instance instantiator provider.
intThat(ArgumentMatcher<Integer>) - Static method in class org.mockito.ArgumentMatchers
Allows creating custom int argument matchers.
intThat(Matcher<Integer>) - Static method in class org.mockito.hamcrest.MockitoHamcrest
Enables integrating hamcrest matchers that match primitive int arguments.
InvalidUseOfMatchersException - Exception in org.mockito.exceptions.misusing
 
InvalidUseOfMatchersException(String) - Constructor for exception org.mockito.exceptions.misusing.InvalidUseOfMatchersException
 
InvalidUseOfMatchersException() - Constructor for exception org.mockito.exceptions.misusing.InvalidUseOfMatchersException
 
Invocation - Interface in org.mockito.invocation
A method call on a mock object.
InvocationContainer - Interface in org.mockito.invocation
Although this class is a part of public API, please don't provide your own implementations.
InvocationFactory - Interface in org.mockito.invocation
InvocationFactory.RealMethodBehavior<R> - Interface in org.mockito.invocation
Behavior of the real method.
InvocationListener - Interface in org.mockito.listeners
This listener can be notified of method invocations on a mock.
invocationListeners(InvocationListener...) - Method in interface org.mockito.MockSettings
Registers a listener for method invocations on this mock.
InvocationOnMock - Interface in org.mockito.invocation
An invocation on a mock.
isA(Class<T>) - Static method in class org.mockito.ArgumentMatchers
Object argument that implements the given class.
isDefault() - Method in interface org.mockito.mock.MockName
default name means generated by Mockito.
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).
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.
isLenient() - Method in interface org.mockito.mock.MockCreationSettings
Informs if the mock was created with "lenient" strictness, e.g.
isMock() - Method in interface org.mockito.MockingDetails
Informs if the object is a mock.
isNotNull() - Static method in class org.mockito.ArgumentMatchers
Not null argument.
isNotNull(Class<T>) - Static method in class org.mockito.ArgumentMatchers
Deprecated.
With Java 8 this method will be removed in Mockito 3.0. This method is only used for generic friendliness to avoid casting, this is not anymore needed in Java 8.
isNull() - Static method in class org.mockito.ArgumentMatchers
null argument.
isNull(Class<T>) - Static method in class org.mockito.ArgumentMatchers
Deprecated.
With Java 8 this method will be removed in Mockito 3.0. This method is only used for generic friendliness to avoid casting, this is not anymore needed in Java 8.
isSerializable() - Method in interface org.mockito.mock.MockCreationSettings
if the mock is serializable, see MockSettings.serializable().
isSpy() - Method in interface org.mockito.MockingDetails
Informs if the object is a spy.
isStripAnnotations() - Method in interface org.mockito.mock.MockCreationSettings
Whether the mock should not make a best effort to preserve annotations.
isStubOnly() - Method in interface org.mockito.mock.MockCreationSettings
Whether the mock is only for stubbing, i.e.
isTypeMockable(Class<?>) - Method in interface org.mockito.plugins.MockMaker
Indicates if the given type can be mocked by this mockmaker.
isUsingConstructor() - Method in interface org.mockito.mock.MockCreationSettings
Informs whether the mock instance should be created via constructor
isVerified() - Method in interface org.mockito.invocation.Invocation
 
A B C D E F G H I L M N O P R S T U V W 
Skip navigation links
Mockito 2.28.0 API