use of org.nhindirect.config.store.dao.impl.CertPolicyDaoImpl in project nhin-d by DirectProject.
the class CertPolicyDaoBase_getPolicyGroupsByDomainTest method testGetPolicyGroupsByDomain_noEntityManager_assertException.
@Test
public void testGetPolicyGroupsByDomain_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.getPolicyGroupsByDomain(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_addPolicyGroupTest method testAddPolicyGroup_noEntityManager_assertException.
@Test
public void testAddPolicyGroup_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.addPolicyGroup(new CertPolicyGroup());
} 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_addPolicyTest method testAddPolicy_noEntityManager_assertException.
@Test
public void testAddPolicy_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.addPolicy(new CertPolicy());
} 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_getPolicyGroupByNameTest method testGetPolicyGroupByName_noEntityManager_assertException.
@Test
public void testGetPolicyGroupByName_noEntityManager_assertException() {
final CertPolicyDaoImpl dao = new CertPolicyDaoImpl();
boolean exceptionOccured = false;
try {
dao.getPolicyGroupByName("any");
} 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_getPolicyGroupByNameTest method testGetPolicyGroupByName_exceptionInQuery_assertException.
@Test
public void testGetPolicyGroupByName_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.getPolicyGroupByName("any");
} catch (ConfigurationStoreException ex) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations