use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_confirmTest method testConfirm_daoException_assertNoAggregation.
@Test
public void testConfirm_daoException_assertNoAggregation() throws Exception {
AggregationDAO dao = mock(AggregationDAO.class);
doThrow(new RuntimeException()).when(dao).confirmAggregation((String) any());
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(dao);
boolean exceptionOccured = false;
try {
repo.confirm(context, "12345");
} catch (RuntimeException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_confirmTest method testConfirm_exchangeNotInRepository_assertNoException.
@Test
public void testConfirm_exchangeNotInRepository_assertNoException() {
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(notifDao);
repo.confirm(context, "12345");
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_doStartTest method testDoStart_emptyDAO_assertException.
@Test
public void testDoStart_emptyDAO_assertException() throws Exception {
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository();
boolean exceptionOccured = false;
try {
repo.doStart();
} catch (RuntimeException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_doStartTest method testDoStart_emptyAggregation_assertNoException.
@Test
public void testDoStart_emptyAggregation_assertNoException() throws Exception {
AggregationDAO dao = mock(AggregationDAO.class);
when(dao.getAggregationKeys()).thenReturn(new ArrayList<String>());
when(dao.getAggregationCompletedKeys()).thenReturn(new ArrayList<String>());
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(dao);
repo.doStart();
repo.doStop();
}
use of org.nhindirect.monitor.aggregator.repository.ConcurrentJPAAggregationRepository in project nhin-d by DirectProject.
the class ConcurrentJPAAggregationRepository_getKeysTest method testGetKeys_emptyRepository_assertEmptyList.
@Test
public void testGetKeys_emptyRepository_assertEmptyList() {
final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(notifDao);
final Set<String> keys = repo.getKeys();
assertEquals(0, keys.size());
}
Aggregations