Search in sources :

Example 11 with NotificationMessage

use of org.nhindirect.stagent.mail.notifications.NotificationMessage in project nhin-d by DirectProject.

the class NotificationProducerTest method testProduceSingleMDN.

public void testProduceSingleMDN() throws Exception {
    NotificationSettings setting = new NotificationSettings(true, "", "");
    NotificationProducer prod = new NotificationProducer(setting);
    IncomingMessage msg = getMessageFromFile("PlainIncomingMessage.txt", Arrays.asList("cerner.com"));
    Collection<NotificationMessage> notes = prod.produce(msg);
    assertNotNull(notes);
    assertEquals(1, notes.size());
    NotificationMessage noteMsg = notes.iterator().next();
    assertEquals(msg.getDomainRecipients().get(0).toString(), noteMsg.getFrom()[0].toString());
}
Also used : NotificationMessage(org.nhindirect.stagent.mail.notifications.NotificationMessage) IncomingMessage(org.nhindirect.stagent.IncomingMessage)

Aggregations

NotificationMessage (org.nhindirect.stagent.mail.notifications.NotificationMessage)11 IncomingMessage (org.nhindirect.stagent.IncomingMessage)7 MessagingException (javax.mail.MessagingException)4 MimeMessage (javax.mail.internet.MimeMessage)4 NHINDAddress (org.nhindirect.stagent.NHINDAddress)4 NHINDAddressCollection (org.nhindirect.stagent.NHINDAddressCollection)4 Tx (org.nhindirect.common.tx.model.Tx)3 Message (org.nhindirect.stagent.mail.Message)3 ArrayList (java.util.ArrayList)2 MailAddress (org.apache.mailet.MailAddress)2 ProvideAndRegisterDocumentSetRequestType (ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 UnknownHostException (java.net.UnknownHostException)1 Collection (java.util.Collection)1 Address (javax.mail.Address)1 InternetHeaders (javax.mail.internet.InternetHeaders)1 AuditContext (org.nhindirect.common.audit.AuditContext)1 AuditEvent (org.nhindirect.common.audit.AuditEvent)1