Package org.mockito
Mockito is a mock library for java - see
Mockito
class for usage.- See Also:
Mockito
-
Interface Summary Interface Description ArgumentMatcher<T> Allows creating customized argument matchers.BDDMockito.BDDMyOngoingStubbing<T> See originalOngoingStubbing
BDDMockito.BDDStubber See originalStubber
BDDMockito.Then<T> Provides fluent way of mock verification.InOrder Allows verification in order.MockedConstruction<T> Represents a mock of any object construction of the represented type.MockedConstruction.Context The context for a construction mock.MockedConstruction.MockInitializer<T> Functional interface that consumes a newly created mock and the mock context.MockedStatic<T> Represents an active mock of a type's static methods.MockedStatic.Verification Functional interface for a verification operation on a static mock.MockingDetails Provides mocking information.MockitoFramework Mockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.MockitoSession MockitoSession
is an optional, highly recommended feature that drives writing cleaner tests by eliminating boilerplate code and adding extra validation.MockSettings Allows mock creation with additional mock settings.ScopedMock Represents a mock with a thread-local explicit scope. -
Class Summary Class Description AdditionalAnswers Additional answers provides factory methods for answers.AdditionalMatchers SeeArgumentMatchers
for general info about matchers.ArgumentCaptor<T> Use it to capture argument values for further assertions.ArgumentMatchers Allow flexible verification or stubbing.BDDMockito Behavior Driven Development style of writing tests uses //given //when //then comments as fundamental parts of your test methods.Mockito MockitoAnnotations MockitoAnnotations.openMocks(this); initializes fields annotated with Mockito annotations.MockMakers Constants for built-in implementations ofMockMaker
. -
Enum Summary Enum Description Answers Enumeration of pre-configured mock answersMock.Strictness -
Annotation Types Summary Annotation Type Description Captor Allows shorthandArgumentCaptor
creation on fields.CheckReturnValue This annotation is not supposed to be used by Mockito end-users.DoNotMock Annotation representing a type that should not be mocked.Incubating The annotation conveys following information: The API is fairly new and we would appreciate your feedback.InjectMocks Mark a field on which injection should be performed.Mock Mark a field as a mock.NotExtensible Indicates to the user that she should not provide custom implementations of given type.Spy Allows shorthand wrapping of field instances in a spy object.