I'll let others comment on this more fully but will make on observation
that will depend very much on your needs outside of testing.

The wiretap allows you to get a full copy of an exchange and send it off on
a separate route.  That is actually a good mechanism if you might later use
that for monitoring of the route as well as for testing.  But it does do a
copy so there's some memory overhead involved.  It can then be used for
testing and for monitoring.  But if that monitoring isn't desirable later
you may not want to use it.  Still, it is worth knowing or thinking about.

http://camel.apache.org/wire-tap.html

On Thu, Apr 21, 2016 at 1:18 PM, Jeff Segal <jeffrey.se...@gmail.com> wrote:

> I've got a route that I'd like to do some unit testing on at various
> stages. It does a few splits, sets some headers, etc. The problem is that
> there's no actual endpoint for me to intercept until the very end, but I'd
> like to do some verification midway through.
>
> I suppose I could add arbitrary mock endpoints in key spots to use as
> interceptSendTo hooks, but I'd rather not pollute my route with test
> scaffolding like that. I've also tried using vanilla intercept().when()
> calls but those end up casting too wide a net to be useful (or don't offer
> a straightforward way for to intercept where and only where I want to).
>
> Is there a better alternative to solving this problem than injecting
> arbitrary mocks into my production routes?
>
> Jeff
>

Reply via email to