Interface TestMethodInterceptor<R>

Type Parameters:
R - The result type
All Known Implementing Classes:
AbstractMicronautExtension, MicronautJunit5Extension, MicronautSpockExtension

public interface TestMethodInterceptor<R>
Test method interceptor. Intended to be used for API that doesn't support before/after phases.
Since:
3.4.0
Author:
Denis Stepanov
  • Method Details

    • interceptBeforeEach

      default R interceptBeforeEach(TestMethodInvocationContext<R> methodInvocationContext) throws Throwable
      Intercepts before each test invocation.
      Parameters:
      methodInvocationContext - the method invocation context
      Returns:
      intercepted return value
      Throws:
      Exception - allows any exception to propagate
      Throwable
    • interceptTest

      default R interceptTest(TestMethodInvocationContext<R> methodInvocationContext) throws Throwable
      Intercepts each test invocation.
      Parameters:
      methodInvocationContext - the method invocation context
      Returns:
      intercepted return value
      Throws:
      Exception - allows any exception to propagate
      Throwable
    • interceptAfterEach

      default R interceptAfterEach(TestMethodInvocationContext<R> methodInvocationContext) throws Throwable
      Intercepts after each test invocation.
      Parameters:
      methodInvocationContext - the method invocation context
      Returns:
      intercepted return value
      Throws:
      Exception - allows any exception to propagate
      Throwable