You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Vinny <xa...@gmail.com> on 2015/01/28 21:08:05 UTC

Testing Routebuilder classes without a Mock endpoint

Hello All,
Sorry if this is a newb question but I was wondering if there is a way to
test my routes  in way that does not involve added  .to("mock:xxx") on the
end of the routes. I may be pure vanity but I don't like the idea of having
"production" routes with mocks in them. I saw the documentation on
adviseWith and that seems like it might have been able to help but the
route I'm trying to test is doesn't seem to bring me the data I'm looking
for on the return.  Unit test to illustrate:
https://gist.github.com/anonymous/503496cfe9c57384a638
Is there a way to make this unit test pass without a Mock?
Thanks in advance,
Vincent

Re: Testing Routebuilder classes without a Mock endpoint

Posted by Vinny <xa...@gmail.com>.
Ok, I was able to "append" a "mock:result" to a route using
weaveById("silver").after(), still seems a little clunky though:
https://gist.github.com/vinny2020/616935f45d34fb6b8dbd


On Wed Jan 28 2015 at 3:08:05 PM Vinny <xa...@gmail.com> wrote:

> Hello All,
> Sorry if this is a newb question but I was wondering if there is a way to
> test my routes  in way that does not involve added  .to("mock:xxx") on the
> end of the routes. I may be pure vanity but I don't like the idea of having
> "production" routes with mocks in them. I saw the documentation on
> adviseWith and that seems like it might have been able to help but the
> route I'm trying to test is doesn't seem to bring me the data I'm looking
> for on the return.  Unit test to illustrate:
> https://gist.github.com/anonymous/503496cfe9c57384a638
> Is there a way to make this unit test pass without a Mock?
> Thanks in advance,
> Vincent
>