Uses of Class
org.mockito.Incubating
-
Packages that use Incubating Package Description org.mockito Mockito is a mock library for java - seeMockitoclass for usage.org.mockito.internal.creation.bytebuddy ByteBuddy related stuff.org.mockito.invocation Public API related to mock method invocations.org.mockito.junit Mockito JUnit integration ; rule and runners.org.mockito.listeners Public classes relative to the listener APIs.org.mockito.mock Mock settings related classes.org.mockito.plugins Mockito plugins allow customization of behavior.org.mockito.quality Mocking quality related classes.org.mockito.session org.mockito.stubbing Stubbing related classes.org.mockito.verification Verification related classes. -
-
Uses of Incubating in org.mockito
Classes in org.mockito with annotations of type Incubating Modifier and Type Interface Description interfaceMockedConstruction<T>Represents a mock of any object construction of the represented type.interfaceMockedStatic<T>Represents an active mock of a type's static methods.interfaceMockitoFrameworkMockito framework settings and lifecycle listeners, for advanced users or for integrating with other frameworks.interfaceMockitoSessionMockitoSessionis an optional, highly recommended feature that helps driving cleaner tests by eliminating boilerplate code and adding extra validation.interfaceScopedMockRepresents a mock with a thread-local explicit scope.Methods in org.mockito with annotations of type Incubating Modifier and Type Method Description MockitoFrameworkMockitoFramework. addListener(MockitoListener listener)Adds listener to Mockito.static <T,A>
Answer<T>AdditionalAnswers. answer(Answer1<T,A> answer)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>AdditionalAnswers. answer(Answer2<T,A,B> answer)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>AdditionalAnswers. answer(Answer3<T,A,B,C> answer)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>AdditionalAnswers. answer(Answer4<T,A,B,C,D> answer)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>AdditionalAnswers. answer(Answer5<T,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 8static <T,A,B,C,D,E,F>
Answer<T>AdditionalAnswers. answer(Answer6<T,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 8static <T> Answer<T>AdditionalAnswers. answersWithDelay(long sleepyTime, Answer<T> answer)Returns an answer after a delay with a defined length.static <A> Answer<java.lang.Void>AdditionalAnswers. answerVoid(VoidAnswer1<A> answer)Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <A,B>
Answer<java.lang.Void>AdditionalAnswers. answerVoid(VoidAnswer2<A,B> answer)Creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in Java 8static <A,B,C>
Answer<java.lang.Void>AdditionalAnswers. 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 8static <A,B,C,D>
Answer<java.lang.Void>AdditionalAnswers. 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 8static <A,B,C,D,E>
Answer<java.lang.Void>AdditionalAnswers. 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 8static <A,B,C,D,E,F>
Answer<java.lang.Void>AdditionalAnswers. 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>MockSettings. build(java.lang.Class<T> typeToMock)Creates immutable view of mock settings used later by Mockito.<T> MockCreationSettings<T>MockSettings. buildStatic(java.lang.Class<T> classToMock)Creates immutable view of mock settings used later by Mockito, for use within a static mocking.voidMockitoFramework. clearInlineMock(java.lang.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(java.lang.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.InvocationFactoryMockitoFramework. getInvocationFactory()Returns a factory that can create instances ofInvocation.MockHandlerMockingDetails. getMockHandler()Returns theMockHandlerassociated with this mock object.MockitoPluginsMockitoFramework. getPlugins()Returns an object that has access to Mockito plugins.static LenientStubberMockito. lenient()Lenient stubs bypass "strict stubbing" validation (seeStrictness.STRICT_STUBS).MockSettingsMockSettings. lenient()Lenient mocks bypass "strict stubbing" validation (seeStrictness.STRICT_STUBS).static <T> MockedConstruction<T>Mockito. mockConstruction(java.lang.Class<T> classToMock)Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito. mockConstruction(java.lang.Class<T> classToMock, java.util.function.Function<MockedConstruction.Context,MockSettings> mockSettingsFactory)Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito. mockConstruction(java.lang.Class<T> classToMock, java.util.function.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(java.lang.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(java.lang.Class<T> classToMock, MockSettings mockSettings)Creates a thread-local mock controller for all constructions of the given class.static <T> MockedConstruction<T>Mockito. mockConstruction(java.lang.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(java.lang.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(java.lang.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(java.lang.Class<T> classToMock, java.lang.String name)Creates a thread-local mock controller for all static methods of the given class or interface.static <T> MockedStatic<T>Mockito. mockStatic(java.lang.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(java.lang.Class<T> classToMock, Answer defaultAnswer)Creates a thread-local mock controller for all static methods of the given class or interface.MockSettingsMockSettings. outerInstance(java.lang.Object outerClassInstance)Makes it possible to mock non-static inner classes in conjunction withMockSettings.useConstructor(Object...).MockitoFrameworkMockitoFramework. 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> TMockito. spy(java.lang.Class<T> classToSpy)Please refer to the documentation ofMockito.spy(Object).MockSettingsMockSettings. useConstructor(java.lang.Object... args)Mockito attempts to use constructor when creating instance of the mock.MockSettingsMockSettings. verificationStartedListeners(VerificationStartedListener... listeners)Registers a listener(s) that will be notified when user starts verification.MockSettingsMockSettings. 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 Incubating Modifier and Type Class Description (package private) classByteBuddyCrossClassLoaderSerializationSupportThis is responsible for serializing a mock, it is enabled if the mock is implementingSerializable.classInlineByteBuddyMockMaker(package private) classInlineDelegateByteBuddyMockMakerAgent and subclass based mock maker.Methods in org.mockito.internal.creation.bytebuddy with annotations of type Incubating Modifier and Type Method Description MockMaker.TypeMockabilityByteBuddyMockMaker. isTypeMockable(java.lang.Class<?> type) -
Uses of Incubating in org.mockito.invocation
Classes in org.mockito.invocation with annotations of type Incubating Modifier and Type Interface Description interfaceInvocationContainerAlthough this class is a part of public API, please don't provide your own implementations.interfaceInvocationFactoryAvailable viaMockitoFramework.getInvocationFactory().Methods in org.mockito.invocation with annotations of type Incubating Modifier and Type Method Description InvocationInvocationFactory. createInvocation(java.lang.Object target, MockCreationSettings settings, java.lang.reflect.Method method, InvocationFactory.RealMethodBehavior realMethod, java.lang.Object... args)Creates instance of anInvocationobject.InvocationContainerMockHandler. getInvocationContainer()Returns the object that holds all invocations on the mock object, including stubbings with declared answers.MockCreationSettings<T>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 Incubating Modifier and Type Interface Description interfaceVerificationCollectorUse this rule in order to collect multiple verification failures and report at once.Methods in org.mockito.junit with annotations of type Incubating Modifier and Type Method Description VerificationCollectorVerificationCollector. 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.MockitoRuleMockitoRule. strictness(Strictness strictness)The strictness, especially "strict stubs" (Strictness.STRICT_STUBS) helps debugging and keeping tests clean.MockitoTestRuleMockitoTestRule. strictness(Strictness strictness)Equivalent toMockitoRule.strictness(Strictness). -
Uses of Incubating in org.mockito.listeners
Classes in org.mockito.listeners with annotations of type Incubating Modifier and Type Interface Description interfaceVerificationListenerThis listener can be notified of verify invocations on a mock.interfaceVerificationStartedEventThe instance of this class is passed toVerificationStartedListener.interfaceVerificationStartedListenerThis listener gets notified when the user starts verification.Methods in org.mockito.listeners with annotations of type Incubating Modifier and Type Method Description java.lang.ObjectVerificationStartedEvent. getMock()The mock object that will be used during verification.voidVerificationStartedListener. onVerificationStarted(VerificationStartedEvent event)Triggered when the user callsMockito.verify().voidVerificationStartedEvent. setMock(java.lang.Object mock)Replaces 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 Incubating Modifier and Type Class Description classSerializableModeMock serializable style.Methods in org.mockito.mock with annotations of type Incubating Modifier and Type Method Description java.lang.Object[]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.java.lang.ObjectMockCreationSettings. getOuterClassInstance()Used when mocking non-static inner classes in conjunction withMockCreationSettings.isUsingConstructor()java.util.List<VerificationStartedListener>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 Incubating Modifier and Type Interface Description interfaceInlineMockMakerExtension toMockMakerfor mock makers that changes inline method implementations and need keep track of created mock objects.interfaceMemberAccessorA member accessor is responsible for invoking methods, constructors and for setting and reading field values.interfaceMockitoLoggerMockito logger.static interfaceMockMaker.ConstructionMockControl<T>static interfaceMockMaker.StaticMockControl<T>static interfaceMockMaker.TypeMockabilityCarries the mockability informationinterfacePluginSwitchAllows switching off the plugins that are discovered on classpath.Methods in org.mockito.plugins with annotations of type Incubating Modifier and Type Method Description default 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.voidInlineMockMaker. clearMock(java.lang.Object mock)Clean up internal state for specifiedmock.default <T> MockMaker.ConstructionMockControl<T>MockMaker. createConstructionMock(java.lang.Class<T> type, java.util.function.Function<MockedConstruction.Context,MockCreationSettings<T>> settingsFactory, java.util.function.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(java.lang.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.TypeMockabilityMockMaker. isTypeMockable(java.lang.Class<?> type)Indicates if the given type can be mocked by this mockmaker.voidMockitoLogger. log(java.lang.Object what)Log specified object. -
Uses of Incubating in org.mockito.quality
Classes in org.mockito.quality with annotations of type Incubating Modifier and Type Class Description classStrictnessConfigures 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 Incubating Modifier and Type Interface Description interfaceMockitoSessionBuilderFluent builder interface forMockitoSessionobjects.interfaceMockitoSessionLoggerLogger for hints emitted when finishing mocking for aMockitoSession.Methods in org.mockito.session with annotations of type Incubating Modifier and Type Method Description MockitoSessionBuilderMockitoSessionBuilder. initMocks(java.lang.Object testClassInstance)Adds the test class instance for initialization of fields annotated with Mockito annotations likeMock.MockitoSessionBuilderMockitoSessionBuilder. initMocks(java.lang.Object... testClassInstances)Adds the test class instances for initialization of fields annotated with Mockito annotations likeMock.voidMockitoSessionLogger. log(java.lang.String hint)Logs the hint.MockitoSessionBuilderMockitoSessionBuilder. logger(MockitoSessionLogger logger)Configures logger used byMockitoSessionfor emitting warnings when finishing the session.MockitoSessionBuilderMockitoSessionBuilder. name(java.lang.String name)Configures the name of theMockitoSessioninstance.MockitoSessionMockitoSessionBuilder. startMocking()Starts new mocking session! Creates newMockitoSessioninstance to initialize the session.MockitoSessionBuilderMockitoSessionBuilder. strictness(Strictness strictness)Configures strictness ofMockitoSessioninstance. -
Uses of Incubating in org.mockito.stubbing
Classes in org.mockito.stubbing with annotations of type Incubating Modifier and Type Interface Description interfaceAnswer1<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.interfaceValidableAnswerAllow 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 Incubating Modifier and Type Method Description StrictnessStubbing. getStrictness()Informs about theStrictnesslevel of this stubbing. -
Uses of Incubating in org.mockito.verification
Classes in org.mockito.verification with annotations of type Incubating Modifier and Type Interface Description interfaceVerificationEventContains all information about a verification that has happened.
-