Module org.junit.jupiter.engine
Class ParameterResolutionUtils
- java.lang.Object
-
- org.junit.jupiter.engine.execution.ParameterResolutionUtils
-
@API(status=INTERNAL, since="5.9") public class ParameterResolutionUtils extends java.lang.Object
ParameterResolutionUtils
provides support for dynamic resolution of executable parameters viaParameterResolvers
.- Since:
- 5.9
-
-
Constructor Summary
Constructors Constructor Description ParameterResolutionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
asLabel(java.lang.reflect.Executable executable)
private static java.lang.Object
resolveParameter(ParameterContext parameterContext, java.lang.reflect.Executable executable, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
static java.lang.Object[]
resolveParameters(java.lang.reflect.Executable executable, java.util.Optional<java.lang.Object> target, java.util.Optional<java.lang.Object> outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Resolve the array of parameters for the supplied executable, target, and outer instance.static java.lang.Object[]
resolveParameters(java.lang.reflect.Method method, java.util.Optional<java.lang.Object> target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Resolve the array of parameters for the supplied method and target.private static void
validateResolvedType(java.lang.reflect.Parameter parameter, java.lang.Object value, java.lang.reflect.Executable executable, ParameterResolver resolver)
-
-
-
Field Detail
-
logger
private static final Logger logger
-
-
Method Detail
-
resolveParameters
public static java.lang.Object[] resolveParameters(java.lang.reflect.Method method, java.util.Optional<java.lang.Object> target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Resolve the array of parameters for the supplied method and target.- Parameters:
method
- the method for which to resolve parameterstarget
- anOptional
containing the target on which the executable will be invoked; nevernull
but should be empty for static methods and constructorsextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from- Returns:
- the array of Objects to be used as parameters in the executable
invocation; never
null
though potentially empty
-
resolveParameters
public static java.lang.Object[] resolveParameters(java.lang.reflect.Executable executable, java.util.Optional<java.lang.Object> target, java.util.Optional<java.lang.Object> outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Resolve the array of parameters for the supplied executable, target, and outer instance.- Parameters:
executable
- the executable for which to resolve parameterstarget
- anOptional
containing the target on which the executable will be invoked; nevernull
but should be empty for static methods and constructorsouterInstance
- the outer instance that will be supplied as the first argument to a constructor for an inner class; should benull
for methods and constructors for top-level or static classesextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from- Returns:
- the array of Objects to be used as parameters in the executable
invocation; never
null
though potentially empty
-
resolveParameter
private static java.lang.Object resolveParameter(ParameterContext parameterContext, java.lang.reflect.Executable executable, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
-
validateResolvedType
private static void validateResolvedType(java.lang.reflect.Parameter parameter, java.lang.Object value, java.lang.reflect.Executable executable, ParameterResolver resolver)
-
asLabel
private static java.lang.String asLabel(java.lang.reflect.Executable executable)
-
-