use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class DefaultDuplicateNotificationStateManager_suppressNotificationTest method testSuppressNotification_nonNotificationTx_assertFalse.
@Test
public void testSuppressNotification_nonNotificationTx_assertFalse() throws Exception {
DefaultDuplicateNotificationStateManager mgr = new DefaultDuplicateNotificationStateManager();
mgr.setDao(notifDao);
Tx tx = TestUtils.makeMessage(TxMessageType.IMF, "1234", "", "", "", "gm2552@cerner.com");
assertFalse(mgr.suppressNotification(tx));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class DefaultDuplicateNotificationStateManager_suppressNotificationTest method testSuppressNotification_recipInStore_assertTrue.
@Test
public void testSuppressNotification_recipInStore_assertTrue() throws Exception {
DefaultDuplicateNotificationStateManager mgr = new DefaultDuplicateNotificationStateManager();
mgr.setDao(notifDao);
Tx tx = TestUtils.makeMessage(TxMessageType.MDN, "1234", "5678", "", "", "gm2552@cerner.com", "", MDNStandard.Disposition_Error);
mgr.addNotification(tx);
assertTrue(mgr.suppressNotification(tx));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class DefaultDuplicateNotificationStateManager_suppressNotificationTest method testSuppressNotification_displayedDisposition_assertFalse.
@Test
public void testSuppressNotification_displayedDisposition_assertFalse() throws Exception {
DefaultDuplicateNotificationStateManager mgr = new DefaultDuplicateNotificationStateManager();
mgr.setDao(notifDao);
Tx tx = TestUtils.makeMessage(TxMessageType.MDN, "1234", "5678", "", "", "", "", MDNStandard.Disposition_Displayed);
assertFalse(mgr.suppressNotification(tx));
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class DefaultDuplicateNotificationStateManager_suppressNotificationTest method testAddNotification_daoError_assertException.
@SuppressWarnings("unchecked")
@Test
public void testAddNotification_daoError_assertException() throws Exception {
DefaultDuplicateNotificationStateManager mgr = new DefaultDuplicateNotificationStateManager();
boolean execptionOccured = false;
NotificationDuplicationDAO spyDao = mock(NotificationDuplicationDAO.class);
doThrow(new NotificationDAOException("")).when(spyDao).getReceivedAddresses((String) any(), (Collection<String>) any());
mgr.setDao(spyDao);
try {
Tx tx = TestUtils.makeMessage(TxMessageType.DSN, "1234", "5678", "", "", "gm2552@cerner.com,ah4626@cerner.com");
mgr.suppressNotification(tx);
} catch (DuplicateNotificationStateManagerException e) {
execptionOccured = true;
}
assertTrue(execptionOccured);
}
use of org.nhindirect.common.tx.model.Tx in project nhin-d by DirectProject.
the class DefaultDuplicateNotificationStateManager_suppressNotificationTest method testSuppressNotification_noFinalRecip_assertFalse.
@Test
public void testSuppressNotification_noFinalRecip_assertFalse() throws Exception {
DefaultDuplicateNotificationStateManager mgr = new DefaultDuplicateNotificationStateManager();
mgr.setDao(notifDao);
Tx tx = TestUtils.makeMessage(TxMessageType.MDN, "1234", "5678", "", "", "", "", MDNStandard.Disposition_Error);
assertFalse(mgr.suppressNotification(tx));
}
Aggregations