use of org.junit.Ignore in project head by mifos.
the class SavingsBOTest method savingsPerformanceDepositsIsIncrementedByTotalAmountDeposited.
/**
* FIXME - ignoring as is hitting hibernate..
*/
@Ignore
@Test
public void savingsPerformanceDepositsIsIncrementedByTotalAmountDeposited() throws AccountException {
// setup
final Money zero = new Money(defaultCurrency);
savingsAccount = savingsAccountBuilder.withBalanceOf(zero).asInActive().build();
final Money amountToDeposit = new Money(TestUtils.RUPEE, "100.0");
final Date dateOfDeposit = new DateTime().toDate();
// stubbing
when(accountPayment.getAmount()).thenReturn(amountToDeposit);
when(accountPayment.getPaymentDate()).thenReturn(dateOfDeposit);
// exercise test
savingsAccount.deposit(accountPayment, payingCustomer);
// verification
assertThat(savingsAccount.getSavingsPerformance().getTotalDeposits(), is(amountToDeposit));
}
use of org.junit.Ignore in project head by mifos.
the class SavingsBOTest method generateNextSetOfMeetingDatesMoratoriumOn2ndInstallment.
/**
* passing locally on eclipse but not on maven.
*/
@Ignore
@Test
public void generateNextSetOfMeetingDatesMoratoriumOn2ndInstallment() throws Exception {
// setup
Holiday moratorium = new HolidayBuilder().from(new DateMidnight().toDateTime().plusWeeks(1)).to(new DateMidnight().toDateTime().plusWeeks(1)).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 < 2) {
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++;
}
}
use of org.junit.Ignore in project head by mifos.
the class SavingsBOTest method shouldPayOffAnyPaymentsAssociatedWithPayingCustomerAndMandatorySavingsAccount.
@Ignore
@Test
public void shouldPayOffAnyPaymentsAssociatedWithPayingCustomerAndMandatorySavingsAccount() throws AccountException {
// setup
SavingsOfferingBO savingsProduct = new SavingsProductBuilder().mandatory().buildForUnitTests();
savingsAccount = savingsAccountBuilder.withSavingsProduct(savingsProduct).buildForUnitTests();
final SavingsScheduleEntity unpaidSaving1 = new SavingsScheduleBuilder().withAccount(savingsAccount).withCustomer(payingCustomer).build();
final List<SavingsScheduleEntity> unpaidDepositsForPayingCustomer = Arrays.asList(unpaidSaving1);
final Money zero = new Money(defaultCurrency);
SavingsOfferingBO manSavingsProduct = new SavingsProductBuilder().mandatory().buildForUnitTests();
savingsAccount = savingsAccountBuilder.withSavingsProduct(manSavingsProduct).withBalanceOf(zero).withPayments(unpaidDepositsForPayingCustomer).buildForUnitTests();
final Money amountToDeposit = new Money(TestUtils.RUPEE, "100.0");
final Date dateOfDeposit = new DateTime().toDate();
// stubbing
when(accountPayment.getAmount()).thenReturn(amountToDeposit);
when(accountPayment.getPaymentDate()).thenReturn(dateOfDeposit);
// exercise test
savingsAccount.deposit(accountPayment, payingCustomer);
// verification
verify(paymentStrategy).makeScheduledPayments(accountPayment, unpaidDepositsForPayingCustomer, payingCustomer, SavingsType.MANDATORY, zero);
}
use of org.junit.Ignore in project head by mifos.
the class SavingsBOTest method generateNextSetOfMeetingDatesNoHoliday.
@Ignore
@Test
public void generateNextSetOfMeetingDatesNoHoliday() throws Exception {
// setup
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.buildForUnitTests();
savingsAccount.generateNextSetOfMeetingDates(allWorkingDays, emptyListOfHolidays);
// verify
List<SavingsScheduleEntity> sortedSavingsSchedules = getSortedSavingsScheduleEntities();
assertThat(sortedSavingsSchedules.size(), is(20));
DateTime installmentDate = new DateMidnight().toDateTime();
int installmentId = 1;
for (SavingsScheduleEntity savingsScheduleEntity : getSortedSavingsScheduleEntities()) {
assertThat(savingsScheduleEntity.getActionDate(), is(installmentDate.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++;
}
}
use of org.junit.Ignore in project head by mifos.
the class CollectionSheetServiceImplRetrieveSavingsAccountsIntegrationTest method testPartPayingMandatorySavingsAccountResultsInAReducedTotalDepositAmountWhenCollectionSheetRetrievedAgain.
/**
* need to clean up test data set up
*/
@Ignore
@Test
public void testPartPayingMandatorySavingsAccountResultsInAReducedTotalDepositAmountWhenCollectionSheetRetrievedAgain() throws Exception {
CollectionSheetDto collectionSheet = collectionSheetRetrieveSavingsAccountsUtils.createSampleCollectionSheetDto();
StaticHibernateUtil.flushAndClearSession();
// pay 0.2 of the 1.0 mandatory client individual savings amount due (derived from center mandatory savings
// account)
collectionSheet.getCollectionSheetCustomer().get(2).getIndividualSavingAccounts().get(0).setDepositDue(new BigDecimal("0.2"));
// process
List<CollectionSheetCustomerDto> customersAfterProcessing = convertSaveRetrieveVerifyAndReturnProcessedCollectionSheetCustomers(collectionSheet);
assertThat(customersAfterProcessing.get(2).getIndividualSavingAccounts().get(0).getTotalDepositAmount(), is(0.8));
}
Aggregations