One of the approaches that we have used with success is the availability of different property files for the test and for the main code.
In the context of a camel, we define a property
<propertyPlaceholder id="properties" location="classpath:META-INF/uri.properties" xmlns="http://camel.apache.org/schema/spring" />
In the folder /src/main/resources/META-INF/ we have the uri.properties file for the main code, and /src/test/resources/META-INF/ we have uri.properties for the test.
Your route should be rewritten using the property placeholder instead of the real uri values โโusing the notation {{properties.name}}
<route> <from uri="{{cxf.bean.cxfEndpoint}}"/> </route>
core uri.properties will be
cxf.bean.cxfEndpoint=cxf:bean:cxfEndpoint?dataFormat=MESSAGE
uri.properties test will be
cxf.bean.cxfEndpoint=direct:start
Using this configuration, you can easily test your route.
MPavesi
source share