use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class LoanPrdBusinessServiceTest method testInvalidConnectionThrowsExceptionInGetLoanOfferingWithLocaleId.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionThrowsExceptionInGetLoanOfferingWithLocaleId() throws PersistenceException {
try {
when(loanPrdPersistence.getLoanOffering(new Short("112"), localeId)).thenThrow(new PersistenceException("some exception"));
loanPrdBusinessService.getLoanOffering(new Short("112"), localeId);
Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class LoanPrdBusinessServiceTest method testInvalidConnectionThrowsExceptionInGetApplicablePrdStatus.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionThrowsExceptionInGetApplicablePrdStatus() throws PersistenceException {
try {
when(prdOfferingPersistence.getApplicablePrdStatus(ProductType.LOAN, localeId)).thenThrow(new PersistenceException("some exception"));
loanPrdBusinessService.getApplicablePrdStatus(localeId);
Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class ProductCategoryBusinessServiceTest method testInvalidConnectionGetProductTypes.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionGetProductTypes() throws PersistenceException {
try {
when(productCategoryPersistence.getProductTypes()).thenThrow(new PersistenceException("some exception"));
service.getProductTypes();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class SavingsPrdBusinessServiceTest method testInvalidConnectionForGetActiveSavingsProductCategories.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionForGetActiveSavingsProductCategories() throws PersistenceException {
try {
when(prdOfferingPersistence.getApplicableProductCategories(ProductType.SAVINGS, PrdCategoryStatus.ACTIVE)).thenThrow(new PersistenceException("some exception"));
service.getActiveSavingsProductCategories();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class OfficeBusinessServiceTest method testInvalidConnectionInGetOffice.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetOffice() throws PersistenceException {
try {
when(officePersistence.getOffice(id)).thenThrow(new PersistenceException("some exception"));
service.getOffice(id);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
Aggregations