@API(status=EXPERIMENTAL, since="5.2") public interface ArgumentsAggregator
ArgumentsAggregatoris an abstraction for the aggregation of arguments provided by an
ArgumentsProviderfor a single invocation of a
@ParameterizedTestmethod into a single object.
ArgumentsAggregatoris applied to a method parameter of a
@ParameterizedTestmethod via the
The result of the aggregation will be passed as an argument to the
@ParameterizedTestmethod for the annotated parameter.
A common use case is the aggregation of multiple columns from a single line in a CSV file into a domain object such as a
Implementations must provide a no-args constructor and should not make any assumptions on when they are instantiated or how often they are called. Since instances may potentially be cached and called from different threads they should be thread-safe and designed to be used as singletons.
Object aggregateArguments(ArgumentsAccessor accessor, ParameterContext context) throws ArgumentsAggregationExceptionAggregate the arguments contained in the supplied
accessorinto a single object.
ArgumentsAccessorcontaining the arguments to be aggregated; never
context- the parameter context where the aggregated result is to be supplied; never
- the aggregated result; may be
nullbut only if the target type is a reference type
ArgumentsAggregationException- if an error occurs during the aggregation