use of org.junit.Ignore in project head by mifos.
the class LoanBOTest method testLoanSummaryShouldBeUpdateOnInstallmentScheduleUpdate.
/**
* does't work when changing applicatonConfiguration.custom.properties file.
* Need to pull out static references to AccountingRules in used classes.
*/
@Ignore
@Test
public void testLoanSummaryShouldBeUpdateOnInstallmentScheduleUpdate() {
Money.setDefaultCurrency(rupee);
LoanBO loanBO = new LoanAccountBuilder().build();
loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 10, 2010), "100", "10", "1", Money.zero(rupee)));
loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 11, 2010), "100", "10", "2", Money.zero(rupee)));
loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 12, 2010), "100", "10", "3", Money.zero(rupee)));
List<RepaymentScheduleInstallment> installments = new ArrayList<RepaymentScheduleInstallment>();
installments.add(getRepaymentScheduleInstallment("24-Oct-2010", 1, "123", "12"));
installments.add(getRepaymentScheduleInstallment("24-Nov-2010", 2, "231", "23"));
installments.add(getRepaymentScheduleInstallment("24-Dec-2010", 3, "312", "31"));
loanBO.updateInstallmentSchedule(installments);
Set<LoanScheduleEntity> loanScheduleEntities = loanBO.getLoanScheduleEntities();
LoanScheduleEntity[] loanScheduleEntitiesArr = loanScheduleEntities.toArray(new LoanScheduleEntity[loanScheduleEntities.size()]);
assertLoanScheduleEntity(loanScheduleEntitiesArr[0], "123.0", "12.0", "2010-10-24");
assertLoanScheduleEntity(loanScheduleEntitiesArr[1], "231.0", "23.0", "2010-11-24");
assertLoanScheduleEntity(loanScheduleEntitiesArr[2], "312.0", "31.0", "2010-12-24");
LoanSummaryEntity loanSummary = loanBO.getLoanSummary();
assertEquals("666.0", loanSummary.getOriginalPrincipal().toString());
assertEquals("66.0", loanSummary.getOriginalInterest().toString());
}
use of org.junit.Ignore in project head by mifos.
the class AccountBOIntegrationTest method testGetPeriodicFeeList.
@Ignore
@Test
public void testGetPeriodicFeeList() throws PersistenceException {
FeeBO oneTimeFee = TestObjectFactory.createOneTimeAmountFee("One Time Fee", FeeCategory.LOAN, "20", FeePayment.TIME_OF_DISBURSEMENT);
AccountFeesEntity accountOneTimeFee = new AccountFeesEntity(groupLoan, oneTimeFee, new Double("1.0"));
groupLoan.addAccountFees(accountOneTimeFee);
legacyAccountDao.createOrUpdate(groupLoan);
StaticHibernateUtil.flushSession();
groupLoan = TestObjectFactory.getObject(LoanBO.class, groupLoan.getAccountId());
Assert.assertEquals(1, groupLoan.getPeriodicFeeList().size());
}
use of org.junit.Ignore in project head by mifos.
the class LoanAdjustmentsIntegrationTest method testWhenALoanIsRepaidEarlyAndThenAdjustedThatTheLoanSummaryAndSchedulesDetailsAreTheSameBeforeAndAfter.
/**
* not sure why this is failing now.
*/
@Ignore
@Test
public void testWhenALoanIsRepaidEarlyAndThenAdjustedThatTheLoanSummaryAndSchedulesDetailsAreTheSameBeforeAndAfter() throws Exception {
// relates to mifos-1986
new DateTimeService().setCurrentDateTimeFixed(date(2010, 10, 13));
loan = createLoan();
Money initialOriginalPrincipal = loan.getLoanSummary().getOriginalPrincipal();
Money initialOriginalInterest = loan.getLoanSummary().getOriginalInterest();
Money initialOriginalFees = loan.getLoanSummary().getOriginalFees();
Money initialPrincipalPaid = loan.getLoanSummary().getPrincipalPaid();
Money initialInterestPaid = loan.getLoanSummary().getInterestPaid();
Money initialFeesPaid = loan.getLoanSummary().getFeesPaid();
// pay 3 installments
makePayment(loan, "333.0");
StaticHibernateUtil.flushAndClearSession();
loan = (LoanBO) legacyAccountDao.getAccount(loan.getAccountId());
loan.updateDetails(TestUtils.makeUserWithLocales());
assertThat(loan.getLoanSummary().getOriginalPrincipal(), is(initialOriginalPrincipal));
assertThat(loan.getLoanSummary().getOriginalInterest(), is(initialOriginalInterest));
assertThat(loan.getLoanSummary().getOriginalFees(), is(initialOriginalFees));
assertFalse(loan.getLoanSummary().getPrincipalPaid().equals(initialPrincipalPaid));
assertFalse(loan.getLoanSummary().getInterestPaid().equals(initialInterestPaid));
assertFalse(loan.getLoanSummary().getFeesPaid().equals(initialFeesPaid));
List<LoanInstallment> copySchedule = copyLoanSchedule(loan);
makeEarlyPayment(loan);
StaticHibernateUtil.flushAndClearSession();
loan = (LoanBO) legacyAccountDao.getAccount(loan.getAccountId());
loan.updateDetails(TestUtils.makeUserWithLocales());
// The early repayment should have caused the original interest and fees to be changed to equal the amounts
// paid.
assertThat(loan.getLoanSummary().getOriginalPrincipal(), is(initialOriginalPrincipal));
assertFalse(loan.getLoanSummary().getOriginalInterest().equals(initialOriginalInterest));
assertFalse(loan.getLoanSummary().getOriginalFees().equals(initialOriginalFees));
assertThat(loan.getLoanSummary().getPrincipalPaid(), is(loan.getLoanSummary().getOriginalPrincipal()));
assertThat(loan.getLoanSummary().getInterestPaid(), is(loan.getLoanSummary().getOriginalInterest()));
assertThat(loan.getLoanSummary().getFeesPaid(), is(loan.getLoanSummary().getOriginalFees()));
assertFalse(sameSchedule(copySchedule, loan.getAccountActionDates()));
adjustLastLoanPayment(loan);
StaticHibernateUtil.flushAndClearSession();
loan = (LoanBO) legacyAccountDao.getAccount(loan.getAccountId());
loan.updateDetails(TestUtils.makeUserWithLocales());
// The adjustment of a completed loan should have caused the original amounts to be reset
assertThat(loan.getLoanSummary().getOriginalPrincipal(), is(initialOriginalPrincipal));
assertThat(loan.getLoanSummary().getOriginalInterest(), is(initialOriginalInterest));
assertThat(loan.getLoanSummary().getOriginalFees(), is(initialOriginalFees));
assertTrue(sameSchedule(copySchedule, loan.getAccountActionDates()));
}
use of org.junit.Ignore in project head by mifos.
the class FeeActionStrutsTest method testSuccessfulEditPreview.
@Ignore
@Test
public void testSuccessfulEditPreview() throws Exception {
fee = TestObjectFactory.createOneTimeAmountFee("One Time Fee", FeeCategory.ALLCUSTOMERS, "12.34", FeePayment.UPFRONT);
LookUpValueEntity lookUpValue = new LookUpValueEntity();
fee.getFeeFrequency().getFeeFrequencyType().setLookUpValue(lookUpValue);
fee.getFeeFrequency().getFeePayment().setLookUpValue(lookUpValue);
String feeId = fee.getFeeId().toString();
request.setAttribute("feeModel", TestObjectFactory.getAmountBasedFee(feeId, "1", "12.34"));
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
setRequestPathInfo("/feeaction.do");
addRequestParameter("method", "manage");
addRequestParameter("feeId", feeId);
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
setRequestPathInfo("/feeaction.do");
addRequestParameter("method", "editPreview");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter("amount", "200.0");
addRequestParameter("feeStatus", FeeStatus.INACTIVE.getValue().toString());
actionPerform();
verifyNoActionErrors();
verifyForward(ActionForwards.editPreview_success.toString());
FeeActionForm actionForm = (FeeActionForm) request.getSession().getAttribute("feeactionform");
Assert.assertEquals("200.0", actionForm.getAmount());
Assert.assertEquals(FeeStatus.INACTIVE, actionForm.getFeeStatusValue());
Assert.assertNull(actionForm.getRate());
Assert.assertNull(actionForm.getFeeFormula());
}
use of org.junit.Ignore in project head by mifos.
the class SavingsBOTest method generateNextSetOfMeetingDatesMoratoriumOn12thInstallment.
@Ignore
@Test
public void generateNextSetOfMeetingDatesMoratoriumOn12thInstallment() throws Exception {
// setup
Holiday moratorium = new HolidayBuilder().from(new DateMidnight().toDateTime().plusWeeks(11)).to(new DateMidnight().toDateTime().plusWeeks(11)).withRepaymentMoratoriumRule().build();
List<Holiday> withMoratorium = new ArrayList<Holiday>();
withMoratorium.add(moratorium);
when(savingsAccountCustomer.getCustomerMeeting()).thenReturn(customerMeetingEntity);
when(customerMeetingEntity.getMeeting()).thenReturn(defaultWeeklyCustomerMeeting);
when(savingsAccountCustomer.getCustomerLevel()).thenReturn(customerLevelEntity);
when(customerLevelEntity.getId()).thenReturn(CustomerLevel.CLIENT.getValue());
// exercise test
savingsAccount = savingsAccountBuilder.with(moratorium).buildForUnitTests();
savingsAccount.generateNextSetOfMeetingDates(allWorkingDays, withMoratorium);
// verify
List<SavingsScheduleEntity> sortedSavingsSchedules = getSortedSavingsScheduleEntities();
assertThat(sortedSavingsSchedules.size(), is(20));
DateTime installmentDate = new DateMidnight().toDateTime();
int installmentId = 1;
for (SavingsScheduleEntity savingsScheduleEntity : getSortedSavingsScheduleEntities()) {
if (installmentId < 12) {
assertThat("Installment " + installmentId, savingsScheduleEntity.getActionDate(), is(installmentDate.toDate()));
} else {
// Second and later deposits are pushed out one week by the moratorium
assertThat("Installment " + installmentId, savingsScheduleEntity.getActionDate(), is(installmentDate.plusWeeks(1).toDate()));
}
assertThat(savingsScheduleEntity.getDeposit(), is(new Money(TestUtils.RUPEE, "13.0")));
assertThat(savingsScheduleEntity.getDepositPaid(), is(new Money(TestUtils.RUPEE, "0.0")));
installmentDate = installmentDate.plusWeeks(1);
installmentId++;
}
}
Aggregations