Mailbox.clearAll();
sendBody("direct:a", "Camel does really rock");
Mailbox inbox = Mailbox.get("camel@riders.org");
Message msg = inbox.get(0);
assertEquals("you@apache.org", msg.getFrom()[0].toString());
assertEquals("camel@riders.org", msg.getRecipients(Message.RecipientType.TO)[0].toString());
assertEquals("easy@riders.org", msg.getRecipients(Message.RecipientType.TO)[1].toString());
assertEquals("me@you.org", msg.getRecipients(Message.RecipientType.CC)[0].toString());
assertEquals("someone@somewhere.org", msg.getRecipients(Message.RecipientType.BCC)[0].toString());
inbox = Mailbox.get("easy@riders.org");
msg = inbox.get(0);
assertEquals("you@apache.org", msg.getFrom()[0].toString());
assertEquals("camel@riders.org", msg.getRecipients(Message.RecipientType.TO)[0].toString());
assertEquals("easy@riders.org", msg.getRecipients(Message.RecipientType.TO)[1].toString());
assertEquals("me@you.org", msg.getRecipients(Message.RecipientType.CC)[0].toString());
assertEquals("someone@somewhere.org", msg.getRecipients(Message.RecipientType.BCC)[0].toString());
inbox = Mailbox.get("me@you.org");
msg = inbox.get(0);
assertEquals("you@apache.org", msg.getFrom()[0].toString());
assertEquals("camel@riders.org", msg.getRecipients(Message.RecipientType.TO)[0].toString());
assertEquals("easy@riders.org", msg.getRecipients(Message.RecipientType.TO)[1].toString());
assertEquals("me@you.org", msg.getRecipients(Message.RecipientType.CC)[0].toString());
assertEquals("someone@somewhere.org", msg.getRecipients(Message.RecipientType.BCC)[0].toString());
inbox = Mailbox.get("someone@somewhere.org");
msg = inbox.get(0);
assertEquals("you@apache.org", msg.getFrom()[0].toString());
assertEquals("camel@riders.org", msg.getRecipients(Message.RecipientType.TO)[0].toString());
assertEquals("easy@riders.org", msg.getRecipients(Message.RecipientType.TO)[1].toString());
assertEquals("me@you.org", msg.getRecipients(Message.RecipientType.CC)[0].toString());
assertEquals("someone@somewhere.org", msg.getRecipients(Message.RecipientType.BCC)[0].toString());
}