Class SimpleArgumentsAggregator
java.lang.Object
org.junit.jupiter.params.aggregator.SimpleArgumentsAggregator
- All Implemented Interfaces:
ArgumentsAggregator
@API(status=EXPERIMENTAL,
since="6.0")
public abstract class SimpleArgumentsAggregator
extends Object
implements ArgumentsAggregator
SimpleArgumentsAggregator is an abstract base class for
ArgumentsAggregator implementations that do not need to distinguish
between fields and method/constructor parameters.- Since:
- 5.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable ObjectaggregateArguments(ArgumentsAccessor accessor, Class<?> targetType, AnnotatedElementContext context, int parameterIndex) @Nullable ObjectaggregateArguments(ArgumentsAccessor accessor, ParameterContext context) Aggregate the arguments contained in the suppliedaccessorinto a single object.@Nullable ObjectaggregateArguments(ArgumentsAccessor accessor, FieldContext context) Aggregate the arguments contained in the suppliedaccessorinto a single object.
-
Constructor Details
-
SimpleArgumentsAggregator
public SimpleArgumentsAggregator()
-
-
Method Details
-
aggregateArguments
public @Nullable Object aggregateArguments(ArgumentsAccessor accessor, ParameterContext context) throws ArgumentsAggregationException Description copied from interface:ArgumentsAggregatorAggregate the arguments contained in the suppliedaccessorinto a single object.- Specified by:
aggregateArgumentsin interfaceArgumentsAggregator- Parameters:
accessor- anArgumentsAccessorcontaining the arguments to be aggregated; nevernullcontext- the parameter context where the aggregated result is to be supplied; nevernull- Returns:
- the aggregated result; may be
nullbut only if the target type is a reference type - Throws:
ArgumentsAggregationException- if an error occurs during the aggregation
-
aggregateArguments
public @Nullable Object aggregateArguments(ArgumentsAccessor accessor, FieldContext context) throws ArgumentsAggregationException Description copied from interface:ArgumentsAggregatorAggregate the arguments contained in the suppliedaccessorinto a single object.- Specified by:
aggregateArgumentsin interfaceArgumentsAggregator- Parameters:
accessor- anArgumentsAccessorcontaining the arguments to be aggregated; nevernullcontext- the field context where the aggregated result is to be injected; nevernull- Returns:
- the aggregated result; may be
nullbut only if the target type is a reference type - Throws:
ArgumentsAggregationException- if an error occurs during the aggregation
-
aggregateArguments
protected abstract @Nullable Object aggregateArguments(ArgumentsAccessor accessor, Class<?> targetType, AnnotatedElementContext context, int parameterIndex) throws ArgumentsAggregationException - Throws:
ArgumentsAggregationException
-