Package org.mockito.exceptions.base
Class MockitoException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.mockito.exceptions.base.MockitoException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CannotStubVoidMethodWithReturnValue
,CannotVerifyStubOnlyMock
,FriendlyReminderException
,InjectMocksException
,InstantiationException
,InstantiationException
,InvalidUseOfMatchersException
,MissingMethodInvocationException
,MockitoConfigurationException
,NotAMockException
,NullInsteadOfMockException
,PotentialStubbingProblem
,RedundantListenerException
,SmartNullPointerException
,UnfinishedMockingSessionException
,UnfinishedStubbingException
,UnfinishedVerificationException
,UnnecessaryStubbingException
,WrongTypeOfReturnValue
public class MockitoException extends java.lang.RuntimeException
Raised by mockito to emit an error either due to Mockito, or due to the User. All exception classes that inherit from this class will have the stack trace filtered. Filtering removes Mockito internal stack trace elements to provide clean stack traces and improve productivity.The stack trace is filtered from mockito calls if you are using
Throwable.getStackTrace()
. For debugging purpose though you can still access the full stacktrace usinggetUnfilteredStackTrace()
. However note that other calls related to the stackTrace will refer to the filter stacktrace.Advanced users and framework integrators can control stack trace filtering behavior via
StackTraceCleanerProvider
classpath plugin.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private java.lang.StackTraceElement[]
unfilteredStackTrace
-
Constructor Summary
Constructors Constructor Description MockitoException(java.lang.String message)
MockitoException(java.lang.String message, java.lang.Throwable t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
filterStackTrace()
java.lang.StackTraceElement[]
getUnfilteredStackTrace()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
unfilteredStackTrace
private java.lang.StackTraceElement[] unfilteredStackTrace
-
-