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
-
-
Field Summary
Fields Modifier and Type Field Description private static org.junit.platform.commons.logging.Logger
logger
-
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(org.junit.jupiter.api.extension.ParameterContext parameterContext, java.lang.reflect.Executable executable, org.junit.jupiter.api.extension.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, org.junit.jupiter.api.extension.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, org.junit.jupiter.api.extension.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, org.junit.jupiter.api.extension.ParameterResolver resolver)
-
-
-
Method Detail
-
resolveParameters
public static java.lang.Object[] resolveParameters(java.lang.reflect.Method method, java.util.Optional<java.lang.Object> target, org.junit.jupiter.api.extension.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, org.junit.jupiter.api.extension.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(org.junit.jupiter.api.extension.ParameterContext parameterContext, java.lang.reflect.Executable executable, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
-
validateResolvedType
private static void validateResolvedType(java.lang.reflect.Parameter parameter, java.lang.Object value, java.lang.reflect.Executable executable, org.junit.jupiter.api.extension.ParameterResolver resolver)
-
asLabel
private static java.lang.String asLabel(java.lang.reflect.Executable executable)
-
-