I have a camel Java DSL route that's defined to pick up messages from a queue and route them to a Java processor. The route defines some exception handling that looks for exceptions of a particular type and places the message back on the queue if the processor throws that exception. I already know this route actually works, but I'd like to properly unit test the route.
Can someone post a simple Java DSL-based example of how to go about doing this? I'm piecing together suggestions from various postings that perhaps I should use the camel placeholder functionality to replace my activemq:queue endpoint with seda or a mock or a direct or something (not sure).
And perhaps I should use an interceptor to intercept the messages heading to the processor and have the interceptor's processor throw my exception. I'd like my unit test to send a message through, have my interceptor throw an exception, and expect the message to end up back on my simulated queue or something to that affect. But I'm not quite sure how to put it all together. Java DSL Examples please?
Thanks