Class CamelSpringTestContextLoaderTestExecutionListener

java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.apache.camel.test.spring.junit5.CamelSpringTestContextLoaderTestExecutionListener
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.test.context.TestExecutionListener

public class CamelSpringTestContextLoaderTestExecutionListener extends org.springframework.test.context.support.AbstractTestExecutionListener
Helper for CamelSpringTestContextLoader that sets the test class state in CamelSpringTestHelper almost immediately before the loader initializes the Spring context.

Implemented as a listener as the state can be set on a ThreadLocal and we are pretty sure that the same thread will be used to initialize the Spring context.

  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the precedence that is used by Spring to choose the appropriate execution order of test listeners.
    void
    prepareTestInstance(org.springframework.test.context.TestContext testContext)
     

    Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener

    afterTestClass, afterTestExecution, afterTestMethod, beforeTestClass, beforeTestExecution, beforeTestMethod

    Methods inherited from class java.lang.Object

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

    • CamelSpringTestContextLoaderTestExecutionListener

      public CamelSpringTestContextLoaderTestExecutionListener()
  • Method Details

    • getOrder

      public int getOrder()
      Returns the precedence that is used by Spring to choose the appropriate execution order of test listeners. See SpringTestExecutionListenerSorter.getPrecedence(Class) for more.
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Overrides:
      getOrder in class org.springframework.test.context.support.AbstractTestExecutionListener
    • prepareTestInstance

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