use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoImpl_getPolicyGroupDomainReltnsTest method testGetPolicyGroups_exceptionInQuery_assertException.
@Test
public void testGetPolicyGroups_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.getPolicyGroupDomainReltns();
} 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_getPolicyGroupDomainReltnsTest method testGetPolicyGroups_noEntityManager_assertException.
@Test
public void testGetPolicyGroups_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.getPolicyGroupDomainReltns();
} 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_getPolicyGroupsTest method testGetPolicyGroups_exceptionInQuery_assertException.
@Test
public void testGetPolicyGroups_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.getPolicyGroups();
} 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_removePolicyUseFromGroupTest method testRemovePolicyFromGroup_errorInQuery_assertException.
@Test
public void testRemovePolicyFromGroup_errorInQuery_assertException() {
final EntityManager manager = mock(EntityManager.class);
doThrow(new RuntimeException("Just Passing Through")).when(manager).createQuery("SELECT cpr from CertPolicyGroupReltn cpr WHERE cpr.id = ?1");
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
dao.setEntityManager(manager);
boolean exceptionOccured = false;
try {
dao.removePolicyUseFromGroup(1234);
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations