Top Description Methods
org.junit.jupiter.params.support

public Interface ParameterDeclarations

Known Direct Implementers
org.junit.jupiter.params.ResolverFacade.DefaultParameterDeclarations
Annotations
@API
status:EXPERIMENTAL
since:6.0
Static Imports
org.apiguardian.api.API.Status.EXPERIMENTAL

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
ParameterDeclaration, org.junit.jupiter.params.ParameterizedClass, org.junit.jupiter.params.ParameterizedTest

Method Summary

Modifier and TypeMethod and Description
public Optional<ParameterDeclaration>

Returns:

the indexed parameter declaration for the supplied index, if available; never null
get
(int parameterIndex)

Returns the indexed parameter declaration for the supplied index, if available; never null.

public List<ParameterDeclaration>

Returns:

all indexed parameter declarations; never null, sorted by index
getAll
()

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

public Optional<ParameterDeclaration>

Returns:

the first indexed parameter declaration, if available; never null
getFirst
()

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

public AnnotatedElement

Returns:

the source element of all parameter declarations
getSourceElement
()

Returns the source element of all parameter declarations.

public String

Returns:

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

Returns a human-readable description of the source element.

Method Detail

getback to summary
public Optional<ParameterDeclaration> get(int parameterIndex)

Returns the indexed parameter declaration for the supplied index, if available; never null.

Returns:Optional<ParameterDeclaration>

the indexed parameter declaration for the supplied index, if available; never null

getAllback to summary
public List<ParameterDeclaration> getAll()

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

Returns:List<ParameterDeclaration>

all indexed parameter declarations; never null, sorted by index

getFirstback to summary
public Optional<ParameterDeclaration> getFirst()

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

Returns:Optional<ParameterDeclaration>

the first indexed parameter declaration, if available; never null

getSourceElementback to summary
public 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:AnnotatedElement

the source element of all parameter declarations

getSourceElementDescriptionback to summary
public String getSourceElementDescription()

Returns a human-readable description of the source element.

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

Returns:String

a human-readable description of the source element

See Also
getSourceElement()