Annotation Type CartesianTest
@CartesianTest 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 @CartesianTest you
don't specify the test cases themselves, though. Instead you specify possible values for
each test method parameter (for example with @CartesianTest.Values) by annotating the parameters
themselves and the extension runs the method with each possible combination.
You can specify a custom Display Name for the tests ran by @CartesianTest.
By default it's [{index}] {arguments}.
For more details and examples, see
the documentation on @CartesianTest.
- Since:
- 1.5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceParameter annotation to be used withCartesianTestfor providing enum values.static @interfacePoints to a method to provide parameter values for aCartesianTest.static @interfaceParameter annotation to be used withCartesianTestfor providing simple values. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPlaceholder for the complete, comma-separated arguments list of the current invocation of a@CartesianTestmethod:{arguments}static final StringPlaceholder for the display name of a@CartesianTest:{displayName}static final StringPlaceholder for the current invocation index of a@CartesianTestmethod (1-based):{index} -
Optional Element Summary
Optional Elements
-
Field Details
-
DISPLAY_NAME_PLACEHOLDER
Placeholder for the display name of a@CartesianTest:{displayName}- Since:
- 1.5
- See Also:
-
INDEX_PLACEHOLDER
Placeholder for the current invocation index of a@CartesianTestmethod (1-based):{index}- Since:
- 1.5
- See Also:
-
ARGUMENTS_PLACEHOLDER
Placeholder for the complete, comma-separated arguments list of the current invocation of a@CartesianTestmethod:{arguments}- Since:
- 1.5
- See Also:
-
-
Element Details
-
name
String nameThe display name to be used for individual invocations of the parameterized test; never blank or consisting solely of whitespace.Defaults to [{index}] {arguments}.
Supported placeholders:
DISPLAY_NAME_PLACEHOLDERINDEX_PLACEHOLDERARGUMENTS_PLACEHOLDER{0},{1}, etc.: an individual argument (0-based)
For the latter, you may use
MessageFormatpatterns to customize formatting.- Since:
- 1.5
- See Also:
- Default:
"[{index}] {arguments}"
-