@TestTemplate
@ExtendWith(value=org.junitpioneer.jupiter.CartesianProductTestExtension.class)
@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface 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
.
CartesianValueSource