DynamicTest is a test case generated at runtime.
It is composed of a display name
and an Executable.
Instances of DynamicTest must be generated by factory methods
annotated with @TestFactory.
Note that dynamic tests are quite different from standard @Test
cases since callbacks such as @BeforeEach and
@AfterEach methods are not executed for dynamic tests.
dynamicTest(String, Executable), stream(Iterator, Function, ThrowingConsumer), Test, TestFactory, DynamicContainer, Executable
| Modifier and Type | Field and Description |
|---|---|
| private final Executable |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static DynamicTest | dynamicTest(String
the display name for the dynamic test; never
displayName, Executable null or blankthe executable code block for the dynamic test;
never executable)nullFactory for creating a new |
| public static DynamicTest | dynamicTest(String
the display name for the dynamic test; never
displayName, @Nullable URI null or blanka custom test source URI for the dynamic test; may
be testSourceUri, Executable null if the framework should generate the test source based on
the @TestFactory methodthe executable code block for the dynamic test;
never executable)nullFactory for creating a new |
| public Executable | |
| public static < the type of input generated by the T> StreaminputGenerator
and used by the displayNameGenerator and testExecutor | Returns: a stream of dynamic tests based on the given generator and executor; nevernullan inputGenerator, Function<? super T, String> Iterator that serves as a dynamic
input generator; never nulla function that generates a display name
based on an input value; never displayNameGenerator, ThrowingConsumer<? super T> nulla consumer that executes a test based on an input
value; never testExecutor)nullGenerate a stream of dynamic tests based on the given generator and test executor. |
| public static < the type of input supplied by the T> StreaminputStream
and used by the displayNameGenerator and testExecutor | Returns: a stream of dynamic tests based on the given generator and executor; nevernulla inputStream, Function<? super T, String> Stream that supplies dynamic input values;
never nulla function that generates a display name
based on an input value; never displayNameGenerator, ThrowingConsumer<? super T> nulla consumer that executes a test based on an input
value; never testExecutor)nullGenerate a stream of dynamic tests based on the given input stream and test executor. |
| public static < the type of input generated by the T> StreaminputGenerator
and used by the testExecutor | Returns: a stream of dynamic tests based on the given generator and executor; nevernullan inputGenerator, ThrowingConsumer<? super T> Iterator with Named values
that serves as a dynamic input generator; never nulla consumer that executes a test based on an input
value; never testExecutor)nullGenerate a stream of dynamic tests based on the given generator and test executor. |
| public static < the type of input supplied by the T> StreaminputStream
and used by the displayNameGenerator and testExecutor | Returns: a stream of dynamic tests based on the given generator and executor; nevernulla inputStream, ThrowingConsumer<? super T> Stream that supplies dynamic Named
input values; never nulla consumer that executes a test based on an input
value; never testExecutor)nullGenerate a stream of dynamic tests based on the given input stream and test executor. |
| public static < the type of input supplied by the T extends NamedinputStream | |
| public static < the type of input supplied by the T extends NamedinputStream |
| executable | back to summary |
|---|---|
| private final Executable executable | |
| DynamicTest | back to summary |
|---|---|
| private DynamicTest(String displayName, @Nullable URI testSourceUri, Executable executable) | |
| dynamicTest | back to summary |
|---|---|
| public static DynamicTest dynamicTest(String displayName, Executable executable) Factory for creating a new
| |
| dynamicTest | back to summary |
|---|---|
| public static DynamicTest dynamicTest(String displayName, @Nullable URI testSourceUri, Executable executable) Factory for creating a new
| |
| getExecutable | back to summary |
|---|---|
| public Executable getExecutable() Get the | |
| stream | back to summary |
|---|---|
| public static <T> Stream Generate a stream of dynamic tests based on the given generator and test executor. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |
| stream | back to summary |
|---|---|
| public static <T> Stream Generate a stream of dynamic tests based on the given input stream and test executor. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |
| stream | back to summary |
|---|---|
| public static <T> Stream Generate a stream of dynamic tests based on the given generator and test executor. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |
| stream | back to summary |
|---|---|
| public static <T> Stream Generate a stream of dynamic tests based on the given input stream and test executor. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |
| stream | back to summary |
|---|---|
| public static <T extends Named Generate a stream of dynamic tests based on the given iterator. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |
| stream | back to summary |
|---|---|
| public static <T extends Named Generate a stream of dynamic tests based on the given input stream. Use this method when the set of dynamic tests is nondeterministic in
nature or when the input comes from an existing The given
| |