@FunctionalInterface @API(value=Experimental) public interface ExceptionHandlerExtensionPoint extends ExtensionPoint
ExceptionHandlerExtensionPoint defines the API for Extensions
that wish to react to thrown exceptions in tests.
Common use cases include swallowing an exception if it's anticipated or rolling back a transaction in certain error scenarios.
Implementations must provide a no-args constructor.
| Modifier and Type | Method and Description |
|---|---|
void |
handleException(TestExtensionContext context,
java.lang.Throwable throwable)
React to a
throwable which has been thrown by a test method. |
void handleException(TestExtensionContext context, java.lang.Throwable throwable) throws java.lang.Throwable
throwable which has been thrown by a test method.
Implementors have to decide if they
throwableException or ThrowablethrowableIf the incoming throwable is swallowed, other registered
exception handlers
with later Position
will not be called. Otherwise, the next exception handler
will be called with the freshly thrown Throwable.
java.lang.Throwable