use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class ProductCategoryBusinessServiceTest method testInvalidConnectionGetProductCategoryStatusList.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionGetProductCategoryStatusList() throws PersistenceException {
try {
when(productCategoryPersistence.getProductCategoryStatusList()).thenThrow(new PersistenceException("some exception"));
service.getProductCategoryStatusList();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class ProductCategoryBusinessServiceTest method testInvalidConnectionGetAllCategories.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionGetAllCategories() throws PersistenceException {
try {
when(productCategoryPersistence.getAllCategories()).thenThrow(new PersistenceException("some exception"));
service.getAllCategories();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class ProductCategoryBusinessServiceTest method testInvalidConnectionForFindByGlobalNum.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionForFindByGlobalNum() throws PersistenceException {
String globalNum = "globalNum";
try {
when(productCategoryPersistence.findByGlobalNum(globalNum)).thenThrow(new PersistenceException("some exception"));
service.findByGlobalNum(globalNum);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class SavingsPrdBusinessServiceTest method testInvalidConnectionForGetApplicablePrdStatus.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionForGetApplicablePrdStatus() throws PersistenceException {
try {
Short localeId = new Short("123");
when(prdOfferingPersistence.getApplicablePrdStatus(ProductType.SAVINGS, localeId)).thenThrow(new PersistenceException("some exception"));
service.getApplicablePrdStatus(localeId);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.mifos.framework.exceptions.PersistenceException in project head by mifos.
the class CustomerBusinessServiceTest method testInvalidConnectionFindBySystemId.
@Test
public void testInvalidConnectionFindBySystemId() throws PersistenceException {
try {
String globalNum = "globalNum";
when(customerPersistence.findBySystemId(globalNum)).thenThrow(new PersistenceException("some exception"));
service.findBySystemId(globalNum);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
Aggregations