Top Description Fields Methods
org.junit.jupiter.params

public Interface ParameterInfo

Known Direct Subinterfaces
org.junit.jupiter.params.support.ParameterInfo
Annotations
@API
status:EXPERIMENTAL
since:5.14
Static Imports
org.apiguardian.api.API.Status.EXPERIMENTAL

ParameterInfo is used to provide information about the current invocation of a parameterized class or test.

Registered Extension implementations may retrieve the current ParameterInfo instance by calling ExtensionContext#getStore(Namespace) with NAMESPACE and Store.get(...) with KEY. Alternatively, the get(ExtensionContext) method may be used to retrieve the ParameterInfo instance for the supplied ExtensionContext. Extensions must not modify any entries in the Store for NAMESPACE.

When a @ParameterizedTest method is declared inside a @ParameterizedClass or a @Nested @ParameterizedClass is declared inside an enclosing @ParameterizedClass, there will be multiple ParameterInfo instances available on different levels of the ExtensionContext hierarchy. In such cases, please use ExtensionContext#getParent() to navigate to the right level before retrieving the ParameterInfo instance from the Store.

Since
5.14
See Also
ParameterizedClass, ParameterizedTest

Field Summary

Modifier and TypeField and Description
public static final Object
KEY

The key for retrieving the ParameterInfo instance from the Store.

public static final ExtensionContext.Namespace
NAMESPACE

The Namespace for accessing the Store for ParameterInfo.

Method Summary

Modifier and TypeMethod and Description
public static @Nullable ParameterInfo

Returns:

the closest ParameterInfo instance for the supplied ExtensionContext; potentially null
get
(ExtensionContext context)

Returns the closest ParameterInfo instance for the supplied ExtensionContext; potentially null.

public ArgumentsAccessor

Returns:

the accessor to the arguments of the current invocation
getArguments
()

Returns the accessor to the arguments of the current invocation.

public ParameterDeclarations

Returns:

the declarations of all indexed parameters
getDeclarations
()

Returns the declarations of all indexed parameters.

Field Detail

KEYback to summary
public static final Object KEY

The key for retrieving the ParameterInfo instance from the Store.

NAMESPACEback to summary
public static final ExtensionContext.Namespace NAMESPACE

The Namespace for accessing the Store for ParameterInfo.

Method Detail

getback to summary
public static @Nullable ParameterInfo get(ExtensionContext context)

Returns the closest ParameterInfo instance for the supplied ExtensionContext; potentially null.

Returns:@Nullable ParameterInfo

the closest ParameterInfo instance for the supplied ExtensionContext; potentially null

getArgumentsback to summary
public ArgumentsAccessor getArguments()

Returns the accessor to the arguments of the current invocation.

Returns:ArgumentsAccessor

the accessor to the arguments of the current invocation

getDeclarationsback to summary
public ParameterDeclarations getDeclarations()

Returns the declarations of all indexed parameters.

Returns:ParameterDeclarations

the declarations of all indexed parameters