@Target(value={ANNOTATION_TYPE,METHOD}) @Retention(value=RUNTIME) @Documented @API(value=Experimental) public @interface TestFactory
@TestFactory
is used to signal that the annotated method is a
test factory method.
In contrast to @Test
methods, a test factory is not itself
a test case but rather a factory for test cases.
@TestFactory
methods must not be private
or static
and must return a Stream
, Collection
, Iterable
, or
Iterator
of DynamicTest
instances. These DynamicTests
will then be executed lazily, enabling dynamic and even non-deterministic
generation of test cases.
@TestFactory
methods may optionally declare parameters to be
resolved by ParameterResolvers
.
Test
,
DynamicTest