Annotation Type CartesianProductTest
@CartesianProductTest
is a JUnit Jupiter extension that marks
a test to be executed with all possible input combinations.
Methods annotated with this annotation should not be annotated with Test
.
This annotation is somewhat similar to @ParameterizedTest
, as in it also takes
arguments and can run the same test multiple times. With @CartesianProductTest
you
don't specify the test cases themselves. though. Instead you specify possible values for
each test method parameter (see @CartesianValueSource
) and the extension runs the
method with each possible combination.
You can specify a custom Display Name for the tests ran by @CartesianProductTest
.
By default it's [{index}] {arguments}.
For more details and examples, see
the documentation on @CartesianProductTest
.
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated.CartesianProductTest has been superseded by CartesianTest, scheduled to be removed in 2.0 -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDeprecated.Specifies the name of the method that supplies theSets
for the test.Deprecated.The display name to be used for individual invocations of the parameterized test; never blank or consisting solely of whitespace.String[]
Deprecated.SpecifiesString
values for all inputs simultaneously.
-
Element Details
-
name
String nameDeprecated.The display name to be used for individual invocations of the parameterized test; never blank or consisting solely of whitespace.
Defaults to
Supported placeholders: -ParameterizedTest.DEFAULT_DISPLAY_NAME
.ParameterizedTest.DISPLAY_NAME_PLACEHOLDER
-ParameterizedTest.INDEX_PLACEHOLDER
-ParameterizedTest.ARGUMENTS_PLACEHOLDER
-{0}
,{1}
, etc.: an individual argument (0-based)For the latter, you may use
MessageFormat
patterns to customize formatting.- See Also:
- Default:
- "[{index}] {arguments}"
-
value
String[] valueDeprecated.SpecifiesString
values for all inputs simultaneously.- Default:
- {}
-
factory
String factoryDeprecated.Specifies the name of the method that supplies theSets
for the test.- Default:
- ""
-