use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TestMultiRecipNonReliableMessageMonitorRoute method testMultiRecip_MDNProcessedReceived_assertConditionNotComplete.
@Test
public void testMultiRecip_MDNProcessedReceived_assertConditionNotComplete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
// send original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeReliableMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com,ah4626@test.com", "", "", "");
template.sendBody("direct:start", originalMessage);
// send MDN processed to original message
Tx mdnMessage = TestUtils.makeReliableMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "", MDNStandard.Disposition_Processed);
template.sendBody("direct:start", mdnMessage);
List<Exchange> exchanges = mock.getReceivedExchanges();
assertEquals(0, exchanges.size());
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TestMultiRecipNonReliableMessageMonitorRoute method testMultiRecip_MDNErrorForAllRecips_assertConditionComplete.
@Test
public void testMultiRecip_MDNErrorForAllRecips_assertConditionComplete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
// send original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeReliableMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com,ah4626@test.com", "", "", "");
template.sendBody("direct:start", originalMessage);
// send MDN error to original message
Tx mdnMessage = TestUtils.makeReliableMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "", MDNStandard.Disposition_Error);
template.sendBody("direct:start", mdnMessage);
// send MDN error to original message from other recip
mdnMessage = TestUtils.makeReliableMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "ah4626@test.com", "gm2552@cerner.com", "ah4626@test.com", "", MDNStandard.Disposition_Error);
template.sendBody("direct:start", mdnMessage);
List<Exchange> exchanges = mock.getReceivedExchanges();
assertEquals(1, exchanges.size());
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TestNonReliableMessageMonitorRoute method testMulitipleRecips_singleDSNReceivedWithAllRecipeints_assertConditionComplete.
@Test
public void testMulitipleRecips_singleDSNReceivedWithAllRecipeints_assertConditionComplete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
// send original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com," + "ah4626@direct.securehealthemail.com", "");
template.sendBody("direct:start", originalMessage);
// send DSN to original message with the second recipient
Tx dsnMessage = TestUtils.makeMessage(TxMessageType.DSN, UUID.randomUUID().toString(), originalMessageId, "ah4626@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com,ah4626@direct.securehealthemail.com");
template.sendBody("direct:start", dsnMessage);
List<Exchange> exchanges = mock.getReceivedExchanges();
assertEquals(1, exchanges.size());
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TestNonReliableMessageMonitorRoute method testSingleRecipMDNReceived_assertConditionComplete.
@Test
public void testSingleRecipMDNReceived_assertConditionComplete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
// send original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com", "");
template.sendBody("direct:start", originalMessage);
// send MDN to original message
Tx mdnMessage = TestUtils.makeMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com");
template.sendBody("direct:start", mdnMessage);
List<Exchange> exchanges = mock.getReceivedExchanges();
assertEquals(1, exchanges.size());
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class TestNonReliableMessageMonitorRoute method testMulitipleRecips_SingleMDNReceived_assertConditionNotComplete.
@Test
public void testMulitipleRecips_SingleMDNReceived_assertConditionNotComplete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
// send original message
final String originalMessageId = UUID.randomUUID().toString();
Tx originalMessage = TestUtils.makeMessage(TxMessageType.IMF, originalMessageId, "", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com," + "ah4626@direct.securehealthemail.com", "");
template.sendBody("direct:start", originalMessage);
// send MDN to original message
Tx mdnMessage = TestUtils.makeMessage(TxMessageType.MDN, UUID.randomUUID().toString(), originalMessageId, "gm2552@direct.securehealthemail.com", "gm2552@cerner.com", "gm2552@direct.securehealthemail.com");
template.sendBody("direct:start", mdnMessage);
List<Exchange> exchanges = mock.getReceivedExchanges();
assertEquals(0, exchanges.size());
}
Aggregations