Class InterceptingExecutableInvoker
java.lang.Object
org.junit.jupiter.engine.execution.InterceptingExecutableInvoker
InterceptingExecutableInvoker
encapsulates the invocation of a
Executable
(i.e., method or constructor),
including support for dynamic resolution of method parameters via
ParameterResolvers
.- Since:
- 5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
InterceptingExecutableInvoker.ReflectiveInterceptorCall<E extends Executable, T extends @Nullable Object>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
invoke
(Constructor<T> constructor, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>, T> interceptorCall) Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.<T extends @Nullable Object>
Tinvoke
(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T> interceptorCall) Invoke the supplied method with dynamic parameter resolution.void
invokeVoid
(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall interceptorCall)
-
Constructor Details
-
InterceptingExecutableInvoker
public InterceptingExecutableInvoker()
-
-
Method Details
-
invoke
public <T> T invoke(Constructor<T> constructor, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>, T> interceptorCall) Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.- Parameters:
constructor
- the constructor to invoke and resolve parameters forouterInstance
- the outer instance to supply as the first argument to the constructor; empty, for top-level classesextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
frominterceptorCall
- the call for intercepting this constructor invocation via all registered interceptors
-
invokeVoid
public void invokeVoid(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall interceptorCall) -
invoke
public <T extends @Nullable Object> T invoke(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T> interceptorCall) Invoke the supplied method with dynamic parameter resolution.- Parameters:
method
- the method to invoke and resolve parameters fortarget
- the target on which the executable will be invoked, potentially wrapped in anOptional
; can benull
or an emptyOptional
for astatic
methodextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
frominterceptorCall
- the call for intercepting this method invocation via all registered interceptors
-