Annotation Interface ConstraintsMethodSource
Reference to a method providing a Stream, Collection or array of constraint annotations tuples
for a
TestTemplate.
The method will be invoked by the KafkaClusterExtension
to provide a list of constraint lists over which the test will parameterized.
The annotation should be used on a KafkaCluster-typed parameter of a
TestTemplate-annotated method.
The referenced method must be static and package- or publicly-accessible.
For example
static Stream<List<Annotation>> clusters() {
return Stream.of(
List.of(ConstraintUtils.brokerCluster(1), ConstraintUtils.kraftCluster(1)),
List.of(ConstraintUtils.brokerCluster(3), ConstraintUtils.kraftCluster(1)),
List.of(ConstraintUtils.brokerCluster(3), ConstraintUtils.zooKeeperCluster()));
}
@TestTemplate
void matrixTest(@ConstraintMethodSource("clusters") KafkaCluster cluster) {
// ....
}
*
If you want to execute a tests for each of the Cartesian product
of a number of dimensions you might find @DimensionMethodSource
more convenient.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements