I shall give u a small advice on this . Pls note. All components don't support attachment . Attachments in the Camel exchange might be lost while passing throughout some Camel components. So by rule of thumb, make sure attachments are added to the exchange just before calling an email component.
Cheers Reji "Olaf [via Camel]" <ml-node+s465427n5741786...@n5.nabble.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"); > } > > > > > > > > >_______________________________________________ >If you reply to this email, your message will be added to the discussion below: >http://camel.465427.n5.nabble.com/How-to-mock-a-processor-tp5741786.html > >To unsubscribe from Camel - Users, visit >http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=Y29udGFjdHJlamlAZ21haWwuY29tfDQ2NTQyOHwxMDA0OTE4MjMz -- View this message in context: http://camel.465427.n5.nabble.com/How-to-mock-a-processor-tp5741786p5741792.html Sent from the Camel - Users mailing list archive at Nabble.com.