Package org.mockito.exceptions.misusing
Exceptions thrown when Mockito is misused.
-
Exception Summary Exception Description CannotStubVoidMethodWithReturnValue CannotVerifyStubOnlyMock DoNotMockException Thrown when attempting to mock a class that is annotated withDoNotMock
.FriendlyReminderException InjectMocksException Thrown when creation of test subject annotated with InjectMocks fails.InvalidUseOfMatchersException MissingMethodInvocationException MockitoConfigurationException NotAMockException NullInsteadOfMockException PotentialStubbingProblem PotentialStubbingProblem
improves productivity by failing the test early when the user misconfigures mock's stubbing.RedundantListenerException Reported when instance ofMockitoListener
is being added to Mockito (seeMockitoFramework
) and there is already a listener with this implementation type registered.UnfinishedMockingSessionException This exception prevents the user from forgetting to useMockitoSession.finishMocking()
.UnfinishedStubbingException UnfinishedVerificationException UnnecessaryStubbingException This exception indicates presence of unused stubbings.WrongTypeOfReturnValue