camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: How to mock a processor
Date Thu, 17 Oct 2013 21:29:49 GMT
It would be wise to give your nodes IDs so you can intercept them easier:

eg:

.process(new ReplaceBodyProcessor()).id("replaceBody")

I'm not even sure how it did work for you with

weaveById("ReplaceBodyProcessor") because camel uses a default id of
"processN" where N is an incrementing integer if no ID is defined.

weaveByToString should work as you have it...




On Thu, Oct 17, 2013 at 12:11 PM, Olaf <omgolafguhl@gmail.com> wrote:

> Thanks! That helps a lot.
>
> Somehow, I can only mock with weaveBeId method:
>
>
> weaveById("ReplaceBodyProcessor").replace().to("mock:ReplaceBodyProcessor");
>
> then it is ReplaceBodyProcessor is skipped in test.
>
> If using
>
> weaveByToString(".*ReplaceBodyProcessor.*").replace().to("mock:ReplaceBodyProcessor");
>
> or public String isMockEndpoints() {return "*";}
>
> my test fails. What am I doing wrong?
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-mock-a-processor-tp5741786p5741793.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message