use of org.mifos.accounts.fees.exceptions.FeeException in project head by mifos.
the class FeeBO method update.
public void update() throws FeeException {
try {
setUpdateDetails();
ApplicationContextProvider.getBean(LegacyAccountDao.class).createOrUpdate(this);
} catch (PersistenceException e) {
throw new FeeException(FeeConstants.FEE_UPDATE_ERROR, e);
}
}
use of org.mifos.accounts.fees.exceptions.FeeException in project head by mifos.
the class FeeBOTest method testInvalidConnectionThrowsExceptionInConstructor.
@Test
@ExpectedException(value = FeeException.class)
public void testInvalidConnectionThrowsExceptionInConstructor() throws PersistenceException {
final OfficePersistence officePersistence = mock(OfficePersistence.class);
try {
when(officePersistence.getHeadOffice()).thenThrow(new PersistenceException("some exception"));
new RateFeeBO(null, "Customer Fee", new CategoryTypeEntity(FeeCategory.CENTER), new FeeFrequencyTypeEntity(FeeFrequencyType.ONETIME), null, 2.0, null, false, new FeePaymentEntity(FeePayment.UPFRONT)) {
@Override
public OfficePersistence getOfficePersistence() {
return officePersistence;
}
};
Assert.fail("should fail because of invalid session");
} catch (FeeException e) {
}
}
Aggregations