Package org.mockito
package org.mockito
Mockito is a mock library for java - see
Mockito
class for usage.- See Also:
-
ClassDescriptionAdditional answers provides factory methods for answers.See
Matchers
for general info about matchers.Enumeration of pre-configured mock answersUse it to capture argument values for further assertions.Allows creating customized argument matchers.Allow flexible verification or stubbing.Behavior Driven Development style of writing tests uses //given //when //then comments as fundamental parts of your test methods.See originalOngoingStubbing
See originalStubber
Provides fluent way of mock verification.Allows shorthandArgumentCaptor
creation on fields.This annotation is not supposed to be used by Mockito end-users.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.Allows verification in order.Deprecated.Mark a field as a mock.Represents a mock of any object construction of the represented type.MockedStatic<T>Represents an active mock of a type's static methods.Provides mocking information.MockitoAnnotations.openMocks(this); initializes fields annotated with Mockito annotations.Deprecated.- please useMockingDetails.printInvocations()
instead.Mockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.MockitoSession
is an optional, highly recommended feature that helps driving cleaner tests by eliminating boilerplate code and adding extra validation.Allows mock creation with additional mock settings.Indicates to the user that she should not provide custom implementations of given type.Represents a mock with a thread-local explicit scope.Allows shorthand wrapping of field instances in an spy object.
ArgumentMatchers
.