Package and Description |
---|
org.mockito.runners |
Interface and Description |
---|
org.mockito.configuration.AnnotationEngine
Please use
AnnotationEngine instead,
this interface will probably be removed in mockito 4. |
org.mockito.plugins.InstantiatorProvider
since 2.15.4 because this internal class was leaking from the public API.
For more information why deprecated, see
InstantiatorProvider2 and
Issue 1303
Mockito will invoke this interface in order to fetch an instance instantiator provider. By default, an internal byte-buddy/asm/objenesis based implementation is used. Using the extension point
The plugin mechanism of mockito works in a similar way as the
Note that if several
So just create a custom implementation of
This class is deprecated and was replaced by
|
org.mockito.MockitoDebugger
- please use
MockingDetails.printInvocations() instead.
An instance of MockingDetails can be retrieved via Mockito.mockingDetails(Object) . |
Class and Description |
---|
org.mockito.runners.ConsoleSpammingMockitoJUnitRunner
as of 2.1.0. Use the
MockitoJUnitRunner runner instead
which contains support for detecting unused stubs.
If you still prefer using this runner, tell us why (create ticket in our issue tracker). |
org.mockito.Matchers
Use
ArgumentMatchers . This class is now deprecated in order to avoid a name clash with Hamcrest
org.hamcrest.Matchers class. This class will likely be removed in version 4.0. |
org.mockito.runners.MockitoJUnitRunner
Moved to
MockitoJUnitRunner , this class will be removed with Mockito 4 |
org.mockito.runners.MockitoJUnitRunner.Silent
Moved to
MockitoJUnitRunner.Silent , this class will be removed with Mockito 4 |
org.mockito.runners.MockitoJUnitRunner.Strict
Moved to
MockitoJUnitRunner.Strict , this class will be removed with Mockito 4 |
org.mockito.runners.VerboseMockitoJUnitRunner
as of 2.1.0. Use the
MockitoJUnitRunner runner instead
which contains support for detecting unused stubs.
If you still prefer using this runner, tell us why (create ticket in our issue tracker). |
Errors and Description |
---|
org.mockito.exceptions.verification.TooLittleActualInvocations
as of 2.27.5. Please use
TooFewActualInvocations instead. |
Method and Description |
---|
org.mockito.ArgumentMatchers.anyCollectionOf(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anyIterableOf(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anyListOf(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anyMapOf(Class<K>, Class<V>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anyObject()
This will be removed in Mockito 4.0 This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anySetOf(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.anyVararg()
as of 2.1.0 use
ArgumentMatchers.any() |
org.mockito.invocation.InvocationFactory.createInvocation(Object, MockCreationSettings, Method, Callable, Object...)
Use
InvocationFactory.createInvocation(Object, MockCreationSettings, Method, RealMethodBehavior, Object...) instead.
Why deprecated? We found use cases where we need to handle Throwable and ensure correct stack trace filtering
(removing Mockito internals from the stack trace). Hence the introduction of InvocationFactory.RealMethodBehavior .
Creates instance of an Invocation object.
This method is useful for framework integrators to programmatically simulate method calls on mocks using MockHandler .
It enables advanced framework integrations. |
org.mockito.runners.MockitoJUnitRunner.filter(Filter) |
org.mockito.Answers.get()
as of 2.1.0 Use the enum-constant directly, instead of this getter. This method will be removed in a future release
E.g. instead of Answers.CALLS_REAL_METHODS.get() use Answers.CALLS_REAL_METHODS . |
org.mockito.configuration.IMockitoConfiguration.getAnnotationEngine()
Please use the extension mechanism
AnnotationEngine instead,
this method will probably be removed in mockito 4. |
org.mockito.runners.MockitoJUnitRunner.getDescription() |
org.mockito.plugins.InstantiatorProvider.getInstantiator(MockCreationSettings<?>) |
org.mockito.MockitoAnnotations.initMocks(Object)
Use
MockitoAnnotations.openMocks(Object) instead.
This method is equivalent to openMocks(testClass).close() .
The close method should however only be called after completed usage of testClass .
If using static-mocks or custom MockMaker s, using this method might
cause misbehavior of mocks injected into the test class. |
org.mockito.ArgumentMatchers.isNotNull(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.isNull(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.ArgumentMatchers.notNull(Class<T>)
With Java 8 this method will be removed in Mockito 4.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.
|
org.mockito.MockitoDebugger.printInvocations(Object...)
- please use
MockingDetails.printInvocations() instead.
An instance of MockingDetails can be retrieved via Mockito.mockingDetails(Object) . |
org.mockito.runners.MockitoJUnitRunner.run(RunNotifier) |
org.mockito.BDDMockito.Then.shouldHaveZeroInteractions()
Since 3.0.1. Please migrate your code to
BDDMockito.Then.shouldHaveNoInteractions() |
org.mockito.MockedStatic.verify(VerificationMode, MockedStatic.Verification)
Please use {@link MockedStatic#verify(Verification, VerificationMode) instead
|
org.mockito.Mockito.verifyZeroInteractions(Object...)
Since 3.0.1. Please migrate your code to
Mockito.verifyNoInteractions(Object...) |
org.mockito.BDDMockito.BDDStubber.willNothing()
as of 2.1.0 please use
BDDMockito.BDDStubber.willDoNothing() instead |