use of org.junit.Ignore in project head by mifos.
the class LoanScheduleEntityIntegrationTest method testGetTotalDueWithFees.
@Ignore
@Test
public void testGetTotalDueWithFees() {
LoanScheduleEntity accountActionDate = (LoanScheduleEntity) groupLoan.getAccountActionDates().toArray()[0];
accountActionDate.setPrincipalPaid(new Money(getCurrency(), "10.0"));
accountActionDate.setInterestPaid(new Money(getCurrency(), "2.0"));
accountActionDate.setPenalty(new Money(getCurrency(), "20.0"));
accountActionDate.setPenaltyPaid(new Money(getCurrency(), "5.0"));
accountActionDate.setMiscPenalty(new Money(getCurrency(), "10.0"));
accountActionDate.setMiscFee(new Money(getCurrency(), "20.0"));
accountActionDate.setMiscFeePaid(new Money(getCurrency(), "5.0"));
Assert.assertEquals(TestUtils.createMoney(240.0), accountActionDate.getTotalDueWithFees());
}
use of org.junit.Ignore in project head by mifos.
the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInNextMeetingHoliday.
@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInNextMeetingHoliday() throws Exception {
buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.NEXT_MEETING_OR_REPAYMENT);
createClientSavingsAccount();
short installmentId = 1;
DateTime installmentDate = expectedFirstDepositDate;
for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
if (installmentId == 2) {
// only second installment pushed out one week.
assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.plusWeeks(1).toDate())));
} else {
assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
}
assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
installmentId++;
installmentDate = installmentDate.plusWeeks(1);
}
}
use of org.junit.Ignore in project head by mifos.
the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInNextWorkingDayHoliday.
@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInNextWorkingDayHoliday() throws Exception {
// One-day holiday on the second deposit date, Monday
buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.NEXT_WORKING_DAY);
createClientSavingsAccount();
short installmentId = 1;
DateTime installmentDate = expectedFirstDepositDate;
for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
if (installmentId == 2) {
assertThat(new LocalDate(scheduleEntity.getActionDate()), //Tuesday after holiday
is(new LocalDate(installmentDate.plusDays(1).toDate())));
} else {
assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
}
assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
installmentId++;
installmentDate = installmentDate.plusWeeks(1);
}
}
use of org.junit.Ignore in project head by mifos.
the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInMoratorium.
@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInMoratorium() throws Exception {
buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
createClientSavingsAccount();
short installmentId = 1;
DateTime installmentDate = expectedFirstDepositDate;
for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
if (installmentId < 2) {
assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
} else {
// second and following dates pushed out one week.
assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.plusWeeks(1).toDate())));
}
assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
installmentId++;
installmentDate = installmentDate.plusWeeks(1);
}
}
use of org.junit.Ignore in project head by mifos.
the class LoanBOTest method testCopyInstallmentSchedule.
/**
* does't work when changing applicatonConfiguration.custom.properties file.
* Need to pull out static references to AccountingRules in used classes.
*/
@Ignore
@Test
public void testCopyInstallmentSchedule() {
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");
}
Aggregations