Hi,

Yes, you can use mock endpoint to check the exchange.
According to you description of the production configuration,
I think you can add a mock endpoint at the end of route, and check the exchange which is routed to this endpoint. But this will change your production route rule a litter bit.

Or you can treat the camel route as a black box, just use camel producerTemplate to send the message and check the response. This solution requires your message exchange pattern to be InOut.

Maybe we can add an debugInterceptor dsl which take the mock endpoint as the parameter and we can turn on or turn off the interceptor at camel runtime.

Any thought ?

Willem

HariKrishnan wrote:
Hi,

I am aware of the mock endpoints and test endpoints that can be used to test
various routes. I need some advice regarding testing production
configurations in my unit test. I use programmatic configuration and my
routes consist of calls to various services and also access to databases. I
want to write test around my configuration such that I can test drive my
routes.

But I realise that I can only do this with mock endpoints, that allow me to
assert that the exchange reached them. How can I test configurations that I
am actually going to deploy in production.

I am not a very big fan of integration tests and would like to unit test my
routes.

Please advice.

Cheers,
HariKrishnan


Reply via email to