@Target(value=METHOD) @Retention(value=RUNTIME) @ExtendWith(value=DisableIfNameExtension.class) public @interface DisableIfDisplayName
@DisableIfDisplayName
is a JUnit Jupiter extension that can be used to
selectively disable ParameterizedTest
based on their
display name
.
The extension is an ExecutionCondition
that validates dynamically registered tests.
Unlike Disabled
annotations, this extension doesn't disable the whole test method.
With DisableIfDisplayName
, it is possible to selectively disable tests out of the plethora
of dynamically registered parameterized tests.
If neither contains
nor
matches
is configured, the extension will throw an exception.
It is possible to configure both, in which case the test gets disabled if at least one substring
was found or at least one regular expression matched.
DisableIfNameExtension
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String[] |
contains
Disable test cases whose display name contain the specified strings
(according to
String.contains(CharSequence) ). |
java.lang.String[] |
matches
Disable test cases whose display name matches the specified regular rxpression
(according to
String.matches(java.lang.String) ). |