Uses of Class
org.mockito.exceptions.base.MockitoException
-
Packages that use MockitoException Package Description org.mockito.creation.instance org.mockito.exceptions.misusing Exceptions thrown when Mockito is misused.org.mockito.exceptions.verification Verification errors.org.mockito.internal.creation.instance org.mockito.internal.exceptions -
-
Uses of MockitoException in org.mockito.creation.instance
Subclasses of MockitoException in org.mockito.creation.instance Modifier and Type Class Description class
InstantiationException
Exception generated whenInstantiator.newInstance(Class)
failed. -
Uses of MockitoException in org.mockito.exceptions.misusing
Subclasses of MockitoException in org.mockito.exceptions.misusing Modifier and Type Class Description class
CannotStubVoidMethodWithReturnValue
class
CannotVerifyStubOnlyMock
class
FriendlyReminderException
class
InjectMocksException
Thrown when creation of test subject annotated with InjectMocks fails.class
InvalidUseOfMatchersException
class
MissingMethodInvocationException
class
MockitoConfigurationException
class
NotAMockException
class
NullInsteadOfMockException
class
PotentialStubbingProblem
PotentialStubbingProblem
improves productivity by failing the test early when the user misconfigures mock's stubbing.class
RedundantListenerException
Reported when instance ofMockitoListener
is being added to Mockito (seeMockitoFramework
) and there is already a listener with this implementation type registered.class
UnfinishedMockingSessionException
This exception prevents the user from forgetting to useMockitoSession.finishMocking()
.class
UnfinishedStubbingException
class
UnfinishedVerificationException
class
UnnecessaryStubbingException
This exception indicates presence of unused stubbings.class
WrongTypeOfReturnValue
-
Uses of MockitoException in org.mockito.exceptions.verification
Subclasses of MockitoException in org.mockito.exceptions.verification Modifier and Type Class Description class
SmartNullPointerException
-
Uses of MockitoException in org.mockito.internal.creation.instance
Subclasses of MockitoException in org.mockito.internal.creation.instance Modifier and Type Class Description class
InstantiationException
Deprecated.since 2.15.4 because this internal class was leaking from the public API. -
Uses of MockitoException in org.mockito.internal.exceptions
Methods in org.mockito.internal.exceptions that return MockitoException Modifier and Type Method Description static MockitoException
Reporter. atMostAndNeverShouldNotBeUsedWithTimeout()
static MockitoException
Reporter. cannotCallAbstractRealMethod()
static MockitoException
Reporter. cannotCreateTimerWithNegativeDurationTime(long durationMillis)
static MockitoException
Reporter. cannotInitializeForInjectMocksAnnotation(java.lang.String fieldName, java.lang.String causeMessage)
static MockitoException
Reporter. cannotInitializeForSpyAnnotation(java.lang.String fieldName, java.lang.Exception details)
static MockitoException
Reporter. cannotInjectDependency(java.lang.reflect.Field field, java.lang.Object matchingMock, java.lang.Exception details)
static MockitoException
Reporter. cannotMockClass(java.lang.Class<?> clazz, java.lang.String reason)
static MockitoException
Reporter. cannotStubVoidMethodWithAReturnValue(java.lang.String methodName)
static MockitoException
Reporter. cannotStubWithNullThrowable()
static MockitoException
Reporter. cannotVerifyToString()
static MockitoException
Reporter. checkedExceptionInvalid(java.lang.Throwable t)
static MockitoException
Reporter. defaultAnswerDoesNotAcceptNullParameter()
static MockitoException
Reporter. delegatedMethodDoesNotExistOnDelegate(java.lang.reflect.Method mockMethod, java.lang.Object mock, java.lang.Object delegate)
static MockitoException
Reporter. delegatedMethodHasWrongReturnType(java.lang.reflect.Method mockMethod, java.lang.reflect.Method delegateMethod, java.lang.Object mock, java.lang.Object delegate)
static MockitoException
Reporter. extraInterfacesAcceptsOnlyInterfaces(java.lang.Class<?> wrongType)
static MockitoException
Reporter. extraInterfacesCannotContainMockedType(java.lang.Class<?> wrongType)
static MockitoException
Reporter. extraInterfacesDoesNotAcceptNullParameters()
static MockitoException
Reporter. extraInterfacesRequiresAtLeastOneInterface()
static MockitoException
Reporter. fieldInitialisationThrewException(java.lang.reflect.Field field, java.lang.Throwable details)
static MockitoException
Reporter. incorrectUseOfAdditionalMatchers(java.lang.String additionalMatcherName, int expectedSubMatchersCount, java.util.Collection<LocalizedMatcher> matcherStack)
static MockitoException
Reporter. incorrectUseOfApi()
static MockitoException
Reporter. inlineClassWithoutUnboxImpl(java.lang.Class<?> inlineClass, java.lang.Exception details)
static MockitoException
Reporter. inOrderRequiresFamiliarMock()
static MockitoException
Reporter. invalidArgumentPositionRangeAtInvocationTime(InvocationOnMock invocation, boolean willReturnLastParameter, int argumentIndex)
static MockitoException
Reporter. invalidArgumentRangeAtIdentityAnswerCreationTime()
static MockitoException
Reporter. invalidUseOfMatchers(int expectedMatchersCount, java.util.List<LocalizedMatcher> recordedMatchers)
static MockitoException
Reporter. invocationListenerThrewException(InvocationListener listener, java.lang.Throwable listenerThrowable)
static MockitoException
Reporter. methodDoesNotAcceptParameter(java.lang.String method, java.lang.String parameter)
static MockitoException
Reporter. misplacedArgumentMatcher(java.util.List<LocalizedMatcher> lastMatchers)
static MockitoException
Reporter. missingMethodInvocation()
static MockitoException
Reporter. mockedTypeIsInconsistentWithDelegatedInstanceType(java.lang.Class<?> mockedType, java.lang.Object delegatedInstance)
static MockitoException
Reporter. mockedTypeIsInconsistentWithSpiedInstanceType(java.lang.Class<?> mockedType, java.lang.Object spiedInstance)
static MockitoException
Reporter. mocksHaveToBePassedToVerifyNoMoreInteractions()
static MockitoException
Reporter. mocksHaveToBePassedWhenCreatingInOrder()
static MockitoException
Reporter. moreThanOneAnnotationNotAllowed(java.lang.String fieldName)
static MockitoException
Reporter. noArgumentValueWasCaptured()
static MockitoException
Reporter. notAMockPassedToVerify(java.lang.Class<?> type)
static MockitoException
Reporter. notAMockPassedToVerifyNoMoreInteractions()
static MockitoException
Reporter. notAMockPassedToWhenMethod()
static MockitoException
Reporter. notAMockPassedWhenCreatingInOrder()
static MockitoException
Reporter. notAnException()
static MockitoException
Reporter. nullPassedToVerify()
static MockitoException
Reporter. nullPassedToVerifyNoMoreInteractions()
static MockitoException
Reporter. nullPassedToWhenMethod()
static MockitoException
Reporter. nullPassedWhenCreatingInOrder()
static MockitoException
Reporter. onlyVoidMethodsCanBeSetToDoNothing()
static MockitoException
Reporter. reportNoSubMatchersFound(java.lang.String additionalMatcherName)
static MockitoException
Reporter. requiresAtLeastOneListener(java.lang.String method)
static MockitoException
Reporter. serializableWontWorkForObjectsThatDontImplementSerializable(java.lang.Class<?> classToMock)
static MockitoException
Reporter. smartNullPointerException(java.lang.String invocation, Location location)
static MockitoException
Reporter. spyAndDelegateAreMutuallyExclusive()
static MockitoException
Reporter. stubPassedToVerify(java.lang.Object mock)
static MockitoException
Reporter. unfinishedStubbing(Location location)
static MockitoException
Reporter. unfinishedVerificationException(Location location)
static MockitoException
Reporter. unsupportedCombinationOfAnnotations(java.lang.String undesiredAnnotationOne, java.lang.String undesiredAnnotationTwo)
static MockitoException
Reporter. usingConstructorWithFancySerializable(SerializableMode mode)
static MockitoException
Reporter. wrongTypeOfArgumentToReturn(InvocationOnMock invocation, java.lang.String expectedType, java.lang.Class<?> actualType, int argumentIndex)
static MockitoException
Reporter. wrongTypeOfReturnValue(java.lang.String expectedType, java.lang.String actualType, java.lang.String methodName)
static MockitoException
Reporter. wrongTypeReturnedByDefaultAnswer(java.lang.Object mock, java.lang.String expectedType, java.lang.String actualType, java.lang.String methodName)
-