class ParameterizedTestParameterResolver extends java.lang.Object implements ParameterResolver, AfterTestExecutionCallback
| Modifier and Type | Class and Description |
|---|---|
private static class |
ParameterizedTestParameterResolver.CloseableArgument |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object[] |
arguments |
private int |
invocationIndex |
private ParameterizedTestMethodContext |
methodContext |
private static ExtensionContext.Namespace |
NAMESPACE |
| Constructor and Description |
|---|
ParameterizedTestParameterResolver(ParameterizedTestMethodContext methodContext,
java.lang.Object[] arguments,
int invocationIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterTestExecution(ExtensionContext context)
Callback that is invoked immediately after an individual test has
been executed but before any user-defined teardown methods have been
executed for that test.
|
private java.lang.Object[] |
extractPayloads(java.lang.Object[] arguments) |
java.lang.Object |
resolveParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
Resolve an argument for the
Parameter in the supplied ParameterContext
for the supplied ExtensionContext. |
boolean |
supportsParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
Determine if this resolver supports resolution of an argument for the
Parameter in the supplied ParameterContext for the supplied
ExtensionContext. |
private static final ExtensionContext.Namespace NAMESPACE
private final ParameterizedTestMethodContext methodContext
private final java.lang.Object[] arguments
private final int invocationIndex
ParameterizedTestParameterResolver(ParameterizedTestMethodContext methodContext, java.lang.Object[] arguments, int invocationIndex)
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
ParameterResolverParameter in the supplied ParameterContext for the supplied
ExtensionContext.
The Method or Constructor
in which the parameter is declared can be retrieved via
ParameterContext.getDeclaringExecutable().
supportsParameter in interface ParameterResolverparameterContext - the context for the parameter for which an argument should
be resolved; never nullextensionContext - the extension context for the Executable
about to be invoked; never nulltrue if this resolver can resolve an argument for the parameterParameterResolver.resolveParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext),
ParameterContextpublic java.lang.Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException
ParameterResolverParameter in the supplied ParameterContext
for the supplied ExtensionContext.
This method is only called by the framework if ParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)
previously returned true for the same ParameterContext
and ExtensionContext.
The Method or Constructor
in which the parameter is declared can be retrieved via
ParameterContext.getDeclaringExecutable().
resolveParameter in interface ParameterResolverparameterContext - the context for the parameter for which an argument should
be resolved; never nullextensionContext - the extension context for the Executable
about to be invoked; never nullnull if the
parameter type is not a primitiveParameterResolutionExceptionParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext),
ParameterContextpublic void afterTestExecution(ExtensionContext context)
AfterTestExecutionCallbackafterTestExecution in interface AfterTestExecutionCallbackcontext - the current extension context; never nullprivate java.lang.Object[] extractPayloads(java.lang.Object[] arguments)