Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93668: ALF-21099 - MailActionExecutor.java doesn't support sending email by doing CC/BCC


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94991 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 12:31:16 +00:00
parent 1b9e432553
commit c9ca04c8dc
2 changed files with 79 additions and 0 deletions

View File

@@ -493,6 +493,34 @@ public abstract class AbstractMailActionExecuterTest
PERSON_SERVICE.deletePerson(USER_2);
}
}
/**
* Test for CC / BCC
* @throws Exception
*/
@Test
public void testSendingToCarbonCopy() throws IOException, MessagingException
{
// PARAM_TO variant
Action mailAction = ACTION_SERVICE.createAction(MailActionExecuter.NAME);
mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, "some.body@example.com");
mailAction.setParameterValue(MailActionExecuter.PARAM_TO, "some.bodyelse@example.com");
mailAction.setParameterValue(MailActionExecuter.PARAM_CC, "some.carbon@example.com");
mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Testing");
mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, "alfresco/templates/mail/test.txt.ftl");
mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL, (Serializable) getModel());
ACTION_SERVICE.executeAction(mailAction, null);
MimeMessage message = ACTION_EXECUTER.retrieveLastTestMessage();
Assert.assertNotNull(message);
Assert.assertEquals("Hello Jan 1, 1970", (String) message.getContent());
Assert.assertEquals("recipents too short", (message.getAllRecipients()).length, 3);
}
/**
* Test for MNT-11079