How do I reuse the ContextTestSupport class in my unit tests?

You might want to look at the various Testing options Spring Testing to see if those are better, more powerful options. We see ContextTestSupport as an older, less powerful option.

There are a number of useful unit test cases and support classes you can reuse in your own unit test cases.

If you use maven2 then here you go:

ContextTestSupport:

       <dependency>
           <groupId>org.apache.camel</groupId>
           <artifactId>camel-core</artifactId>
           <version>${camel-version}</version>
           <type>test-jar</type>
           <scope>test</scope>
       </dependency>

SpringTestSupport:

       <dependency>
           <groupId>org.apache.camel</groupId>
           <artifactId>camel-test-spring</artifactId>
           <version>${camel-version}</version>
           <type>test-jar</type>
           <scope>test</scope>
       </dependency>

If you don’t use maven: