Package org.mockito.exceptions.misusing
package org.mockito.exceptions.misusing
Exceptions thrown when Mockito is misused.
-
Exception ClassesClassDescriptionThrown when a mock is accessed after it has been disabled by
MockitoFramework.clearInlineMocks()
.Thrown when attempting to mock a class that is annotated withDoNotMock
.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.