Class ExecutableInvoker
- java.lang.Object
-
- org.junit.jupiter.engine.execution.ExecutableInvoker
-
@API(status=INTERNAL, since="5.0") public class ExecutableInvoker extends Object
ExecutableInvokerencapsulates the invocation of aExecutable(i.e., method or constructor), including support for dynamic resolution of method parameters viaParameterResolvers.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description ExecutableInvoker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tinvoke(Constructor<T> constructor, Object outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.<T> Tinvoke(Constructor<T> constructor, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)Invoke the supplied constructor with dynamic parameter resolution.Objectinvoke(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)Invoke the supplied method on the supplied target object with dynamic parameter resolution.Objectinvoke(Method method, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)Invoke the suppliedstaticmethod with dynamic parameter resolution.
-
-
-
Method Detail
-
invoke
public <T> T invoke(Constructor<T> constructor, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with dynamic parameter resolution.- Parameters:
constructor- the constructor to invoke and resolve parameters forextensionContext- the currentExtensionContextextensionRegistry- theExtensionRegistryto retrieveParameterResolversfrom
-
invoke
public <T> T invoke(Constructor<T> constructor, Object outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.This method should only be used to invoke the constructor for an inner class.
- Parameters:
constructor- the constructor to invoke and resolve parameters forouterInstance- the outer instance to supply as the first argument to the constructorextensionContext- the currentExtensionContextextensionRegistry- theExtensionRegistryto retrieveParameterResolversfrom
-
invoke
public Object invoke(Method method, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the suppliedstaticmethod with dynamic parameter resolution.- Parameters:
method- the method to invoke and resolve parameters forextensionContext- the currentExtensionContextextensionRegistry- theExtensionRegistryto retrieveParameterResolversfrom
-
invoke
public Object invoke(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied method on the supplied target object with dynamic parameter resolution.- Parameters:
method- the method to invoke and resolve parameters fortarget- the object on which the method will be invoked; should benullfor static methodsextensionContext- the currentExtensionContextextensionRegistry- theExtensionRegistryto retrieveParameterResolversfrom
-
-