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 TypeClassDescriptionclassException generated whenInstantiator.newInstance(Class)failed. -
Uses of MockitoException in org.mockito.exceptions.misusing
Subclasses of MockitoException in org.mockito.exceptions.misusingModifier and TypeClassDescriptionclassclassclassThrown when a mock is accessed after it has been disabled byMockitoFramework.clearInlineMocks().classThrown when attempting to mock a class that is annotated withDoNotMock.classclassThrown when creation of test subject annotated with InjectMocks fails.classclassclassclassclassclassPotentialStubbingProblemimproves productivity by failing the test early when the user misconfigures mock's stubbing.classReported when instance ofMockitoListeneris being added to Mockito (seeMockitoFramework) and there is already a listener with this implementation type registered.classThis exception prevents the user from forgetting to useMockitoSession.finishMocking().classclassclassThis 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 MockitoExceptionReporter.atMostAndNeverShouldNotBeUsedWithTimeout()static MockitoExceptionReporter.cannotCallAbstractRealMethod()static MockitoExceptionReporter.cannotCreateTimerWithNegativeDurationTime(long durationMillis) static MockitoExceptionReporter.cannotInitializeForInjectMocksAnnotation(String fieldName, String causeMessage) static MockitoExceptionReporter.cannotInitializeForSpyAnnotation(String fieldName, Exception details) static MockitoExceptionReporter.cannotInjectDependency(Field field, Object matchingMock, Exception details) static MockitoExceptionReporter.cannotMockClass(Class<?> clazz, String reason) static MockitoExceptionReporter.cannotStubVoidMethodWithAReturnValue(String methodName) static MockitoExceptionReporter.cannotStubWithNullThrowable()static MockitoExceptionReporter.cannotVerifyToString()static MockitoExceptionReporter.checkedExceptionInvalid(Throwable t) static MockitoExceptionReporter.defaultAnswerDoesNotAcceptNullParameter()static MockitoExceptionReporter.delegatedMethodDoesNotExistOnDelegate(Method mockMethod, Object mock, Object delegate) static MockitoExceptionReporter.delegatedMethodHasWrongReturnType(Method mockMethod, Method delegateMethod, Object mock, Object delegate) static MockitoExceptionReporter.extraInterfacesAcceptsOnlyInterfaces(Class<?> wrongType) static MockitoExceptionReporter.extraInterfacesCannotContainMockedType(Class<?> wrongType) static MockitoExceptionReporter.extraInterfacesDoesNotAcceptNullParameters()static MockitoExceptionReporter.extraInterfacesRequiresAtLeastOneInterface()static MockitoExceptionReporter.fieldInitialisationThrewException(Field field, Throwable details) static MockitoExceptionReporter.incorrectUseOfAdditionalMatchers(String additionalMatcherName, int expectedSubMatchersCount, Collection<LocalizedMatcher> matcherStack) static MockitoExceptionReporter.incorrectUseOfApi()static MockitoExceptionReporter.inlineClassWithoutUnboxImpl(Class<?> inlineClass, Exception details) static MockitoExceptionReporter.inOrderRequiresFamiliarMock()static MockitoExceptionReporter.invalidArgumentPositionRangeAtInvocationTime(InvocationOnMock invocation, boolean willReturnLastParameter, int argumentIndex) static MockitoExceptionstatic MockitoExceptionReporter.invalidUseOfMatchers(int expectedMatchersCount, List<LocalizedMatcher> recordedMatchers) static MockitoExceptionReporter.invocationListenerThrewException(InvocationListener listener, Throwable listenerThrowable) static MockitoExceptionReporter.methodDoesNotAcceptParameter(String method, String parameter) static MockitoExceptionReporter.misplacedArgumentMatcher(List<LocalizedMatcher> lastMatchers) static MockitoExceptionReporter.missingMethodInvocation()static MockitoExceptionReporter.mockedTypeIsInconsistentWithDelegatedInstanceType(Class<?> mockedType, Object delegatedInstance) static MockitoExceptionReporter.mockedTypeIsInconsistentWithSpiedInstanceType(Class<?> mockedType, Object spiedInstance) static MockitoExceptionstatic MockitoExceptionReporter.mocksHaveToBePassedWhenCreatingInOrder()static MockitoExceptionReporter.moreThanOneAnnotationNotAllowed(String fieldName) static MockitoExceptionReporter.moreThanOneMockCandidate(Field field, Collection<?> mockCandidates) static MockitoExceptionReporter.noArgumentValueWasCaptured()static MockitoExceptionReporter.notAMockPassedToVerify(Class<?> type) static MockitoExceptionReporter.notAMockPassedToVerifyNoMoreInteractions()static MockitoExceptionReporter.notAMockPassedToWhenMethod()static MockitoExceptionReporter.notAMockPassedWhenCreatingInOrder()static MockitoExceptionReporter.notAnException()static MockitoExceptionReporter.nullPassedToVerify()static MockitoExceptionReporter.nullPassedToVerifyNoMoreInteractions()static MockitoExceptionReporter.nullPassedToWhenMethod()static MockitoExceptionReporter.nullPassedWhenCreatingInOrder()static MockitoExceptionReporter.onlyVoidMethodsCanBeSetToDoNothing()static MockitoExceptionReporter.reportNoSubMatchersFound(String additionalMatcherName) static MockitoExceptionReporter.requiresAtLeastOneListener(String method) static MockitoExceptionReporter.serializableWontWorkForObjectsThatDontImplementSerializable(Class<?> classToMock) static MockitoExceptionReporter.smartNullPointerException(String invocation, Location location) static MockitoExceptionReporter.spyAndDelegateAreMutuallyExclusive()static MockitoExceptionReporter.strictnessDoesNotAcceptNullParameter()static MockitoExceptionReporter.stubPassedToVerify(Object mock) static MockitoExceptionReporter.unfinishedStubbing(Location location) static MockitoExceptionReporter.unfinishedVerificationException(Location location) static MockitoExceptionReporter.unsupportedCombinationOfAnnotations(String undesiredAnnotationOne, String undesiredAnnotationTwo) static MockitoExceptionReporter.usingConstructorWithFancySerializable(SerializableMode mode) static MockitoExceptionReporter.wrongTypeOfArgumentToReturn(InvocationOnMock invocation, String expectedType, Class<?> actualType, int argumentIndex) static MockitoExceptionReporter.wrongTypeOfReturnValue(String expectedType, String actualType, String methodName) static MockitoExceptionReporter.wrongTypeReturnedByDefaultAnswer(Object mock, String expectedType, String actualType, String methodName)