Uses of Class
org.mockito.exceptions.base.MockitoException
Packages that use MockitoException
Package
Description
Exceptions thrown when Mockito is misused.
Verification errors.
-
Uses of MockitoException in org.mockito.creation.instance
Subclasses of MockitoException in org.mockito.creation.instanceModifier and TypeClassDescriptionclass
Exception generated whenInstantiator.newInstance(Class)
failed. -
Uses of MockitoException in org.mockito.exceptions.misusing
Subclasses of MockitoException in org.mockito.exceptions.misusingModifier and TypeClassDescriptionclass
class
class
Thrown when attempting to mock a class that is annotated withDoNotMock
.class
class
Thrown when creation of test subject annotated with InjectMocks fails.class
class
class
class
class
class
PotentialStubbingProblem
improves productivity by failing the test early when the user misconfigures mock's stubbing.class
Reported when instance ofMockitoListener
is being added to Mockito (seeMockitoFramework
) and there is already a listener with this implementation type registered.class
This exception prevents the user from forgetting to useMockitoSession.finishMocking()
.class
class
class
This exception indicates presence of unused stubbings.class
-
Uses of MockitoException in org.mockito.exceptions.verification
Subclasses of MockitoException in org.mockito.exceptions.verification -
Uses of MockitoException in org.mockito.internal.exceptions
Methods in org.mockito.internal.exceptions that return MockitoExceptionModifier and TypeMethodDescriptionstatic MockitoException
Reporter.atMostAndNeverShouldNotBeUsedWithTimeout()
static MockitoException
Reporter.cannotCallAbstractRealMethod()
static MockitoException
Reporter.cannotCreateTimerWithNegativeDurationTime
(long durationMillis) static MockitoException
Reporter.cannotInitializeForInjectMocksAnnotation
(String fieldName, String causeMessage) static MockitoException
Reporter.cannotInitializeForSpyAnnotation
(String fieldName, Exception details) static MockitoException
Reporter.cannotInjectDependency
(Field field, Object matchingMock, Exception details) static MockitoException
Reporter.cannotMockClass
(Class<?> clazz, String reason) static MockitoException
Reporter.cannotStubVoidMethodWithAReturnValue
(String methodName) static MockitoException
Reporter.cannotStubWithNullThrowable()
static MockitoException
Reporter.cannotVerifyToString()
static MockitoException
Reporter.checkedExceptionInvalid
(Throwable t) static MockitoException
Reporter.defaultAnswerDoesNotAcceptNullParameter()
static MockitoException
Reporter.delegatedMethodDoesNotExistOnDelegate
(Method mockMethod, Object mock, Object delegate) static MockitoException
Reporter.delegatedMethodHasWrongReturnType
(Method mockMethod, Method delegateMethod, Object mock, Object delegate) static MockitoException
Reporter.extraInterfacesAcceptsOnlyInterfaces
(Class<?> wrongType) static MockitoException
Reporter.extraInterfacesCannotContainMockedType
(Class<?> wrongType) static MockitoException
Reporter.extraInterfacesDoesNotAcceptNullParameters()
static MockitoException
Reporter.extraInterfacesRequiresAtLeastOneInterface()
static MockitoException
Reporter.fieldInitialisationThrewException
(Field field, Throwable details) static MockitoException
Reporter.incorrectUseOfAdditionalMatchers
(String additionalMatcherName, int expectedSubMatchersCount, Collection<LocalizedMatcher> matcherStack) static MockitoException
Reporter.incorrectUseOfApi()
static MockitoException
Reporter.inlineClassWithoutUnboxImpl
(Class<?> inlineClass, Exception details) static MockitoException
Reporter.inOrderRequiresFamiliarMock()
static MockitoException
Reporter.invalidArgumentPositionRangeAtInvocationTime
(InvocationOnMock invocation, boolean willReturnLastParameter, int argumentIndex) static MockitoException
static MockitoException
Reporter.invalidUseOfMatchers
(int expectedMatchersCount, List<LocalizedMatcher> recordedMatchers) static MockitoException
Reporter.invocationListenerThrewException
(InvocationListener listener, Throwable listenerThrowable) static MockitoException
Reporter.methodDoesNotAcceptParameter
(String method, String parameter) static MockitoException
Reporter.misplacedArgumentMatcher
(List<LocalizedMatcher> lastMatchers) static MockitoException
Reporter.missingMethodInvocation()
static MockitoException
Reporter.mockedTypeIsInconsistentWithDelegatedInstanceType
(Class<?> mockedType, Object delegatedInstance) static MockitoException
Reporter.mockedTypeIsInconsistentWithSpiedInstanceType
(Class<?> mockedType, Object spiedInstance) static MockitoException
static MockitoException
Reporter.mocksHaveToBePassedWhenCreatingInOrder()
static MockitoException
Reporter.moreThanOneAnnotationNotAllowed
(String fieldName) static MockitoException
Reporter.moreThanOneMockCandidate
(Field field, Collection<?> mockCandidates) static MockitoException
Reporter.noArgumentValueWasCaptured()
static MockitoException
Reporter.notAMockPassedToVerify
(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
(String additionalMatcherName) static MockitoException
Reporter.requiresAtLeastOneListener
(String method) static MockitoException
Reporter.serializableWontWorkForObjectsThatDontImplementSerializable
(Class<?> classToMock) static MockitoException
Reporter.smartNullPointerException
(String invocation, Location location) static MockitoException
Reporter.spyAndDelegateAreMutuallyExclusive()
static MockitoException
Reporter.strictnessDoesNotAcceptNullParameter()
static MockitoException
Reporter.stubPassedToVerify
(Object mock) static MockitoException
Reporter.unfinishedStubbing
(Location location) static MockitoException
Reporter.unfinishedVerificationException
(Location location) static MockitoException
Reporter.unsupportedCombinationOfAnnotations
(String undesiredAnnotationOne, String undesiredAnnotationTwo) static MockitoException
Reporter.usingConstructorWithFancySerializable
(SerializableMode mode) static MockitoException
Reporter.wrongTypeOfArgumentToReturn
(InvocationOnMock invocation, String expectedType, Class<?> actualType, int argumentIndex) static MockitoException
Reporter.wrongTypeOfReturnValue
(String expectedType, String actualType, String methodName) static MockitoException
Reporter.wrongTypeReturnedByDefaultAnswer
(Object mock, String expectedType, String actualType, String methodName)