Interface InvocationInterceptor

    • Method Detail

      • interceptTestClassConstructor

        default <T> T interceptTestClassConstructor​(InvocationInterceptor.Invocation<T> invocation,
                                                    ReflectiveInvocationContext<Constructor<T>> invocationContext,
                                                    ExtensionContext extensionContext)
                                             throws Throwable
        Intercept the invocation of a test class constructor.

        Note that the test class may not have been initialized (static initialization) when this method is invoked.

        Type Parameters:
        T - the result type
        Parameters:
        invocation - the invocation that is being intercepted; never null
        invocationContext - the context of the invocation that is being intercepted; never null
        extensionContext - the current extension context; never null
        Returns:
        the result of the invocation; never null
        Throws:
        Throwable - in case of failure
      • interceptTestFactoryMethod

        default <T> T interceptTestFactoryMethod​(InvocationInterceptor.Invocation<T> invocation,
                                                 ReflectiveInvocationContext<Method> invocationContext,
                                                 ExtensionContext extensionContext)
                                          throws Throwable
        Intercept the invocation of a @TestFactory method.
        Type Parameters:
        T - the result type
        Parameters:
        invocation - the invocation that is being intercepted; never null
        invocationContext - the context of the invocation that is being intercepted; never null
        extensionContext - the current extension context; never null
        Returns:
        the result of the invocation; potentially null
        Throws:
        Throwable - in case of failures