Annotation Type DisableIfDisplayName
@Target(METHOD)
@Retention(RUNTIME)
@ExtendWith(DisableIfNameExtension.class)
public @interface DisableIfDisplayName
@DisableIfDisplayName is a JUnit Jupiter extension that can be used to
selectively disable a ParameterizedTest execution 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, or if both are present,
the extension will throw an exception.
- Since:
- 0.7
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]Disable test cases whose display name contain the specified strings (according toString.contains(CharSequence)).String[]Disable test cases whose display name matches the specified regular expression (according toString.matches(java.lang.String)).
-
Element Details
-
contains
String[] containsDisable test cases whose display name contain the specified strings (according toString.contains(CharSequence)).- Returns:
- test case display name substrings
- Default:
{}
-
matches
String[] matchesDisable test cases whose display name matches the specified regular expression (according toString.matches(java.lang.String)).- Returns:
- test case display name regular expressions
- Default:
{}
-