You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2013/10/25 10:39:36 UTC

Re: testing: intercept route and process() *after* its completion?

Hi

I have logged a ticket to not forget about this. We should take the
opportunity in Camel 3.0 to make the DSL better and support these
use-cases.
https://issues.apache.org/jira/browse/CAMEL-6901



On Thu, Jun 14, 2012 at 2:54 AM, twelve17 <sp...@twelve17.com> wrote:
> Hello,
>
> I've been diving into Camel testing lately, which, I'm not gonna lie, has
> been quite fun.  Thanks to the Camel book for assistance. :)
>
> I did run into one hangup in which I am not sure what the best
> pattern/practice is.
>
> For my integration testing, I am using adviceWith() to "inject" processing
> into an existing route.  The routebuilder class looks something like:
>
>  @Override
>  public void configure() throws Exception {
>      interceptSendToEndpoint("bean:someEndpointToBeTested").process(new
> DoSomeAssertionProcessor());
> }
>
> The code above runs the processor before the intercepted endpoint.   What I
> would like to do is call a processor *after* the intercepted bean is
> completed, so I can verify that the data it produced matches some expected
> data set.  For the moment, I am using the above pattern to intercept the
> endpoint that follows the actual one I want to test, which seems a little
> fragile to me.
>
> I tried using "interceptFrom", but it does not get triggered, which makes me
> believe it is only triggered if you are intercepting an input route, versus
> matching an output route as if it were "from", from the perspective of when
> the pipeline moves to the following route.
>
> Am I making any sense here? :)
>
> Any help would be appreciated.
>
> Thanks,
>
> Alex
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/testing-intercept-route-and-process-after-its-completion-tp5714460.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen