use of org.nhindirect.monitor.processor.DuplicateNotificationStateManager in project nhin-d by DirectProject.
the class TxResource_suppressNotificationTest method testSuppressNotification_mgrException_assert500StatusCode.
@Test
public void testSuppressNotification_mgrException_assert500StatusCode() throws Exception {
Tx tx = mock(Tx.class);
DuplicateNotificationStateManager dupMgr = mock(DuplicateNotificationStateManager.class);
when(dupMgr.suppressNotification(tx)).thenThrow(new DuplicateNotificationStateManagerException());
TxsResource resource = new TxsResource(null, dupMgr);
Response res = resource.supressNotification(tx);
assertEquals(500, res.getStatus());
}
use of org.nhindirect.monitor.processor.DuplicateNotificationStateManager in project nhin-d by DirectProject.
the class TxResource_suppressNotificationTest method testSuppressNotification_suppressFalse_assertFalseAnd200StatusCode.
@Test
public void testSuppressNotification_suppressFalse_assertFalseAnd200StatusCode() {
Tx tx = mock(Tx.class);
DuplicateNotificationStateManager dupMgr = mock(DuplicateNotificationStateManager.class);
TxsResource resource = new TxsResource(null, dupMgr);
Response res = resource.supressNotification(tx);
assertEquals(200, res.getStatus());
assertFalse((Boolean) res.getEntity());
}
use of org.nhindirect.monitor.processor.DuplicateNotificationStateManager in project nhin-d by DirectProject.
the class TxResource_suppressNotificationTest method testSuppressNotification_suppressTrue_assertTrueAnd200StatusCode.
@Test
public void testSuppressNotification_suppressTrue_assertTrueAnd200StatusCode() throws Exception {
Tx tx = mock(Tx.class);
DuplicateNotificationStateManager dupMgr = mock(DuplicateNotificationStateManager.class);
when(dupMgr.suppressNotification(tx)).thenReturn(true);
TxsResource resource = new TxsResource(null, dupMgr);
Response res = resource.supressNotification(tx);
assertEquals(200, res.getStatus());
assertTrue((Boolean) res.getEntity());
}
use of org.nhindirect.monitor.processor.DuplicateNotificationStateManager in project nhin-d by DirectProject.
the class TxsResource_constructTest method testConstruct_nonNullProducer.
@Test
public void testConstruct_nonNullProducer() {
ProducerTemplate template = mock(ProducerTemplate.class);
DuplicateNotificationStateManager dupMgr = mock(DuplicateNotificationStateManager.class);
TxsResource resource = new TxsResource(template, dupMgr);
assertEquals(template, resource.template);
assertEquals(dupMgr, resource.dupStateManager);
}
Aggregations