use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TimelyAndReliableCompletionCondition_getIncompleteRecipientsEmptyTxsTest method testIsComplete_noMessageToTrack_emptyTxs.
@Test
public void testIsComplete_noMessageToTrack_emptyTxs() {
TimelyAndReliableCompletionCondition condition = new TimelyAndReliableCompletionCondition();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.DSN, "", UUID.randomUUID().toString(), "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "");
Collection<Tx> txs = new ArrayList<Tx>();
txs.add(originalMessage);
Collection<String> recips = condition.getIncompleteRecipients(txs);
assertEquals(0, recips.size());
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TimelyAndReliableCompletionCondition_isCompleteTest method testIsComplete_noMessageToTrack_assertFalse.
@Test
public void testIsComplete_noMessageToTrack_assertFalse() {
TimelyAndReliableCompletionCondition condition = new TimelyAndReliableCompletionCondition();
Tx tx = new Tx(TxMessageType.DSN, new HashMap<String, TxDetail>());
List<Tx> txs = Arrays.asList(tx);
assertFalse(condition.isComplete(txs));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TimelyAndReliableCompletionCondition_isCompleteTest method testIsComplete_MDNDispotionNull_assertFalse.
@Test
public void testIsComplete_MDNDispotionNull_assertFalse() {
TimelyAndReliableCompletionCondition condition = new TimelyAndReliableCompletionCondition();
// original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "");
// MDN to original message
Tx mdnMessage = TestUtils.makeReliableMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "", "");
List<Tx> txs = Arrays.asList(originalMessage, mdnMessage);
assertFalse(condition.isComplete(txs));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TimelyAndReliableCompletionCondition_isCompleteTest method testIsComplete_FinalRicipNull_assertFalse.
@Test
public void testIsComplete_FinalRicipNull_assertFalse() {
TimelyAndReliableCompletionCondition condition = new TimelyAndReliableCompletionCondition();
// original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "");
// MDN to original message
Tx mdnMessage = TestUtils.makeReliableMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "", "", MDNStandard.Disposition_Processed);
List<Tx> txs = Arrays.asList(originalMessage, mdnMessage);
assertFalse(condition.isComplete(txs));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class GeneralCompletionCondition_isCompleteTest method testIsComplete_DSNMessageReceived_plusNotationOnDSNRecip_rfc822NotactionOnFinalRecip_assertTrue.
@Test
public void testIsComplete_DSNMessageReceived_plusNotationOnDSNRecip_rfc822NotactionOnFinalRecip_assertTrue() {
GeneralCompletionCondition condition = new GeneralCompletionCondition();
// original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "");
// MDN to original message
Tx mdnMessage = TestUtils.makeMessage(TxMessageType.DSN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552+readreciept@cerner.com", "rfc822; gm2552@direct.securehealthemail.com");
List<Tx> txs = Arrays.asList(originalMessage, mdnMessage);
assertTrue(condition.isComplete(txs));
}
Aggregations