use of org.jvnet.mock_javamail.Mailbox in project camel by apache.
the class MailSearchTermTest method testSearchTerm.
@Test
public void testSearchTerm() throws Exception {
Mailbox mailbox = Mailbox.get("bill@localhost");
assertEquals(6, mailbox.size());
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("I like riding the Camel", "Ordering Camel in Action");
assertMockEndpointsSatisfied();
}
use of org.jvnet.mock_javamail.Mailbox in project camel by apache.
the class MailSearchTermUriConfigLast24HoursTest method testSearchTerm.
@Test
public void testSearchTerm() throws Exception {
Mailbox mailbox = Mailbox.get("bill@localhost");
assertEquals(6, mailbox.size());
// should only get the 4 latest emails that was sent within the last 24 hours
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("Ordering ActiveMQ in Action", "This is spam", "We meet at 7pm the usual place", "I am attaching you");
assertMockEndpointsSatisfied();
}
use of org.jvnet.mock_javamail.Mailbox in project camel by apache.
the class MailSearchTermUriConfigTest method testSearchTerm.
@Test
public void testSearchTerm() throws Exception {
Mailbox mailbox = Mailbox.get("bill@localhost");
assertEquals(6, mailbox.size());
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("I like riding the Camel", "Ordering Camel in Action");
assertMockEndpointsSatisfied();
}
use of org.jvnet.mock_javamail.Mailbox in project camel by apache.
the class MailUsingOwnComponentTest method testUsingOwnMailComponent.
@Test
public void testUsingOwnMailComponent() throws Exception {
Mailbox.clearAll();
template.sendBodyAndHeader("mailbox:foo", "Hello Mailbox", "to", "davsclaus@apache.org");
Mailbox box = Mailbox.get("davsclaus@apache.org");
Message msg = box.get(0);
assertEquals("davsclaus@apache.org", msg.getRecipients(Message.RecipientType.TO)[0].toString());
}
use of org.jvnet.mock_javamail.Mailbox in project camel by apache.
the class MailSortTermThreeTest method testSortTerm.
@Test
public void testSortTerm() throws Exception {
Mailbox mailbox = Mailbox.get("bill@localhost");
assertEquals(3, mailbox.size());
// This one has search term set
MockEndpoint mockDescImap = getMockEndpoint("mock:resultDescendingImap");
mockDescImap.expectedBodiesReceived("Even later date", "Later date", "Earlier date");
context.startAllRoutes();
assertMockEndpointsSatisfied();
}
Aggregations