All Classes and Interfaces

Class
Description
Additional answers provides factory methods for answers.
See ArgumentMatchers for general info about matchers.
See the javadoc for VerificationAfterDelay
Configures test via annotations.
 
Generic interface to be used for configuring mock's answer.
Generic interface to be used for configuring mock's answer for a single argument invocation.
Generic interface to be used for configuring mock's answer for a two argument invocation.
Generic interface to be used for configuring mock's answer for a three argument invocation.
Generic interface to be used for configuring mock's answer for a four argument invocation.
Generic interface to be used for configuring mock's answer for a five argument invocation.
Generic interface to be used for configuring mock's answer for a six argument invocation.
Enumeration of pre-configured mock answers
Use it to capture argument values for further assertions.
Allows creating customized argument matchers.
Allow flexible verification or stubbing.
 
 
 
Base interface for stubbing consecutive method calls with Mockito.doReturn(Object) syntax.
Behavior Driven Development style of writing tests uses //given //when //then comments as fundamental parts of your test methods.
See original OngoingStubbing
See original Stubber
Provides fluent way of mock verification.
 
 
Allows shorthand ArgumentCaptor creation on fields.
This annotation is not supposed to be used by Mockito end-users.
DefaultConfiguration of Mockito framework
Provides information about the invocation, specifically a human readable description and the location.
Annotation representing a type that should not be mocked.
Enforcer that is applied to every type in the type hierarchy of the class-to-be-mocked.
Static cache for types that are known to be mockable and thus may be skipped while traversing the class hierarchy.
Enforcer that checks if a mock can be created given its type and other settings used in its creation.
Thrown when attempting to mock a class that is annotated with DoNotMock.
 
Use it to configure Mockito.
The annotation conveys following information: The API is fairly new and we would appreciate your feedback.
This class is required to resolve a method handle lookup for the org.mockito.codegen package what requires a preexisting class for the package.
Mark a field on which injection should be performed.
Thrown when creation of test subject annotated with InjectMocks fails.
Extension to MockMaker for mock makers that changes inline method implementations and need keep track of created mock objects.
Allows verification in order.
Exception generated when Instantiator.newInstance(Class) failed.
Provides instances of classes.
Mockito will invoke this interface in order to fetch an instance instantiator provider.
 
A method call on a mock object.
Although this class is a part of public API, please don't provide your own implementations.
Behavior of the real method.
This listener can be notified of method invocations on a mock.
An invocation on a mock.
Used for declaring optional stubbings with Mockito.lenient()
Describes the location of something in the source code.
MatchableInvocation wraps Invocation instance and holds argument matchers associated with that invocation.
A member accessor is responsible for invoking methods, constructors and for setting and reading field values.
 
 
Represent a method call on a mock.
 
Mark a field as a mock.
 
Notified when mock object is created.
Informs about the mock settings.
Represents a mock of any object construction of the represented type.
The context for a construction mock.
Functional interface that consumes a newly created mock and the mock context.
Represents an active mock of a type's static methods.
Functional interface for a verification operation on a static mock.
Mockito handler of an invocation on a mock.
Provides mocking information.
Mockito logo
MockitoAnnotations.openMocks(this); initializes fields annotated with Mockito annotations.
Base class for verification errors emitted by Mockito.
 
Raised by mockito to emit an error either due to Mockito, or due to the User.
Mockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.
Allows matching arguments with hamcrest matchers.
Stubbing hints were introduced in Mockito 2 in order to improve debuggability while keeping backwards compatibility.
 
Mockito supports JUnit via: JUnit Rules - see MockitoRule JUnit runners - see MockitoJUnitRunner JUnit Jupiter extension
Mockito JUnit Runner keeps tests clean and improves debugging experience.
This Mockito JUnit Runner implementation *ignores* stubbing argument mismatches (MockitoJUnitRunner.StrictStubs) and *does not detect* unused stubbings.
Detects unused stubs and reports them as failures.
Improves debugging tests, helps keeping the tests clean.
Marker interface for all types of Mockito listeners.
Mockito logger.
Instance of this interface is available via MockitoFramework.getPlugins().
Mockito JUnit Rule helps keeping tests clean.
Raised by mockito to emit an error either due to Mockito, or due to the User.
MockitoSession is an optional, highly recommended feature that drives writing cleaner tests by eliminating boilerplate code and adding extra validation.
Fluent builder interface for MockitoSession objects.
Logger for hints emitted when finishing mocking for a MockitoSession.
Equivalent to MockitoRule, but inherits a different JUnit4 base interface TestRule.
The facility to create mocks.
 
 
Carries the mockability information
Constants for built-in implementations of MockMaker.
Represents the name of the mock as shown in the verification failure reports, etc.
A mock resolver offers an opportunity to resolve a mock from any instance that is provided to the Mockito-DSL.
Allows mock creation with additional mock settings.
The type of mock being created
Thrown when atMost(x) verification fails.
 
No interactions wanted.
 
Indicates to the user that she should not provide custom implementations of given type.
 
Simply put: "When the x method is called then return y".
Allows switching off the plugins that are discovered on classpath.
PotentialStubbingProblem improves productivity by failing the test early when the user misconfigures mock's stubbing.
Reported when instance of MockitoListener is being added to Mockito (see MockitoFramework) and there is already a listener with this implementation type registered.
Represents a mock with a thread-local explicit scope.
Mock serializable style.
 
Allows shorthand wrapping of field instances in a spy object.
Decides if particular StackTraceElement is excluded from the human-readable stack trace output.
Very similar to the StackFrame class declared on the StackWalker api.
An extension point to register custom StackTraceCleaner.
Configures the "strictness" of Mockito, affecting the behavior of stubbings and verification.
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style
Stubbing declared on the mock object.
Represent an information about the looked up stubbing
When a method is called on a mock object Mockito looks up any stubbings recorded on that mock.
The information about stubbing, for example the location of stubbing.
 
See the javadoc for VerificationWithTimeout
 
 
This exception prevents the user from forgetting to use MockitoSession.finishMocking().
 
 
This exception indicates presence of unused stubbings.
Allow to validate this answer is correct for the given invocation.
VerificationAfterDelay is a VerificationMode that allows combining existing verification modes with an initial delay, e.g.
Use this rule in order to collect multiple verification failures and report at once.
Contains all information about a verification that has happened.
 
This listener can be notified of verify invocations on a mock.
Allows verifying that certain behavior happened at least once / exact number of times / never.
The instance of this class is passed to VerificationStartedListener.
This listener gets notified when the user starts verification.
Strategy to possibly lazily perform verifications.
VerificationWithTimeout is a VerificationMode that allows combining existing verification modes with 'timeout'.
Generic interface to be used for configuring mock's answer for a single argument invocation that returns nothing.
Generic interface to be used for configuring mock's answer for a two argument invocation that returns nothing.
Generic interface to be used for configuring mock's answer for a three argument invocation that returns nothing.
Generic interface to be used for configuring mock's answer for a four argument invocation that returns nothing.
Generic interface to be used for configuring mock's answer for a five argument invocation that returns nothing.
Generic interface to be used for configuring mock's answer for a six argument invocation that returns nothing.