Class InterceptingExecutableInvoker
- java.lang.Object
-
- org.junit.jupiter.engine.execution.InterceptingExecutableInvoker
-
@API(status=INTERNAL, since="5.0") public class InterceptingExecutableInvoker extends java.lang.Object
InterceptingExecutableInvoker
encapsulates the invocation of aExecutable
(i.e., method or constructor), including support for dynamic resolution of method parameters viaParameterResolvers
.- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
InterceptingExecutableInvoker.ReflectiveInterceptorCall<E extends java.lang.reflect.Executable,T>
-
Field Summary
Fields Modifier and Type Field Description private static InvocationInterceptorChain
interceptorChain
-
Constructor Summary
Constructors Constructor Description InterceptingExecutableInvoker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
invoke(java.lang.reflect.Constructor<T> constructor, java.util.Optional<java.lang.Object> outerInstance, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<java.lang.reflect.Constructor<T>,T> interceptorCall)
Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.<T> T
invoke(java.lang.reflect.Method method, java.lang.Object target, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<java.lang.reflect.Method,T> interceptorCall)
Invoke the supplied method with dynamic parameter resolution.private <E extends java.lang.reflect.Executable,T>
Tinvoke(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T> originalInvocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<E> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<E,T> call)
-
-
-
Field Detail
-
interceptorChain
private static final InvocationInterceptorChain interceptorChain
-
-
Method Detail
-
invoke
public <T> T invoke(java.lang.reflect.Constructor<T> constructor, java.util.Optional<java.lang.Object> outerInstance, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<java.lang.reflect.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
-
invoke
public <T> T invoke(java.lang.reflect.Method method, java.lang.Object target, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<java.lang.reflect.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
-
invoke
private <E extends java.lang.reflect.Executable,T> T invoke(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T> originalInvocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<E> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<E,T> call)
-
-