public class MockitoAssertionError extends AssertionError
Mockito.verify(Object)
or Mockito.verifyNoMoreInteractions(Object...)
.
All error 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 using getUnfilteredStackTrace()
.
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.
Constructor and Description |
---|
MockitoAssertionError(AssertionError error,
String message)
Creates a copy of the given assertion error with the custom failure message prepended.
|
MockitoAssertionError(MockitoAssertionError error,
String message)
Creates a copy of the given assertion error with the custom failure message prepended.
|
MockitoAssertionError(String message) |
Modifier and Type | Method and Description |
---|---|
StackTraceElement[] |
getUnfilteredStackTrace() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public MockitoAssertionError(String message)
public MockitoAssertionError(MockitoAssertionError error, String message)
error
- The assertion error to copymessage
- The custom message to prependpublic MockitoAssertionError(AssertionError error, String message)
error
- The assertion error to copymessage
- The custom message to prependpublic StackTraceElement[] getUnfilteredStackTrace()