Interface ParameterInfo
- All Superinterfaces:
ParameterInfo
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.13
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Object
Deprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.KEY
insteadstatic final ExtensionContext.Namespace
Deprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.NAMESPACE
instead -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ParameterInfo
get
(ExtensionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.get(ExtensionContext)
insteadMethods inherited from interface org.junit.jupiter.params.ParameterInfo
getArguments, getDeclarations
-
Field Details
-
NAMESPACE
@Deprecated(since="6.0", forRemoval=true) @API(status=DEPRECATED, since="6.0") static final ExtensionContext.Namespace NAMESPACEDeprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.NAMESPACE
instead -
KEY
@Deprecated(since="6.0", forRemoval=true) @API(status=DEPRECATED, since="6.0") static final Object KEYDeprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.KEY
insteadThe key for retrieving theParameterInfo
instance from theStore
.
-
-
Method Details
-
get
@Deprecated(since="6.0", forRemoval=true) @API(status=DEPRECATED, since="6.0") static @Nullable ParameterInfo get(ExtensionContext context) Deprecated, for removal: This API element is subject to removal in a future version.Please useParameterInfo.get(ExtensionContext)
insteadReturns the closestParameterInfo
instance for the suppliedExtensionContext
; potentiallynull
.- Returns:
- the closest
ParameterInfo
instance for the suppliedExtensionContext
; potentiallynull
-
ParameterInfo
instead