Interface ParameterDeclarations


@API(status=EXPERIMENTAL, since="5.13") public interface ParameterDeclarations
ParameterDeclarations encapsulates the combined declarations of all indexed @ParameterizedClass or @ParameterizedTest parameters.

For a @ParameterizedTest, the parameter declarations are derived from the method signature. For a @ParameterizedClass, they may be derived from the constructor or @Parameter-annotated fields.

Aggregators, that is parameters of type ArgumentsAccessor or parameters annotated with @AggregateWith, are not indexed and thus not included in the list of parameter declarations.

Since:
5.13
See Also:
  • Method Details

    • getAll

      Returns all indexed parameter declarations; never null, sorted by index.
      Returns:
      all indexed parameter declarations; never null, sorted by index
    • getFirst

      Returns the first indexed parameter declaration, if available; never null.
      Returns:
      the first indexed parameter declaration, if available; never null
    • get

      Optional<ParameterDeclaration> get(int parameterIndex)
      Returns the indexed parameter declaration for the supplied index, if available; never null.
      Returns:
      the indexed parameter declaration for the supplied index, if available; never null
    • getSourceElement

      AnnotatedElement getSourceElement()
      Returns the source element of all parameter declarations.

      For @ParameterizedTest, this always corresponds to the parameterized test method. For @ParameterizedClass, this corresponds to the parameterized test class constructor, if constructor injection is used; or the test class itself, if field injection is used.

      Returns:
      the source element of all parameter declarations
    • getSourceElementDescription

      String getSourceElementDescription()
      Returns a human-readable description of the source element.

      This may, for example, be used in error messages.

      Returns:
      a human-readable description of the source element
      See Also: