Take a look here:

http://camel.apache.org/mock.html

and the "Mocking existing endpoint" section




On Thu, Oct 17, 2013 at 11:15 AM, Olaf <omgolafg...@gmail.com> wrote:

> Hello,
>
> I'm trying to test a simple route which downloads emails and then split
> attachments, replace body and sends each attachment to an another email.
> Now, ReplaceBodyProcessor does some network calls and I'd like to mock it
> out and simulate its work, to avoid external calls. What is the right way
> to
> do it?
>
> Thanks in advance!
>
>         @Override
>         public void configure() {
>
>            from("imap://host?username=user&password=pass")
>                 .split(new SplitAttachmentsExpression())
>                 .process(new MailProcessor())
>                 .process(new ReplaceBodyProcessor())
>                 .choice()
>                 .when(header("attachmentName").regex("^.*(txt|TXT)$"))
>                     .to("imap://host?username=user2&password=pass2")
>                     .id("targetmail");
>         }
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-mock-a-processor-tp5741786.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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

Reply via email to