camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel route from testting
Date Mon, 07 Jan 2013 11:15:34 GMT
On Mon, Jan 7, 2013 at 6:48 AM, dhruv.sachdeva
<dhruv.sachdeva@jktech.com> wrote:
> Hi
>
> I need to write unit test cases for some camel routes using (Version 1.6)
>
> Can anyone please suggest if it is possible to mock components(processor and
> idempotentConsumer) inside the route? If yes, please suggest the approach.
>
>
> Below is the route snippet
>
>         from("direct:someuri").process(someClassObject).
>
> idempotentConsumer(header("someHeadername"),socratesMessageIdRepository(bean(JpaTemplate.class)))./*process(exceptionProcessor)*/
>         to(someQueues);
>

This is just java code, so you can extend the route builder, and
change the instances of
- someClassObject
- exceptionProcessor
- someQueues

To whatever you want, such as mock endpoints, and custom processors or whatever.
Or allow your existing route builder class, to have getter/setter's
etc so you can re-configure them before testing.

Replacing or changing the idempotentConsumer is not so easy.



>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-route-from-testting-tp5725027.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Mime
View raw message