Package org.junitpioneer.jupiter.params
Annotation Type DisableIfAnyArgument
@Target(METHOD)
@Retention(RUNTIME)
@ExtendWith(org.junitpioneer.jupiter.params.DisableIfArgumentExtension.class)
public @interface DisableIfAnyArgument
@DisableIfAnyArgument
is a JUnit Jupiter extension that selectively disables
a ParameterizedTest
execution if at least one
argument (as defined by Object.toString()
) satisfies the specified condition.
The extension uses Jupiter's InvocationInterceptor
.
It's important to note that since it's marked as API.Status.EXPERIMENTAL
it might be removed without prior notice.
Unlike Disabled
annotations, this extension doesn't disable the whole test method.
With DisableIfAnyArgument
, it is possible to selectively disable tests out of the plethora
of dynamically registered parameterized tests.
The extension requires that exactly one of contains
or
matches
is configured.
For more information how the extension resolves the annotations, check the documentation.
- Since:
- 1.5.0
- See Also:
-
DisableIfArgumentExtension
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
Disable test cases if any argument (converted to String withObject.toString()
) contains any of the the specified strings (according toString.contains(CharSequence)
).String[]
Disable test cases if any argument (converted to String withObject.toString()
) matches any of the specified regular expressions (according toString.matches(String)
).
-
Element Details
-
contains
String[] containsDisable test cases if any argument (converted to String withObject.toString()
) contains any of the the specified strings (according toString.contains(CharSequence)
).- Default:
- {}
-
matches
String[] matchesDisable test cases if any argument (converted to String withObject.toString()
) matches any of the specified regular expressions (according toString.matches(String)
).- Default:
- {}
-