Class AggregationUtils
- java.lang.Object
-
- org.junit.jupiter.params.aggregator.AggregationUtils
-
@API(status=INTERNAL, since="5.2") public class AggregationUtils extends Object
Collection of utilities for working with aggregating argument consumers in parameterized tests (i.e., parameters of typeArgumentsAccessor
or annotated with@AggregateWith
).- Since:
- 5.2
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
hasAggregator(Method method)
static boolean
hasPotentiallyValidSignature(Method method)
Determine if the suppliedMethod
has a potentially valid signature (i.e., formal parameter declarations) with regard to aggregators.static int
indexOfFirstAggregator(Method method)
static boolean
isAggregator(Parameter parameter)
Determine if the suppliedParameter
is an aggregator (i.e., of typeArgumentsAccessor
or annotated withAggregateWith
).
-
-
-
Method Detail
-
hasPotentiallyValidSignature
public static boolean hasPotentiallyValidSignature(Method method)
Determine if the suppliedMethod
has a potentially valid signature (i.e., formal parameter declarations) with regard to aggregators.This method takes a best-effort approach at enforcing the following policy for parameterized test methods that accept aggregators as arguments.
- zero or more indexed arguments come first.
- zero or more aggregators come next.
- zero or more arguments supplied by other
ParameterResolver
implementations come last.
- Returns:
true
if the method has a potentially valid signature
-
isAggregator
public static boolean isAggregator(Parameter parameter)
Determine if the suppliedParameter
is an aggregator (i.e., of typeArgumentsAccessor
or annotated withAggregateWith
).- Returns:
true
if the parameter is an aggregator
-
hasAggregator
public static boolean hasAggregator(Method method)
- Returns:
true
if the method has an aggregator
-
indexOfFirstAggregator
public static int indexOfFirstAggregator(Method method)
- Returns:
- the index of the first aggregator, or
-1
if not found
-
-