use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPoliciesTest method testGetPolices_exceptionInQuery_assertException.
@Test
public void testGetPolices_exceptionInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery((String) any());
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.getPolicies();
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPolicyByIdTest method testGetPolicyById_noEntityManager_assertException.
@Test
public void testGetPolicyById_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.getPolicyById(1234);
} catch (IllegalStateException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPolicyByIdTest method testGetPolicyById_exceptionInQuery_assertException.
@Test
public void testGetPolicyById_exceptionInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery((String) any());
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.getPolicyById(1234);
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPolicyByNameTest method testGetPolicyByName_exceptionInQuery_assertException.
@Test
public void testGetPolicyByName_exceptionInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery((String) any());
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.getPolicyByName("any");
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPolicyByNameTest method testGetPolicyByName_noEntityManager_assertException.
@Test
public void testGetPolicyByName_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.getPolicyByName("any");
} catch (IllegalStateException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations