Search in sources :

Example 1 with SecondaryMimeMessage

use of org.nhindirect.stagent.utils.SecondaryMimeMessage in project nhin-d by DirectProject.

the class DefaultNHINDAgent_ProcessOutgoingMessage_Test method testMessageIsWrapped_WrapMessageIsNotCalled.

/**
	 * 
	 * @throws Exception
	 */
public void testMessageIsWrapped_WrapMessageIsNotCalled() throws Exception {
    new TestPlan() {

        protected OutgoingMessage createMessage() throws Exception {
            MimeMessage mimeMsg = new SecondaryMimeMessage();
            mimeMsg.setText("");
            Message msg = new Message(mimeMsg) {

                @Override
                public String getContentType() throws MessagingException {
                    return MailStandard.MediaType.WrappedMessage;
                }
            };
            NHINDAddressCollection recipients = new NHINDAddressCollection();
            recipients.add(new NHINDAddress(""));
            NHINDAddress sender = new NHINDAddress("");
            theCreateMessage = new OutgoingMessage(msg, recipients, sender) {

                @Override
                protected void categorizeRecipients(TrustEnforcementStatus minTrustStatus) {
                    categorizeRecipientsCalls++;
                    categorizeRecipients_Internal(minTrustStatus);
                }
            };
            return theCreateMessage;
        }

        protected void doAssertions() throws Exception {
            assertEquals(0, wrapMessageCalls);
        }
    }.perform();
}
Also used : TrustEnforcementStatus(org.nhindirect.stagent.trust.TrustEnforcementStatus) SecondaryMimeMessage(org.nhindirect.stagent.utils.SecondaryMimeMessage) Message(org.nhindirect.stagent.mail.Message) MimeMessage(javax.mail.internet.MimeMessage) BaseTestPlan(org.nhindirect.stagent.utils.BaseTestPlan) SecondaryMimeMessage(org.nhindirect.stagent.utils.SecondaryMimeMessage) MimeMessage(javax.mail.internet.MimeMessage) MessagingException(javax.mail.MessagingException) SecondaryMimeMessage(org.nhindirect.stagent.utils.SecondaryMimeMessage) MessagingException(javax.mail.MessagingException)

Aggregations

MessagingException (javax.mail.MessagingException)1 MimeMessage (javax.mail.internet.MimeMessage)1 Message (org.nhindirect.stagent.mail.Message)1 TrustEnforcementStatus (org.nhindirect.stagent.trust.TrustEnforcementStatus)1 BaseTestPlan (org.nhindirect.stagent.utils.BaseTestPlan)1 SecondaryMimeMessage (org.nhindirect.stagent.utils.SecondaryMimeMessage)1