use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class VariableCompletionCondition_isTimelyAndRequiredTest method testIsTimelyAndRequired_MDNOptionForTimely_assertTrue.
@Test
public void testIsTimelyAndRequired_MDNOptionForTimely_assertTrue() {
TxCompletionCondition cond1 = mock(TxCompletionCondition.class);
TxCompletionCondition cond2 = mock(TxCompletionCondition.class);
VariableCompletionCondition cond = new VariableCompletionCondition(cond1, cond2);
Map<String, TxDetail> details = new HashMap<String, TxDetail>();
details.put(TxDetailType.DISPOSITION_OPTIONS.getType(), new TxDetail(TxDetailType.DISPOSITION_OPTIONS, MDNStandard.DispositionOption_TimelyAndReliable));
Tx msg = new Tx(TxMessageType.IMF, details);
assertTrue(cond.isRelAndTimelyRequired(msg));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class VariableCompletionCondition_isTimelyAndRequiredTest method testIsTimelyAndRequired_MDNOptionNotForTimely_assertFalse.
@Test
public void testIsTimelyAndRequired_MDNOptionNotForTimely_assertFalse() {
TxCompletionCondition cond1 = mock(TxCompletionCondition.class);
TxCompletionCondition cond2 = mock(TxCompletionCondition.class);
VariableCompletionCondition cond = new VariableCompletionCondition(cond1, cond2);
Map<String, TxDetail> details = new HashMap<String, TxDetail>();
details.put(TxDetailType.DISPOSITION_OPTIONS.getType(), new TxDetail(TxDetailType.DISPOSITION_OPTIONS, "X-NOT-TIMELY"));
Tx msg = new Tx(TxMessageType.IMF, details);
assertFalse(cond.isRelAndTimelyRequired(msg));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class TimelyAndReliableCompletionCondition_isCompleteTest method testIsComplete_noFinalRecips_assertFalse.
@Test
public void testIsComplete_noFinalRecips_assertFalse() {
TimelyAndReliableCompletionCondition condition = new TimelyAndReliableCompletionCondition();
Map<String, TxDetail> details = new HashMap<String, TxDetail>();
String msgId = UUID.randomUUID().toString();
details.put(TxDetailType.MSG_ID.getType(), new TxDetail(TxDetailType.MSG_ID, msgId));
Tx tx = new Tx(TxMessageType.IMF, details);
List<Tx> txs = Arrays.asList(tx);
assertFalse(condition.isComplete(txs));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class GeneralCompletionCondition_isCompleteTest method testIsComplete_noFinalRecips_assertFalse.
@Test
public void testIsComplete_noFinalRecips_assertFalse() {
GeneralCompletionCondition condition = new GeneralCompletionCondition();
Map<String, TxDetail> details = new HashMap<String, TxDetail>();
String msgId = UUID.randomUUID().toString();
details.put(TxDetailType.MSG_ID.getType(), new TxDetail(TxDetailType.MSG_ID, msgId));
Tx tx = new Tx(TxMessageType.IMF, details);
List<Tx> txs = Arrays.asList(tx);
assertFalse(condition.isComplete(txs));
}
use of org.nhindirect.common.tx.model.TxDetail in project nhin-d by DirectProject.
the class GeneralCompletionCondition_isCompleteTest method testIsComplete_noMessageToTrack_assertFalse.
@Test
public void testIsComplete_noMessageToTrack_assertFalse() {
GeneralCompletionCondition condition = new GeneralCompletionCondition();
Tx tx = new Tx(TxMessageType.DSN, new HashMap<String, TxDetail>());
List<Tx> txs = Arrays.asList(tx);
assertFalse(condition.isComplete(txs));
}
Aggregations