java.lang.Object
org.junit.jupiter.api.DynamicNode
org.junit.jupiter.api.DynamicContainer
A
DynamicContainer
is a container generated at runtime.
It is composed of a display name
and an Iterable
or Stream
of DynamicNodes
.
Instances of DynamicContainer
must be generated by factory methods
annotated with @TestFactory
.
- Since:
- 5.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DynamicContainer
dynamicContainer
(String displayName, Iterable<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name and collection of dynamic nodes.static DynamicContainer
dynamicContainer
(String displayName, URI testSourceUri, Stream<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name, custom test sourceURI
, and stream of dynamic nodes.static DynamicContainer
dynamicContainer
(String displayName, Stream<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name and stream of dynamic nodes.Stream<? extends DynamicNode>
Methods inherited from class org.junit.jupiter.api.DynamicNode
getDisplayName, getTestSourceUri, toString
-
Method Details
-
dynamicContainer
public static DynamicContainer dynamicContainer(String displayName, Iterable<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name and collection of dynamic nodes.The collection of dynamic nodes must not contain
null
elements.- Parameters:
displayName
- the display name for the dynamic container; nevernull
or blankdynamicNodes
- collection of dynamic nodes to execute; nevernull
- See Also:
-
dynamicContainer
public static DynamicContainer dynamicContainer(String displayName, Stream<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name and stream of dynamic nodes.The stream of dynamic nodes must not contain
null
elements.- Parameters:
displayName
- the display name for the dynamic container; nevernull
or blankdynamicNodes
- stream of dynamic nodes to execute; nevernull
- See Also:
-
dynamicContainer
public static DynamicContainer dynamicContainer(String displayName, URI testSourceUri, Stream<? extends DynamicNode> dynamicNodes) Factory for creating a newDynamicContainer
for the supplied display name, custom test sourceURI
, and stream of dynamic nodes.The stream of dynamic nodes must not contain
null
elements.- Parameters:
displayName
- the display name for the dynamic container; nevernull
or blanktestSourceUri
- a custom test source URI for the dynamic container; may benull
if the framework should generate the test source based on the@TestFactory
methoddynamicNodes
- stream of dynamic nodes to execute; nevernull
- Since:
- 5.3
- See Also:
-
getChildren
-