@API(status=EXPERIMENTAL, since="5.0") public class VerifierSupport extends java.lang.Object implements AfterEachCallback
Extension
provides native support for subclasses of
the Verifier
rule from JUnit 4.
@Rule
-annotated fields as well as methods are supported.
By using this class-level extension on a test class such
Verifier
implementations in legacy code bases
can be left unchanged including the JUnit 4 rule import statements.
However, if you intend to develop a new extension for JUnit 5 please use the new extension model of JUnit Jupiter instead of the rule-based model of JUnit 4.
Verifier
,
TestRule
,
Rule
Modifier and Type | Field and Description |
---|---|
private java.util.function.Function<TestRuleAnnotatedMember,AbstractTestRuleAdapter> |
adapterGenerator |
private TestRuleFieldSupport |
fieldSupport |
private TestRuleMethodSupport |
methodSupport |
Constructor and Description |
---|
VerifierSupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterEach(ExtensionContext context)
Callback that is invoked after each test has been invoked.
|
private final java.util.function.Function<TestRuleAnnotatedMember,AbstractTestRuleAdapter> adapterGenerator
private final TestRuleFieldSupport fieldSupport
private final TestRuleMethodSupport methodSupport
public void afterEach(ExtensionContext context) throws java.lang.Exception
AfterEachCallback
afterEach
in interface AfterEachCallback
context
- the current extension context; never null
java.lang.Exception