camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf <omgolafg...@gmail.com>
Subject How to mock a processor
Date Thu, 17 Oct 2013 18:15:41 GMT
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.

Mime
View raw message