Class AggregationUtils



  • @API(status=INTERNAL,
         since="5.2")
    public class AggregationUtils
    extends java.lang.Object
    Collection of utilities for working with aggregating argument consumers in parameterized tests (i.e., parameters of type ArgumentsAccessor or annotated with @AggregateWith).
    Since:
    5.2
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasAggregator​(java.lang.reflect.Method method)
      Determine if the supplied Method declares at least one Parameter that is an aggregator.
      static boolean hasPotentiallyValidSignature​(java.lang.reflect.Method method)
      Determine if the supplied Method has a potentially valid signature (i.e., formal parameter declarations) with regard to aggregators.
      static int indexOfFirstAggregator​(java.lang.reflect.Method method)
      Find the index of the first aggregator Parameter in the supplied Method.
      static boolean isAggregator​(java.lang.reflect.Parameter parameter)
      Determine if the supplied Parameter is an aggregator (i.e., of type ArgumentsAccessor or annotated with AggregateWith).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • hasPotentiallyValidSignature

        public static boolean hasPotentiallyValidSignature​(java.lang.reflect.Method method)
        Determine if the supplied Method 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.

        1. zero or more indexed arguments come first.
        2. zero or more aggregators come next.
        3. 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​(java.lang.reflect.Parameter parameter)
        Determine if the supplied Parameter is an aggregator (i.e., of type ArgumentsAccessor or annotated with AggregateWith).
        Returns:
        true if the parameter is an aggregator
      • hasAggregator

        public static boolean hasAggregator​(java.lang.reflect.Method method)
        Determine if the supplied Method declares at least one Parameter that is an aggregator.
        Returns:
        true if the method has an aggregator
      • indexOfFirstAggregator

        public static int indexOfFirstAggregator​(java.lang.reflect.Method method)
        Find the index of the first aggregator Parameter in the supplied Method.
        Returns:
        the index of the first aggregator, or -1 if not found