Class AssertJLifecycleListener

java.lang.Object
io.qameta.allure.assertj.AssertJLifecycleListener
All Implemented Interfaces:
io.qameta.allure.listener.FixtureLifecycleListener, io.qameta.allure.listener.LifecycleListener, io.qameta.allure.listener.TestLifecycleListener

public class AssertJLifecycleListener extends Object implements io.qameta.allure.listener.TestLifecycleListener, io.qameta.allure.listener.FixtureLifecycleListener
Clears per-thread AssertJ recorder state after Allure has finished owning the current result.

AllureAspectJ keeps an AssertJRecorder in a ThreadLocal so assertion objects can be matched by identity across later fluent calls. Test engines commonly reuse worker threads, so that thread-local map would otherwise keep old assertion objects, rendered steps, and operation stack state after the test or fixture result has already been written. The retained StepResults are already attached to the Allure model by reference, so removing the recorder here does not remove any reported steps; it only releases per-thread bookkeeping before the next test or fixture starts on the same thread.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterFixtureStop(io.qameta.allure.model.FixtureResult result)
    void
    afterTestWrite(io.qameta.allure.model.TestResult result)

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.qameta.allure.listener.FixtureLifecycleListener

    afterFixtureStart, afterFixtureUpdate, beforeFixtureStart, beforeFixtureStop, beforeFixtureUpdate

    Methods inherited from interface io.qameta.allure.listener.TestLifecycleListener

    afterTestSchedule, afterTestStart, afterTestStop, afterTestUpdate, beforeTestSchedule, beforeTestStart, beforeTestStop, beforeTestUpdate, beforeTestWrite
  • Constructor Details

    • AssertJLifecycleListener

      public AssertJLifecycleListener()
  • Method Details

    • afterTestWrite

      public void afterTestWrite(io.qameta.allure.model.TestResult result)
      Specified by:
      afterTestWrite in interface io.qameta.allure.listener.TestLifecycleListener
    • afterFixtureStop

      public void afterFixtureStop(io.qameta.allure.model.FixtureResult result)
      Specified by:
      afterFixtureStop in interface io.qameta.allure.listener.FixtureLifecycleListener