Class AllureJupiter

java.lang.Object
io.qameta.allure.jupiter.AllureJupiter
All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.InvocationInterceptor
Direct Known Subclasses:
AllureJunit5

public class AllureJupiter extends Object implements org.junit.jupiter.api.extension.InvocationInterceptor
Reports JUnit Jupiter fixture execution details to Allure.

Register this extension when Jupiter lifecycle methods should appear as Allure fixtures with start, stop, and failure metadata. The extension is also the compatibility base used by the legacy allure-junit5 module.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

    org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    buildFailureEvent(String type, String uuid, Throwable throwable)
    Builds and returns the failure event.
    buildStartEvent(String type, String uuid, Method method)
    Builds and returns the start event.
    Builds and returns the stop event.
    void
    interceptAfterAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    void
    interceptAfterEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    void
    interceptBeforeAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    void
    interceptBeforeEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    void
    interceptTestTemplateMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    protected void
    processFixture(String type, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    Handles the process fixture callback.
    Returns the wrap.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

    interceptDynamicTest, interceptDynamicTest, interceptTestClassConstructor, interceptTestFactoryMethod, interceptTestMethod
  • Constructor Details

    • AllureJupiter

      public AllureJupiter()
  • Method Details

    • interceptTestTemplateMethod

      public void interceptTestTemplateMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Specified by:
      interceptTestTemplateMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
      Throws:
      Throwable
    • interceptBeforeAllMethod

      public void interceptBeforeAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Specified by:
      interceptBeforeAllMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
      Throws:
      Throwable
    • interceptAfterAllMethod

      public void interceptAfterAllMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Specified by:
      interceptAfterAllMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
      Throws:
      Throwable
    • interceptBeforeEachMethod

      public void interceptBeforeEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Specified by:
      interceptBeforeEachMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
      Throws:
      Throwable
    • interceptAfterEachMethod

      public void interceptAfterEachMethod(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Specified by:
      interceptAfterEachMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
      Throws:
      Throwable
    • processFixture

      protected void processFixture(String type, org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Throwable
      Handles the process fixture callback.
      Parameters:
      type - the event or label type
      invocation - the invocation
      invocationContext - the invocation context
      extensionContext - the extension context
      Throws:
      Throwable - if the underlying framework operation fails
    • buildStartEvent

      public Map<String,String> buildStartEvent(String type, String uuid, Method method)
      Builds and returns the start event.
      Parameters:
      type - the event or label type
      uuid - the Allure UUID of the model object
      method - the framework or Java method to inspect
      Returns:
      the start event
    • buildStopEvent

      public Map<String,String> buildStopEvent(String type, String uuid)
      Builds and returns the stop event.
      Parameters:
      type - the event or label type
      uuid - the Allure UUID of the model object
      Returns:
      the stop event
    • buildFailureEvent

      public Map<String,String> buildFailureEvent(String type, String uuid, Throwable throwable)
      Builds and returns the failure event.
      Parameters:
      type - the event or label type
      uuid - the Allure UUID of the model object
      throwable - the throwable
      Returns:
      the failure event
    • wrap

      public Map<String,String> wrap(Map<String,String> data)
      Returns the wrap.
      Parameters:
      data - the data map to wrap or process
      Returns:
      the wrap