Class CamelSpringTestHelper
java.lang.Object
org.apache.camel.test.spring.junit5.CamelSpringTestHelper
Helper that provides state information across the levels of Spring Test that do not expose the necessary
context/state for integration of Camel testing features into Spring test. Also provides utility methods.
Note that this class makes use of
ThreadLocals to maintain some state. It is imperative that the state
setters and getters are accessed within the scope of a single thread in order for this class to work right.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddoToSpringCamelContexts(org.springframework.context.ApplicationContext context, CamelSpringTestHelper.DoToSpringCamelContextsStrategy strategy) Executesstrategyagainst allSpringCamelContexts found in the Spring context.static Collection<Method> getAllMethods(Class<?> clazz) Returns all methods defined inclazzand its superclasses/interfaces.static Stringstatic Stringstatic Class<?> static org.springframework.test.context.TestContextstatic Methodstatic voidsetOriginalExcludeRoutesValue(String originalValue) static voidsetOriginalJmxDisabledValue(String originalValue) static voidsetTestContext(org.springframework.test.context.TestContext context)
-
Method Details
-
getOriginalJmxDisabled
-
setOriginalJmxDisabledValue
-
getOriginalExcludeRoutes
-
setOriginalExcludeRoutesValue
-
getTestClass
-
getTestMethod
-
getTestContext
public static org.springframework.test.context.TestContext getTestContext() -
setTestContext
public static void setTestContext(org.springframework.test.context.TestContext context) -
getAllMethods
Returns all methods defined inclazzand its superclasses/interfaces. -
doToSpringCamelContexts
public static void doToSpringCamelContexts(org.springframework.context.ApplicationContext context, CamelSpringTestHelper.DoToSpringCamelContextsStrategy strategy) throws Exception Executesstrategyagainst allSpringCamelContexts found in the Spring context. This method reduces the amount of repeated find and loop code throughout this class.- Parameters:
context- the Spring context to searchstrategy- the strategy to execute against the foundSpringCamelContexts- Throws:
Exception- if there is an error executing any of the strategies
-