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: Test Case - Quartz to a Custom bean
Date Tue, 26 Jun 2012 06:58:22 GMT
On Mon, Jun 25, 2012 at 11:29 PM, dgallagher <damien.gallagher@gmail.com> wrote:
> Would it be recommend to use the following section in the url below
> http://camel.apache.org/mock.html and section
> Mocking endpoints and skip sending to original endpoint
>
> If i mock my custom bean and then call the mock and ignore the original
> would that be a sufficient use case?
> Obviously the bean would then be tested in isolation, similar to what would
> be done using other mocking frameworks
>

Yes this is a way to do this.
And from Camel 2.10 onwards its even easier, as you can do this from
the Camel Test Kit without using the advice with.

You may also consider if possible to plugin a different bean, then you
can just have a noop bean to plugin instead of the actual bean.

Or use advice with to modify the route before testing, and replace the
bean part with something else, like sending to a mock
http://camel.apache.org/advicewith.html

And others may use property placeholders, then you can use a different
.properties file for unit testing, that instead of using a bean
endpoint, use a mock endpoint.



>
>
> Thanks
> Damien
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Test-Case-Quartz-to-a-Custom-bean-tp5715085p5715086.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message