Uses of Annotation Interface
org.mockito.Incubating
Packages that use Incubating
Package
Description
Mockito is a mock library for java - see
Mockito class for usage.ByteBuddy related stuff.
Public API related to mock method invocations.
Mockito JUnit integration ; rule and runners.
Public classes relative to the listener APIs.
Mock settings related classes.
Mockito plugins allow customization of behavior.
Mocking quality related classes.
Stubbing related classes.
Verification related classes.
-
Uses of Incubating in org.mockito
Classes in org.mockito with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceRepresents a mock of any object construction of the represented type.interfaceMockedStatic<T>Represents an active mock of a type's static methods.interfaceMockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.interfaceMockitoSessionis an optional, highly recommended feature that helps driving cleaner tests by eliminating boilerplate code and adding extra validation.interfaceRepresents a mock with a thread-local explicit scope.Methods in org.mockito with annotations of type IncubatingModifier and TypeMethodDescriptionMockitoFramework.addListener(MockitoListener listener) Adds listener to Mockito.static <T,A> Answer<T> Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <T,A, B> Answer<T> Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <T,A, B, C> Answer<T> Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <T,A, B, C, D>
Answer<T>Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <T,A, B, C, D, E>
Answer<T>Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <T,A, B, C, D, E, F>
Answer<T>Creates an answer from a functional interface - allows for a strongly typed answer to be created idiomatically in Java 8static <T> Answer<T>AdditionalAnswers.answersWithDelay(long sleepyTime, Answer<T> answer) Returns an answer after a delay with a defined length.AdditionalAnswers.answerVoid(VoidAnswer1<A> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8AdditionalAnswers.answerVoid(VoidAnswer2<A, B> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8AdditionalAnswers.answerVoid(VoidAnswer3<A, B, C> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8AdditionalAnswers.answerVoid(VoidAnswer4<A, B, C, D> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8AdditionalAnswers.answerVoid(VoidAnswer5<A, B, C, D, E> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8AdditionalAnswers.answerVoid(VoidAnswer6<A, B, C, D, E, F> answer) Creates an answer from a functional interface - allows for a strongly typed answer to be created idiomatically in Java 8<T> MockCreationSettings<T>Creates immutable view of mock settings used later by Mockito.<T> MockCreationSettings<T>MockSettings.buildStatic(Class<T> classToMock) Creates immutable view of mock settings used later by Mockito, for use within a static mocking.voidMockitoFramework.clearInlineMock(Object mock) Clears up internal state of specific inline mock.voidMockitoFramework.clearInlineMocks()Clears up internal state of all inline mocks.voidMockitoSession.finishMocking()Must be invoked when the user is done with mocking for given session (test method).voidMockitoSession.finishMocking(Throwable failure) Must be invoked when the user is done with mocking for given session (test method).static MockitoFrameworkMockito.framework()For advanced users or framework integrators.MockitoFramework.getInvocationFactory()Returns a factory that can create instances ofInvocation.MockingDetails.getMockHandler()Returns theMockHandlerassociated with this mock object.MockitoFramework.getPlugins()Returns an object that has access to Mockito plugins.static LenientStubberMockito.lenient()Lenient stubs bypass "strict stubbing" validation (seeStrictness.STRICT_STUBS).MockSettings.lenient()Lenient mocks bypass "strict stubbing" validation (seeStrictness.STRICT_STUBS).static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock, Function<MockedConstruction.Context, MockSettings> mockSettingsFactory) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock, Function<MockedConstruction.Context, MockSettings> mockSettingsFactory, MockedConstruction.MockInitializer<T> mockInitializer) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock, MockedConstruction.MockInitializer<T> mockInitializer) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock, MockSettings mockSettings) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstruction(Class<T> classToMock, MockSettings mockSettings, MockedConstruction.MockInitializer<T> mockInitializer) Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito.mockConstructionWithAnswer(Class<T> classToMock, Answer defaultAnswer, Answer... additionalAnswers) Creates a thread-local mock controller for all constructions of the given class.static MockitoSessionBuilderMockito.mockitoSession()MockitoSessionis an optional, highly recommended feature that helps driving cleaner tests by eliminating boilerplate code and adding extra validation.static <T> MockedStatic<T>Mockito.mockStatic(Class<T> classToMock) Creates a thread-local mock controller for all static methods of the given class or interface.static <T> MockedStatic<T>Mockito.mockStatic(Class<T> classToMock, String name) Creates a thread-local mock controller for all static methods of the given class or interface.static <T> MockedStatic<T>Mockito.mockStatic(Class<T> classToMock, MockSettings mockSettings) Creates a thread-local mock controller for all static methods of the given class or interface.static <T> MockedStatic<T>Mockito.mockStatic(Class<T> classToMock, Answer defaultAnswer) Creates a thread-local mock controller for all static methods of the given class or interface.MockSettings.outerInstance(Object outerClassInstance) Makes it possible to mock non-static inner classes in conjunction withMockSettings.useConstructor(Object...).MockitoFramework.removeListener(MockitoListener listener) When you add listener usingMockitoFramework.addListener(MockitoListener)make sure to remove it.voidMockitoSession.setStrictness(Strictness strictness) Changes the strictness of thisMockitoSession.static <T> TPlease refer to the documentation ofMockito.spy(Object).MockSettings.useConstructor(Object... args) Mockito attempts to use constructor when creating instance of the mock.MockSettings.verificationStartedListeners(VerificationStartedListener... listeners) Registers a listener(s) that will be notified when user starts verification.MockSettings.withoutAnnotations()By default, Mockito makes an attempt to preserve all annotation meta data on the mocked type and its methods to mirror the mocked type as closely as possible. -
Uses of Incubating in org.mockito.internal.creation.bytebuddy
Classes in org.mockito.internal.creation.bytebuddy with annotations of type IncubatingModifier and TypeClassDescription(package private) classThis is responsible for serializing a mock, it is enabled if the mock is implementingSerializable.class(package private) classAgent and subclass based mock maker.Methods in org.mockito.internal.creation.bytebuddy with annotations of type Incubating -
Uses of Incubating in org.mockito.invocation
Classes in org.mockito.invocation with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceAlthough this class is a part of public API, please don't provide your own implementations.interfaceAvailable viaMockitoFramework.getInvocationFactory().Methods in org.mockito.invocation with annotations of type IncubatingModifier and TypeMethodDescriptionInvocationFactory.createInvocation(Object target, MockCreationSettings settings, Method method, InvocationFactory.RealMethodBehavior realMethod, Object... args) Creates instance of anInvocationobject.MockHandler.getInvocationContainer()Returns the object that holds all invocations on the mock object, including stubbings with declared answers.MockHandler.getMockSettings()Read-only settings the mock object was created with. -
Uses of Incubating in org.mockito.junit
Classes in org.mockito.junit with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceUse this rule in order to collect multiple verification failures and report at once.Methods in org.mockito.junit with annotations of type IncubatingModifier and TypeMethodDescriptionVerificationCollector.assertLazily()Enforce all verifications are performed lazily.voidVerificationCollector.collectAndReport()Collect all lazily verified behaviour.static VerificationCollectorMockitoJUnit.collector()Creates a rule instance that can perform lazy verifications.MockitoRule.strictness(Strictness strictness) The strictness, especially "strict stubs" (Strictness.STRICT_STUBS) helps debugging and keeping tests clean.MockitoTestRule.strictness(Strictness strictness) Equivalent toMockitoRule.strictness(Strictness). -
Uses of Incubating in org.mockito.listeners
Classes in org.mockito.listeners with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceThis listener can be notified of verify invocations on a mock.interfaceThe instance of this class is passed toVerificationStartedListener.interfaceThis listener gets notified when the user starts verification.Methods in org.mockito.listeners with annotations of type IncubatingModifier and TypeMethodDescriptionVerificationStartedEvent.getMock()The mock object that will be used during verification.voidVerificationStartedListener.onVerificationStarted(VerificationStartedEvent event) Triggered when the user callsMockito.verify().voidReplaces existing mock object for verification with a different one. -
Uses of Incubating in org.mockito.mock
Classes in org.mockito.mock with annotations of type IncubatingMethods in org.mockito.mock with annotations of type IncubatingModifier and TypeMethodDescriptionObject[]MockCreationSettings.getConstructorArgs()Used when arguments should be passed to the mocked object's constructor, regardless of whether these arguments are supplied directly, or whether they include the outer instance.MockCreationSettings.getOuterClassInstance()Used when mocking non-static inner classes in conjunction withMockCreationSettings.isUsingConstructor()MockCreationSettings.getVerificationStartedListeners()VerificationStartedListenerinstances attached to this mock, seeMockSettings.verificationStartedListeners(VerificationStartedListener...)booleanMockCreationSettings.isLenient()Informs if the mock was created with "lenient" strictness, e.g.booleanMockCreationSettings.isUsingConstructor()Informs whether the mock instance should be created via constructor -
Uses of Incubating in org.mockito.plugins
Classes in org.mockito.plugins with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceExtension toMockMakerfor mock makers that changes inline method implementations and need keep track of created mock objects.interfaceA member accessor is responsible for invoking methods, constructors and for setting and reading field values.interfaceMockito logger.static interfacestatic interfacestatic interfaceCarries the mockability informationinterfaceAllows switching off the plugins that are discovered on classpath.Methods in org.mockito.plugins with annotations of type IncubatingModifier and TypeMethodDescriptiondefault voidMockMaker.clearAllCaches()Clears all cashes for mocked types and removes all byte code alterations, if possible.voidInlineMockMaker.clearAllMocks()Cleans up internal state for all existing mocks.voidClean up internal state for specifiedmock.default <T> MockMaker.ConstructionMockControl<T>MockMaker.createConstructionMock(Class<T> type, Function<MockedConstruction.Context, MockCreationSettings<T>> settingsFactory, Function<MockedConstruction.Context, MockHandler<T>> handlerFactory, MockedConstruction.MockInitializer<T> mockInitializer) If you want to provide your own implementation ofMockMakerthis method should: Intercept all constructions of the specified type in the current thread Only intercept the construction after being enabled. Stops the interception when disabled.default <T> MockMaker.StaticMockControl<T>MockMaker.createStaticMock(Class<T> type, MockCreationSettings<T> settings, MockHandler handler) If you want to provide your own implementation ofMockMakerthis method should: Alter the supplied class to only change its behavior in the current thread. Only alters the static method's behavior after being enabled. Stops the altered behavior when disabled.MockMaker.isTypeMockable(Class<?> type) Indicates if the given type can be mocked by this mockmaker.voidLog specified object. -
Uses of Incubating in org.mockito.quality
Classes in org.mockito.quality with annotations of type IncubatingModifier and TypeClassDescriptionenumConfigures the "strictness" of Mockito, affecting the behavior of stubbings and verification. -
Uses of Incubating in org.mockito.session
Classes in org.mockito.session with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceFluent builder interface forMockitoSessionobjects.interfaceLogger for hints emitted when finishing mocking for aMockitoSession.Methods in org.mockito.session with annotations of type IncubatingModifier and TypeMethodDescriptionAdds the test class instance for initialization of fields annotated with Mockito annotations likeMock.Adds the test class instances for initialization of fields annotated with Mockito annotations likeMock.voidLogs the hint.MockitoSessionBuilder.logger(MockitoSessionLogger logger) Configures logger used byMockitoSessionfor emitting warnings when finishing the session.Configures the name of theMockitoSessioninstance.MockitoSessionBuilder.startMocking()Starts new mocking session! Creates newMockitoSessioninstance to initialize the session.MockitoSessionBuilder.strictness(Strictness strictness) Configures strictness ofMockitoSessioninstance. -
Uses of Incubating in org.mockito.stubbing
Classes in org.mockito.stubbing with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceAnswer1<T,A0> Generic interface to be used for configuring mock's answer for a single argument invocation.interfaceAnswer2<T,A0, A1> Generic interface to be used for configuring mock's answer for a two argument invocation.interfaceAnswer3<T,A0, A1, A2> Generic interface to be used for configuring mock's answer for a three argument invocation.interfaceAnswer4<T,A0, A1, A2, A3> Generic interface to be used for configuring mock's answer for a four argument invocation.interfaceAnswer5<T,A0, A1, A2, A3, A4> Generic interface to be used for configuring mock's answer for a five argument invocation.interfaceAnswer6<T,A0, A1, A2, A3, A4, A5> Generic interface to be used for configuring mock's answer for a six argument invocation.interfaceAllow to validate this answer is correct for the given invocation.interfaceVoidAnswer1<A0>Generic interface to be used for configuring mock's answer for a single argument invocation that returns nothing.interfaceVoidAnswer2<A0,A1> Generic interface to be used for configuring mock's answer for a two argument invocation that returns nothing.interfaceVoidAnswer3<A0,A1, A2> Generic interface to be used for configuring mock's answer for a three argument invocation that returns nothing.interfaceVoidAnswer4<A0,A1, A2, A3> Generic interface to be used for configuring mock's answer for a four argument invocation that returns nothing.interfaceVoidAnswer5<A0,A1, A2, A3, A4> Generic interface to be used for configuring mock's answer for a five argument invocation that returns nothing.interfaceVoidAnswer6<A0,A1, A2, A3, A4, A5> Generic interface to be used for configuring mock's answer for a six argument invocation that returns nothing.Methods in org.mockito.stubbing with annotations of type IncubatingModifier and TypeMethodDescriptionStubbing.getStrictness()Informs about theStrictnesslevel of this stubbing. -
Uses of Incubating in org.mockito.verification
Classes in org.mockito.verification with annotations of type IncubatingModifier and TypeInterfaceDescriptioninterfaceContains all information about a verification that has happened.