- java.lang.Object
-
- org.junitpioneer.jupiter.cartesian.ArgumentSets
-
public class ArgumentSets extends java.lang.ObjectClass for defining sets to aCartesianTestexecution with arguments for each parameter in the order in which they appear in the test method.Use the static factory method
argumentsForFirstParameterto create an instance and callargumentsForNextParameterfor each parameter after the first. Alternatively, call the static factory methodcreateto create an instance callargumentsForNextParameterfor each parameter.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.util.List<?>>arguments
-
Constructor Summary
Constructors Modifier Constructor Description privateArgumentSets()privateArgumentSets(java.util.Collection<?> arguments)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private ArgumentSetsadd(java.util.Collection<?> arguments)static <T> ArgumentSetsargumentsForFirstParameter(java.util.Collection<T> arguments)Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passedCollection.static <T> ArgumentSetsargumentsForFirstParameter(java.util.stream.Stream<T> arguments)Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passedStream.static <T> ArgumentSetsargumentsForFirstParameter(T... arguments)Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passed objects.<T> ArgumentSetsargumentsForNextParameter(java.util.Collection<T> arguments)Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passedCollection.<T> ArgumentSetsargumentsForNextParameter(java.util.stream.Stream<T> arguments)Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passedStream.<T> ArgumentSetsargumentsForNextParameter(T... arguments)Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passed objects.static ArgumentSetscreate()Creates a newArgumentSetswithout arguments for any parameters.(package private) java.util.List<java.util.List<?>>getArguments()
-
-
-
Method Detail
-
add
private ArgumentSets add(java.util.Collection<?> arguments)
-
create
public static ArgumentSets create()
Creates a newArgumentSetswithout arguments for any parameters.
-
argumentsForFirstParameter
public static <T> ArgumentSets argumentsForFirstParameter(java.util.Collection<T> arguments)
Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passedCollection.The passed argument does not have to be an instance of
Set.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- a new
ArgumentSetsobject
-
argumentsForFirstParameter
@SafeVarargs public static <T> ArgumentSets argumentsForFirstParameter(T... arguments)
Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passed objects.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- a new
ArgumentSetsobject
-
argumentsForFirstParameter
public static <T> ArgumentSets argumentsForFirstParameter(java.util.stream.Stream<T> arguments)
Creates a single set of distinct objects (according to theirequals) for the first parameter of aCartesianTestfrom the elements of the passedStream.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- a new
ArgumentSetsobject
-
argumentsForNextParameter
public final <T> ArgumentSets argumentsForNextParameter(java.util.Collection<T> arguments)
Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passedCollection.The passed argument does not have to be an instance of
Set.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- this
ArgumentSetsobject, for fluent set definitions
-
argumentsForNextParameter
@SafeVarargs public final <T> ArgumentSets argumentsForNextParameter(T... arguments)
Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passed objects.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- this
ArgumentSetsobject, for fluent set definitions
-
argumentsForNextParameter
public final <T> ArgumentSets argumentsForNextParameter(java.util.stream.Stream<T> arguments)
Creates a single set of distinct objects (according to theirequals) for the next parameter of aCartesianTestfrom the elements of the passedStream.- Parameters:
arguments- the objects that should be passed to the parameter- Returns:
- this
ArgumentSetsobject, for fluent set definitions
-
getArguments
java.util.List<java.util.List<?>> getArguments()
-
-