use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_generalMDNMessage_noOrigMessageId_getFromReplyTo.
@Test
public void testGetMessageDetails_generalMDNMessage_noOrigMessageId_getFromReplyTo() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MDNMessageOrigInReplyTo.txt");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertEquals(MDNStandard.getMDNField(msg, MDNStandard.Headers.Disposition).toLowerCase(Locale.getDefault()), details.get(TxDetailType.DISPOSITION.getType()).getDetailValue());
assertEquals(MDNStandard.getMDNField(msg, MDNStandard.Headers.FinalRecipient).toLowerCase(Locale.getDefault()), details.get(TxDetailType.FINAL_RECIPIENTS.getType()).getDetailValue());
assertEquals(MailStandard.getHeader(msg, MailStandard.Headers.InReplyTo), details.get(TxDetailType.PARENT_MSG_ID.getType()).getDetailValue());
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_noSubject.
@Test
public void testGetMessageDetails_noSubject() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MessageWithAttachment.txt");
msg.setHeader(MailStandard.Headers.Subject, "");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertNull(details.get(TxDetailType.SUBJECT.getType()));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_mutlipleTo.
@Test
public void testGetMessageDetails_mutlipleTo() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MessageWithAttachment.txt");
msg.setHeader(MailStandard.Headers.To, "gm2552@cerner.com,ah4626@cerner.com");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertEquals(MailStandard.getHeader(msg, MailStandard.Headers.To).toLowerCase(Locale.getDefault()), details.get(TxDetailType.RECIPIENTS.getType()).getDetailValue());
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_generalDNSMessage_noOrigMessageId_getFromReplyTo.
@Test
public void testGetMessageDetails_generalDNSMessage_noOrigMessageId_getFromReplyTo() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("DSNMessageOrigInReplyTo.txt");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertEquals("<9501051053.aa04167@IETF.CNR I.Reston.VA.US>", details.get(TxDetailType.PARENT_MSG_ID.getType()).getDetailValue());
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_noFrom.
@Test
public void testGetMessageDetails_noFrom() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MessageWithAttachment.txt");
msg.setHeader(MailStandard.Headers.From, "");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertNull(details.get(TxDetailType.FROM.getType()));
}
Aggregations