use of org.subethamail.wiser.WiserMessage in project camunda-bpm-platform by camunda.
the class AsyncEmailTaskTest method testSimpleTextMailSendTask.
// copied from org.camunda.bpm.engine.test.bpmn.mail.EmailSendTaskTest
@Deployment
public void testSimpleTextMailSendTask() throws Exception {
runtimeService.startProcessInstanceByKey("simpleTextOnly");
List<WiserMessage> messages = wiser.getMessages();
assertEquals(0, messages.size());
waitForJobExecutorToProcessAllJobs(5000L);
messages = wiser.getMessages();
assertEquals(1, messages.size());
WiserMessage message = messages.get(0);
EmailServiceTaskTest.assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "camunda@localhost", Arrays.asList("kermit@camunda.org"), null);
}
use of org.subethamail.wiser.WiserMessage in project camunda-bpm-platform by camunda.
the class AsyncEmailTaskTest method testSimpleTextMail.
// copied from org.camunda.bpm.engine.test.bpmn.mail.EmailServiceTaskTest
@Deployment
public void testSimpleTextMail() throws Exception {
String procId = runtimeService.startProcessInstanceByKey("simpleTextOnly").getId();
List<WiserMessage> messages = wiser.getMessages();
assertEquals(0, messages.size());
waitForJobExecutorToProcessAllJobs(5000L);
messages = wiser.getMessages();
assertEquals(1, messages.size());
WiserMessage message = messages.get(0);
EmailServiceTaskTest.assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "camunda@localhost", Arrays.asList("kermit@camunda.org"), null);
assertProcessEnded(procId);
}
use of org.subethamail.wiser.WiserMessage in project camunda-bpm-platform by camunda.
the class EmailServiceTaskTest method testTextMailExpressions.
@Deployment
public void testTextMailExpressions() throws Exception {
String sender = "mispiggy@activiti.org";
String recipient = "fozziebear@activiti.org";
String recipientName = "Mr. Fozzie";
String subject = "Fozzie, you should see this!";
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("sender", sender);
vars.put("recipient", recipient);
vars.put("recipientName", recipientName);
vars.put("subject", subject);
runtimeService.startProcessInstanceByKey("textMailExpressions", vars);
List<WiserMessage> messages = wiser.getMessages();
assertEquals(1, messages.size());
WiserMessage message = messages.get(0);
assertEmailSend(message, false, subject, "Hello " + recipientName + ", this is an e-mail", sender, Arrays.asList(recipient), null);
}
use of org.subethamail.wiser.WiserMessage in project camunda-bpm-platform by camunda.
the class EmailSendTaskTest method testSendEmail.
@Deployment
public void testSendEmail() throws Exception {
String from = "ordershipping@activiti.org";
boolean male = true;
String recipientName = "John Doe";
String recipient = "johndoe@alfresco.com";
Date now = new Date();
String orderId = "123456";
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("sender", from);
vars.put("recipient", recipient);
vars.put("recipientName", recipientName);
vars.put("male", male);
vars.put("now", now);
vars.put("orderId", orderId);
runtimeService.startProcessInstanceByKey("sendMailExample", vars);
List<WiserMessage> messages = wiser.getMessages();
assertEquals(1, messages.size());
WiserMessage message = messages.get(0);
MimeMessage mimeMessage = message.getMimeMessage();
assertEquals("Your order " + orderId + " has been shipped", mimeMessage.getHeader("Subject", null));
assertEquals(from, mimeMessage.getHeader("From", null));
assertTrue(mimeMessage.getHeader("To", null).contains(recipient));
}
use of org.subethamail.wiser.WiserMessage in project camunda-bpm-platform by camunda.
the class EmailSendTaskTest method testSimpleTextMail.
@Deployment
public void testSimpleTextMail() throws Exception {
runtimeService.startProcessInstanceByKey("simpleTextOnly");
List<WiserMessage> messages = wiser.getMessages();
assertEquals(1, messages.size());
WiserMessage message = messages.get(0);
assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "camunda@localhost", Arrays.asList("kermit@camunda.org"), null);
}
Aggregations