Class CamelAnnotationsHandler
java.lang.Object
org.apache.camel.test.spring.junit5.CamelAnnotationsHandler
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanup()Cleanup/restore global state to defaults / pre-test values after the test setup is complete.static voidhandleAutoStartupExclude(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles auto-stub of endpoints with mocks based onStubEndpoints.static voidhandleCamelContextStartup(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles starting of Camel contexts based onUseAdviceWithand other state in the JVM.static voidhandleDisableJmx(Class<?> testClass) Handles disabling of JMX on Camel contexts based onDisableJmx.static voidhandleExcludeRoutes(Class<?> testClass) Handles @ExcludeRoutes to make it easier to exclude other routes when testing with Spring.static voidhandleMockEndpoints(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles auto-intercepting of endpoints with mocks based onMockEndpoints.static voidhandleMockEndpointsAndSkip(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles auto-intercepting of endpoints with mocks based onMockEndpointsAndSkipand skipping the original endpoint.static voidhandleProvidesBreakpoint(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) static voidhandleRouteCoverageDump(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function<CamelSpringTestHelper.DoToSpringCamelContextsStrategy, String> testMethod) Dumps the route coverage after test is executedstatic voidhandleRouteCoverageEnable(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) Handles enabling route coverage based onEnableRouteCoverage.static voidhandleRouteDump(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function<CamelSpringTestHelper.DoToSpringCamelContextsStrategy, String> testMethod) Dumps the route after test is executedstatic voidhandleRouteDumpEnable(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) Handles enabling route dump based onEnableRouteDump.static voidhandleShutdownTimeout(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles updating shutdown timeouts on Camel contexts based onShutdownTimeout.static voidhandleStubEndpoints(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles auto-stub of endpoints with mocks based onStubEndpoints.static voidhandleUseOverridePropertiesWithPropertiesComponent(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) Handles override this method to include and override properties with the CamelPropertiesComponent.
-
Method Details
-
cleanup
public static void cleanup()Cleanup/restore global state to defaults / pre-test values after the test setup is complete. -
handleExcludeRoutes
Handles @ExcludeRoutes to make it easier to exclude other routes when testing with Spring.- Parameters:
testClass- the test class being executed
-
handleDisableJmx
Handles disabling of JMX on Camel contexts based onDisableJmx.- Parameters:
testClass- the test class being executed
-
handleRouteCoverageEnable
public static void handleRouteCoverageEnable(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) throws Exception Handles enabling route coverage based onEnableRouteCoverage.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleRouteDumpEnable
public static void handleRouteDumpEnable(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function testMethod) throws Exception Handles enabling route dump based onEnableRouteDump.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleRouteCoverageDump
public static void handleRouteCoverageDump(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function<CamelSpringTestHelper.DoToSpringCamelContextsStrategy, String> testMethod) throws ExceptionDumps the route coverage after test is executed- Throws:
Exception
-
handleRouteDump
public static void handleRouteDump(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass, Function<CamelSpringTestHelper.DoToSpringCamelContextsStrategy, String> testMethod) throws ExceptionDumps the route after test is executed- Throws:
Exception
-
handleProvidesBreakpoint
public static void handleProvidesBreakpoint(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception - Throws:
Exception
-
handleShutdownTimeout
public static void handleShutdownTimeout(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles updating shutdown timeouts on Camel contexts based onShutdownTimeout.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleMockEndpoints
public static void handleMockEndpoints(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles auto-intercepting of endpoints with mocks based onMockEndpoints.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleStubEndpoints
public static void handleStubEndpoints(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles auto-stub of endpoints with mocks based onStubEndpoints.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleMockEndpointsAndSkip
public static void handleMockEndpointsAndSkip(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles auto-intercepting of endpoints with mocks based onMockEndpointsAndSkipand skipping the original endpoint.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleAutoStartupExclude
public static void handleAutoStartupExclude(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles auto-stub of endpoints with mocks based onStubEndpoints.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleUseOverridePropertiesWithPropertiesComponent
public static void handleUseOverridePropertiesWithPropertiesComponent(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles override this method to include and override properties with the CamelPropertiesComponent.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-
handleCamelContextStartup
public static void handleCamelContextStartup(org.springframework.context.ConfigurableApplicationContext context, Class<?> testClass) throws Exception Handles starting of Camel contexts based onUseAdviceWithand other state in the JVM.- Parameters:
context- the initialized Spring contexttestClass- the test class being executed- Throws:
Exception
-