Package org.junit.jupiter.params
Class ParameterizedTestParameterResolver
java.lang.Object
org.junit.jupiter.params.ParameterizedTestParameterResolver
- All Implemented Interfaces:
Extension,ParameterResolver
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object[]private final ParameterizedTestMethodContext -
Constructor Summary
ConstructorsConstructorDescriptionParameterizedTestParameterResolver(ParameterizedTestMethodContext methodContext, Object[] arguments) -
Method Summary
Modifier and TypeMethodDescriptionresolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Resolve an argument for theParameterin the suppliedParameterContextfor the suppliedExtensionContext.booleansupportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Determine if this resolver supports resolution of an argument for theParameterin the suppliedParameterContextfor the suppliedExtensionContext.
-
Field Details
-
methodContext
-
arguments
-
-
Constructor Details
-
ParameterizedTestParameterResolver
ParameterizedTestParameterResolver(ParameterizedTestMethodContext methodContext, Object[] arguments)
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) Description copied from interface:ParameterResolverDetermine if this resolver supports resolution of an argument for theParameterin the suppliedParameterContextfor the suppliedExtensionContext.The
MethodorConstructorin which the parameter is declared can be retrieved viaParameterContext.getDeclaringExecutable().- Specified by:
supportsParameterin interfaceParameterResolver- Parameters:
parameterContext- the context for the parameter for which an argument should be resolved; nevernullextensionContext- the extension context for theExecutableabout to be invoked; nevernull- Returns:
trueif this resolver can resolve an argument for the parameter- See Also:
-
resolveParameter
public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException Description copied from interface:ParameterResolverResolve an argument for theParameterin the suppliedParameterContextfor the suppliedExtensionContext.This method is only called by the framework if
ParameterResolver.supportsParameter(org.junit.jupiter.api.extension.ParameterContext, org.junit.jupiter.api.extension.ExtensionContext)previously returnedtruefor the sameParameterContextandExtensionContext.The
MethodorConstructorin which the parameter is declared can be retrieved viaParameterContext.getDeclaringExecutable().- Specified by:
resolveParameterin interfaceParameterResolver- Parameters:
parameterContext- the context for the parameter for which an argument should be resolved; nevernullextensionContext- the extension context for theExecutableabout to be invoked; nevernull- Returns:
- the resolved argument for the parameter; may only be
nullif the parameter type is not a primitive - Throws:
ParameterResolutionException- See Also:
-