Testing routes defined in Spring

This recipe expands on the core testing capabilities described so far by detailing the steps needed to test Camel routes defined using the XML DSL in a Spring application. You will learn how to assemble a test harness that replaces parts of the application in order to test your routes outside a deployment environment, including the substitution of Spring ${..} placeholders with test values.

Getting ready

The Java code for this recipe is located in the org.camelcookbook.examples.testing.spring package. The Spring XML files are located under src/main/resources/META-INF/spring.

To use Camel's Spring test support, you need to add a dependency for the camel-test-spring library that provides the support classes for JUnit ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.