use of org.nhindirect.config.store.dao.impl.TrustBundleDaoImpl in project nhin-d by DirectProject.
the class TrustBundleDaoImpl_disassociateTrustBundlesFromDomainTest method testDisassociateTrustBundlesFromDomain_noEntityManager_assertException.
@Test
public void testDisassociateTrustBundlesFromDomain_noEntityManager_assertException() {
final TrustBundleDaoImpl dao = new TrustBundleDaoImpl();
boolean exceptionOccured = false;
try {
dao.disassociateTrustBundlesFromDomain(1234);
} catch (IllegalStateException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.TrustBundleDaoImpl in project nhin-d by DirectProject.
the class TrustBundleDaoImpl_getBundlesTest method testGetTrustBundles_noEntityManager_assertException.
@Test
public void testGetTrustBundles_noEntityManager_assertException() {
final TrustBundleDaoImpl dao = new TrustBundleDaoImpl();
boolean exceptionOccured = false;
try {
dao.getTrustBundles();
} catch (IllegalStateException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.TrustBundleDaoImpl in project nhin-d by DirectProject.
the class TrustBundleDaoImpl_getBundlesTest method testGetTrustBundles_exceptionInQuery_assertException.
@Test
public void testGetTrustBundles_exceptionInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery((String) any());
final TrustBundleDaoImpl dao = new TrustBundleDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.getTrustBundles();
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.TrustBundleDaoImpl in project nhin-d by DirectProject.
the class TrustBundleDaoImpl_getTrustBundleByIdTest method testGetTrustBundleById_noEntityManager_assertException.
@Test
public void testGetTrustBundleById_noEntityManager_assertException() {
final TrustBundleDaoImpl dao = new TrustBundleDaoImpl();
boolean exceptionOccured = false;
try {
dao.getTrustBundleById(1234);
} catch (IllegalStateException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.TrustBundleDaoImpl in project nhin-d by DirectProject.
the class TrustBundleDaoImpl_getTrustBundleByIdTest method testGetTrustBundleById_exceptionInQuery_assertException.
@Test
public void testGetTrustBundleById_exceptionInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery((String) any());
final TrustBundleDaoImpl dao = new TrustBundleDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.getTrustBundleById(1234);
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations