use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_generalMDNMessage_noOrigMessageId.
@Test
public void testGetMessageDetails_generalMDNMessage_noOrigMessageId() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MDNMessageOrigInReplyTo.txt");
msg.setHeader(MailStandard.Headers.InReplyTo, "");
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());
assertNull(details.get(TxDetailType.PARENT_MSG_ID.getType()));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_generalDNSMessage.
@Test
public void testGetMessageDetails_generalDNSMessage() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("DSNMessage.txt");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertEquals("failed", details.get(TxDetailType.DSN_ACTION.getType()).getDetailValue());
assertEquals("5.0.0", details.get(TxDetailType.DSN_STATUS.getType()).getDetailValue());
assertEquals("Carol@Ivory.EDU".toLowerCase(Locale.getDefault()), details.get(TxDetailType.FINAL_RECIPIENTS.getType()).getDetailValue());
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_noMessageId.
@Test
public void testGetMessageDetails_noMessageId() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MessageWithAttachment.txt");
msg.setHeader(MailStandard.Headers.MessageID, "");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertNull(details.get(TxDetailType.MSG_ID.getType()));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_noFinalRecipient.
@Test
public void testGetMessageDetails_noFinalRecipient() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MDNMessageNoFinalRecip.txt");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertNull(details.get(TxDetailType.FINAL_RECIPIENTS.getType()));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class DefaultTxDetailParser_getMimeMessageDetailsTest method testGetMessageDetails_noSender.
@Test
public void testGetMessageDetails_noSender() throws Exception {
final MimeMessage msg = TestUtils.readMimeMessageFromFile("MessageWithAttachment.txt");
final DefaultTxDetailParser parser = new DefaultTxDetailParser();
final Map<String, TxDetail> details = parser.getMessageDetails(msg);
assertNull(details.get(TxDetailType.SENDER.getType()));
}
Aggregations