Class ReactorContextTestExecutionListener

  • All Implemented Interfaces:
    org.springframework.core.Ordered, org.springframework.test.context.TestExecutionListener

    public class ReactorContextTestExecutionListener
    extends org.springframework.test.context.support.AbstractTestExecutionListener
    Sets up the Reactor Context with the Authentication from the TestSecurityContextHolder and then clears the Reactor Context at the end of the tests.
    Since:
    5.0
    See Also:
    WithSecurityContextTestExecutionListener, SecurityTestExecutionListeners
    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterTestClass​(org.springframework.test.context.TestContext testContext)  
      void afterTestExecution​(org.springframework.test.context.TestContext testContext)  
      void afterTestMethod​(org.springframework.test.context.TestContext testContext)  
      void beforeTestClass​(org.springframework.test.context.TestContext testContext)  
      void beforeTestExecution​(org.springframework.test.context.TestContext testContext)  
      void beforeTestMethod​(org.springframework.test.context.TestContext testContext)  
      int getOrder()
      Returns 11000.
      void prepareTestInstance​(org.springframework.test.context.TestContext testContext)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReactorContextTestExecutionListener

        public ReactorContextTestExecutionListener()
    • Method Detail

      • getOrder

        public int getOrder()
        Returns 11000.
        Specified by:
        getOrder in interface org.springframework.core.Ordered
        Overrides:
        getOrder in class org.springframework.test.context.support.AbstractTestExecutionListener
      • beforeTestClass

        public void beforeTestClass​(org.springframework.test.context.TestContext testContext)
                             throws java.lang.Exception
        Specified by:
        beforeTestClass in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        beforeTestClass in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • prepareTestInstance

        public void prepareTestInstance​(org.springframework.test.context.TestContext testContext)
                                 throws java.lang.Exception
        Specified by:
        prepareTestInstance in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        prepareTestInstance in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • beforeTestMethod

        public void beforeTestMethod​(org.springframework.test.context.TestContext testContext)
                              throws java.lang.Exception
        Specified by:
        beforeTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        beforeTestMethod in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • beforeTestExecution

        public void beforeTestExecution​(org.springframework.test.context.TestContext testContext)
                                 throws java.lang.Exception
        Specified by:
        beforeTestExecution in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        beforeTestExecution in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • afterTestExecution

        public void afterTestExecution​(org.springframework.test.context.TestContext testContext)
                                throws java.lang.Exception
        Specified by:
        afterTestExecution in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        afterTestExecution in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • afterTestMethod

        public void afterTestMethod​(org.springframework.test.context.TestContext testContext)
                             throws java.lang.Exception
        Specified by:
        afterTestMethod in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        afterTestMethod in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception
      • afterTestClass

        public void afterTestClass​(org.springframework.test.context.TestContext testContext)
                            throws java.lang.Exception
        Specified by:
        afterTestClass in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        afterTestClass in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        java.lang.Exception