Top Description Fields Constructors Methods
org.junit.jupiter.engine.execution

public Class ParameterResolutionUtils

extends Object
Class Inheritance
Annotations
@API
status:INTERNAL
since:5.9
Static Imports
java.util.stream.Collectors.joining, org.apiguardian.api.API.Status.INTERNAL, org.junit.platform.commons.util.KotlinReflectionUtils.getKotlinSuspendingFunctionParameters, .KotlinReflectionUtils.isKotlinSuspendingFunction, .ReflectionUtils.isAssignableTo

ParameterResolutionUtils provides support for dynamic resolution of executable parameters via ParameterResolvers.
Since
5.9

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
asLabel(Executable executable)

private static @Nullable Object
resolveParameter(ParameterContext parameterContext, Executable executable, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry)

public static @Nullable Object[]

Returns:

the array of Objects to be used as parameters in the executable invocation; never null though potentially empty
resolveParameters
(Method
the method for which to resolve parameters
method
,
Optional<Object>
an Optional containing the target on which the executable will be invoked; never null but should be empty for static methods and constructors
target
,
ExtensionContext
the current ExtensionContext
extensionContext
,
ExtensionRegistry
the ExtensionRegistry to retrieve ParameterResolvers from
extensionRegistry
)

Resolve the array of parameters for the supplied method and target.

public static @Nullable Object[]

Returns:

the array of Objects to be used as parameters in the executable invocation; never null though potentially empty
resolveParameters
(Executable
the executable for which to resolve parameters
executable
,
Optional<Object>
an Optional containing the target on which the executable will be invoked; never null but should be empty for static methods and constructors
target
,
Optional<Object>
the outer instance that will be supplied as the first argument to a constructor for an inner class; should be null for methods and constructors for top-level or static classes
outerInstance
,
ExtensionContext
the current ExtensionContext
extensionContext
,
ExtensionRegistry
the ExtensionRegistry to retrieve ParameterResolvers from
extensionRegistry
)

Resolve the array of parameters for the supplied executable, target, and outer instance.

public static @Nullable Object[]
resolveParameters(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry)

private static @Nullable Object[]
resolveParameters(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, Parameter[] parameters)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
private static final Logger logger

Constructor Detail

ParameterResolutionUtilsback to summary
private ParameterResolutionUtils()

Method Detail

asLabelback to summary
private static String asLabel(Executable executable)
resolveParameterback to summary
private static @Nullable Object resolveParameter(ParameterContext parameterContext, Executable executable, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry)
resolveParametersback to summary
public static @Nullable Object[] resolveParameters(Method method, Optional<Object> target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)

Resolve the array of parameters for the supplied method and target.

Parameters
method:Method

the method for which to resolve parameters

target:Optional<Object>

an Optional containing the target on which the executable will be invoked; never null but should be empty for static methods and constructors

extensionContext:ExtensionContext

the current ExtensionContext

extensionRegistry:ExtensionRegistry

the ExtensionRegistry to retrieve ParameterResolvers from

Returns:@Nullable Object[]

the array of Objects to be used as parameters in the executable invocation; never null though potentially empty

resolveParametersback to summary
public static @Nullable Object[] resolveParameters(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)

Resolve the array of parameters for the supplied executable, target, and outer instance.

Parameters
executable:Executable

the executable for which to resolve parameters

target:Optional<Object>

an Optional containing the target on which the executable will be invoked; never null but should be empty for static methods and constructors

outerInstance:Optional<Object>

the outer instance that will be supplied as the first argument to a constructor for an inner class; should be null for methods and constructors for top-level or static classes

extensionContext:ExtensionContext

the current ExtensionContext

extensionRegistry:ExtensionRegistry

the ExtensionRegistry to retrieve ParameterResolvers from

Returns:@Nullable Object[]

the array of Objects to be used as parameters in the executable invocation; never null though potentially empty

resolveParametersback to summary
public static @Nullable Object[] resolveParameters(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry)
resolveParametersback to summary
private static @Nullable Object[] resolveParameters(Executable executable, Optional<Object> target, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, Parameter[] parameters)
validateResolvedTypeback to summary
private static void validateResolvedType(Parameter parameter, @Nullable Object value, Executable executable, ParameterResolver resolver)