spring-framework / org.springframework.test.context.junit4.statements / RunAfterTestMethodCallbacks

RunAfterTestMethodCallbacks

open class RunAfterTestMethodCallbacks : Statement

RunAfterTestMethodCallbacks is a custom JUnit Statement which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling afterTestMethod() on the supplied TestContextManager.

NOTE: This class requires JUnit 4.9 or higher.

Author
Sam Brannen

Since
3.0

See Also
#evaluate()RunBeforeTestMethodCallbacks

Constructors

<init>

RunAfterTestMethodCallbacks(next: Statement, testInstance: Any, testMethod: Method, testContextManager: TestContextManager)

Construct a new RunAfterTestMethodCallbacks statement.

Functions

evaluate

open fun evaluate(): Unit

Evaluate the next Statement in the execution chain (typically an instance of org.junit.internal.runners.statements.RunAfters), catching any exceptions thrown, and then invoke TestContextManager#afterTestMethod(Object, Method, Throwable) supplying the first caught exception (if any).

If the invocation of afterTestMethod() throws an exception, that exception will also be tracked. Multiple exceptions will be combined into a MultipleFailureException.