All Classes and Interfaces

Class
Description
 
 
Additional answers provides factory methods for less common answers.
See Matchers for general info about matchers.
See the javadoc for VerificationAfterDelay
 
 
Configures mock creation logic behind @Mock, @Captor and @Spy annotations
Generic interface to be used for configuring mock's answer.
 
Enumeration of pre-configured mock answers
Deprecated.
- please use Answers from top Mockito package: Answers
 
 
 
Use it to capture argument values for further assertions.
Allows creating customized argument matchers.
 
 
 
 
 
 
by Szczepan Faber, created at: 3/31/12
 
 
 
 
 
 
 
 
Behavior Driven Development style of writing tests uses //given //when //then comments as fundamental parts of your test methods.
See original OngoingStubbing
Deprecated.
not part of the public API, use BDDMockito.BDDMyOngoingStubbing instead.
See original Stubber
Deprecated.
not part of the public API, use BDDMockito.BDDStubber instead.
Provides fluent way of mock verification.
This utility class will call the setter of the property to inject a new value.
 
Optional Answer that adds partial mocking support
 
 
Allows shorthand ArgumentCaptor creation on fields.
Instantiate ArgumentCaptor a field annotated by @Captor.
 
 
 
A MockMaker that uses cglib to generate mocks on a JVM.
Pre-made preconditions
Loads configuration or extension points available in the classpath.
Provides stack trace filtering on exception.
 
 
 
 
 
 
 
Uses JUnit 4.5 runner BlockJUnit4ClassRunner.
Injection strategy based on constructor.
 
 
 
 
by Szczepan Faber, created at: 4/9/12
 
Initializes fields annotated with @Mock or @Captor.
Inject mock/spies dependencies for fields annotated with @InjectMocks
Class to inspect any object, and identify whether a particular object is either a mock or a spy.
DefaultConfiguration of Mockito framework
 
 
by Szczepan Faber, created at: 7/29/12
by Szczepan Faber, created at: 7/29/12
 
Stubs a method call with return value or an exception.
Provides information about the invocation, specifically a human readable description and the location.
Deprecated.
 
 
 
 
 
 
 
Simple annotation processor interface.
 
Report on field initialization
Initialize a field with type instance if a default constructor can be found.
Represents the strategy used to resolve actual instances to be given to a constructor given the argument types.
 
Small fluent reflection tools to work with fields.
 
 
This node returns an actual injecter which will be either : an OngoingInjecter that do nothing if a candidate couldn't be found an OngoingInjecter that will try to inject the candidate trying first the property setter then if not possible try the field access
 
 
Internal answer to forward invocations on a real instance.
 
 
 
This class can retrieve generic meta-data that the compiler stores on classes and accessible members.
Type representing bounds of a type
Type representing bounds of a type variable, allows to keep all bounds information.
Type representing bounds of a wildcard, allows to keep all bounds information.
Thread-safe wrapper on user-defined org.mockito.configuration.MockitoConfiguration implementation
Globally configured Answer.
 
 
 
hashCode and equals safe mock wrapper.
hashCode and equals safe hash based set.
 
Use it to configure Mockito.
The annotation conveys following information: The API is fairly new and we would appreciate your feedback.
Mark a field on which injection should be performed.
Scan field for injection.
Allows verification in order.
 
 
Allows verifying in order.
 
Represents an accessible instance field.
 
 
Provides instances of classes.
 
 
 
A method call on a mock object.
 
 
Method call on a mock object.
This listener can be notified of method invocations on a mock.
 
 
An invocation on a mock
 
Marking interface to be removed when DeprecatedOngoingStubbing gets deleted
IO utils.
Utilities for Iterables
 
 
 
Internal implementation.
Deprecated.
 
 
 
 
 
 
 
 
Describes the location of something in the source code.
 
 
 
Allow flexible verification or stubbing.
 
 
 
by Szczepan Faber, created at: 3/31/12
Represent a method call on a mock.
 
 
 
Mark a field as a mock.
Instantiates a mock on a field annotated by Mock
 
 
Informs about the mock settings.
 
Mockito handler of an invocation on a mock.
by Szczepan Faber, created at: 5/21/12
Provides mocking information.
 
 
 
 
Internal injection configuration utility.
Ongoing configuration of the mock injector.
Injector strategy contract
MockitoAnnotations.initMocks(this); initializes fields annotated with Mockito annotations.
Deprecated.
Instantiates a mock on a field annotated by MockitoAnnotations.Mock
 
 
 
 
 
Raised by mockito to emit an error either due to Mockito, or due to the User.
The JUnit rule can be used instead of MockitoJUnitRunner.
Deprecated.
Deprecated.
Compatible with JUnit 4.4 and higher, this runner adds following behavior: Initializes mocks annotated with Mock, so that explicit usage of MockitoAnnotations.initMocks(Object) is not necessary.
 
 
 
 
The JUnit rule can be used instead of MockitoJUnitRunner.
Raised by mockito to emit an error either due to Mockito, or due to the User.
The facility to create mocks.
Represents the name of the mock as shown in the verification failure reports, etc.
 
Scan mocks, and prepare them if needed.
Allows mock creation with additional mock settings.
 
 
 
 
No interactions wanted.
 
 
 
 
Report on a method call
 
 
 
 
 
 
Allow the ongoing injection of a mock candidate.
Simply put: "When the x method is called then return y".
 
 
 
Access to Mockito behavior that can be reconfigured by plugins
Allows switching off the plugins that are discovered on classpath.
Deprecated.
 
 
Deprecated.
 
Inject mocks using first setters then fields, if no setters available.
 
 
 
 
Reports verification and misusing errors.
 
Returns the passed parameter identity at specified index.
Returning deep stub implementation.
Returns elements of the collection.
Default answer of every Mockito mock.
 
It's likely this implementation will be used by default by every Mockito 2.0 mock.
Optional Answer that can be used with Mockito.mock(Class, Answer)
Deprecated.
Instead, please use Answer interface
 
I'm using this surrogate interface to hide internal Runner implementations.
 
 
 
Inspired on jMock (thanks jMock guys!!!)
 
 
Mock serializable style.
 
 
 
 
Makes sure both wanted and actual are printed consistently (single line or multiline)
Allows shorthand wrapping of field instances in an spy object.
Process fields annotated with @Spy.
Handler for field annotated with @InjectMocks and @Spy.
Decides if particular StackTraceElement is excluded from the human-readable stack trace output.
An extension point to register custom StackTraceCleaner.
 
 
 
 
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style
 
The information about stubbing, for example the location of stubbing.
 
 
 
 
 
See the javadoc for VerificationWithTimeout
 
 
 
 
 
 
 
 
 
 
Logs all invocations to standard output.
Experimental implementation that suppose to improve tdd/testing experience.
Author: Szczepan Faber, created at: 4/3/11
VerificationAfterDelay is a VerificationMode that allows combining existing verification modes with an initial delay, e.g.
 
 
 
 
 
 
 
Allows verifying that certain behavior happened at least once / exact number of times / never.
 
Verifies that another verification mode (the delegate) is satisfied within a certain timeframe (before timeoutMillis has passed, measured from the call to verify()), and either returns immediately once it does, or waits until it is definitely satisfied once the full time has passed.
VerificationWithTimeout is a VerificationMode that allows combining existing verification modes with 'timeout'.
 
Stubs void method with an exception.