Package org.mockito.exceptions.misusing
package org.mockito.exceptions.misusing
Exceptions thrown when Mockito is misused.
-
ClassDescriptionThrown when attempting to mock a class that is annotated with
DoNotMock
.Thrown when creation of test subject annotated with InjectMocks fails.PotentialStubbingProblem
improves productivity by failing the test early when the user misconfigures mock's stubbing.Reported when instance ofMockitoListener
is being added to Mockito (seeMockitoFramework
) and there is already a listener with this implementation type registered.This exception prevents the user from forgetting to useMockitoSession.finishMocking()
.This exception indicates presence of unused stubbings.