use of org.joda.time.LocalDate in project head by mifos.
the class StandardAccountServiceTest method testDisbursalAmountScaleDifferenceDoesNotMatter.
@Test
public void testDisbursalAmountScaleDifferenceDoesNotMatter() throws Exception {
when(mockLoanAccount.getLoanAmount()).thenReturn(new Money(TestUtils.EURO, "300"));
AccountPaymentParametersDto disbursal = new AccountPaymentParametersDto(new UserReferenceDto((short) 1), new AccountReferenceDto(1), new BigDecimal("300.0000000000000"), new LocalDate(), new PaymentTypeDto((short) 1, "CASH"), "");
List<InvalidPaymentReason> errors = new ArrayList<InvalidPaymentReason>();
standardAccountService.disbursalAmountMatchesFullLoanAmount(disbursal.getPaymentAmount(), errors, mockLoanAccount);
assertThat(errors.isEmpty(), is(true));
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method testChangeThirdThursdayMonthlyMeetingScheduleOnADateInFirstMonthAfterMeetingDate.
@Test
public // original schedule 11/20/08, 12/18/08, 1/15/09, 2/19/09, 3/19/09, 4/16/09
void testChangeThirdThursdayMonthlyMeetingScheduleOnADateInFirstMonthAfterMeetingDate() throws Exception {
List<LocalDate> expectedMeetingDates = new ArrayList<LocalDate>();
expectedMeetingDates.add(new LocalDate(2008, NOVEMBER, 20));
expectedMeetingDates.add(new LocalDate(2008, DECEMBER, 2));
expectedMeetingDates.add(new LocalDate(2009, JANUARY, 6));
expectedMeetingDates.add(new LocalDate(2009, FEBRUARY, 3));
expectedMeetingDates.add(new LocalDate(2009, MARCH, 3));
expectedMeetingDates.add(new LocalDate(2009, APRIL, 7));
LocalDate startDate = new LocalDate(2008, NOVEMBER, 20);
LocalDate dateWhenMeetingWillBeChanged = new LocalDate(2008, NOVEMBER, 30);
MeetingBO meeting = setupMonthlyMeeting(startDate, 1, RankOfDay.THIRD, WeekDay.THURSDAY);
MeetingBO newMeeting = TestObjectFactory.createMeeting(new MeetingBuilder().monthly().every(1).buildMonthlyFor(RankOfDay.FIRST, WeekDay.TUESDAY));
testChangeInMeetingScheduleForDates(meeting, newMeeting, startDate, dateWhenMeetingWillBeChanged);
validateSchedules(expectedMeetingDates);
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method testChangeMeetingInLastWeekOfSchedule.
// a change in the last week of a schedule should not change the schedule
@Test
public void testChangeMeetingInLastWeekOfSchedule() throws Exception {
List<LocalDate> expectedMeetingDates = new ArrayList<LocalDate>();
expectedMeetingDates.add(new LocalDate(2008, MAY, 23));
expectedMeetingDates.add(new LocalDate(2008, MAY, 30));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 6));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 13));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 20));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 27));
LocalDate startDate = new LocalDate(2008, MAY, 23);
LocalDate dateWhenMeetingWillBeChanged = new LocalDate(2008, JUNE, 25);
MeetingBO meeting = setupWeeklyMeeting(startDate, EVERY_WEEK);
MeetingBO newMeeting = TestObjectFactory.getNewMeeting(RecurrenceType.WEEKLY, EVERY_WEEK, MeetingType.CUSTOMER_MEETING, WeekDay.WEDNESDAY);
testChangeInMeetingScheduleForDates(meeting, newMeeting, startDate, dateWhenMeetingWillBeChanged);
validateSchedules(expectedMeetingDates);
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method testChangeMonthlyMeetingScheduleOnADateInFirstMonthBeforeMeetingDate.
@Test
public void testChangeMonthlyMeetingScheduleOnADateInFirstMonthBeforeMeetingDate() throws Exception {
List<LocalDate> expectedMeetingDates = new ArrayList<LocalDate>();
expectedMeetingDates.add(new LocalDate(2008, APRIL, 9));
expectedMeetingDates.add(new LocalDate(2008, MAY, 9));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 20));
expectedMeetingDates.add(new LocalDate(2008, JULY, 20));
expectedMeetingDates.add(new LocalDate(2008, AUGUST, 20));
LocalDate startDate = new LocalDate(2008, APRIL, 9);
LocalDate dateWhenMeetingWillBeChanged = new LocalDate(2008, MAY, 3);
MeetingBO meeting = setupMonthlyMeeting(startDate, 1, 9);
MeetingBO newMeeting = TestObjectFactory.createMeeting(new MeetingBuilder().monthly().every(1).buildMonthlyForDayNumber(20));
testChangeInMeetingScheduleForDates(meeting, newMeeting, startDate, dateWhenMeetingWillBeChanged);
validateSchedules(expectedMeetingDates);
}
use of org.joda.time.LocalDate in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method testChangeMeetingInFirstWeekOfSchedule.
/*
* original schedule dates: 5/23, 5/30, 6/6, 6/13, 6/20, 6/27
*/
@Test
public void testChangeMeetingInFirstWeekOfSchedule() throws Exception {
List<LocalDate> expectedMeetingDates = new ArrayList<LocalDate>();
expectedMeetingDates.add(new LocalDate(2008, MAY, 23));
expectedMeetingDates.add(new LocalDate(2008, MAY, 28));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 4));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 11));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 18));
expectedMeetingDates.add(new LocalDate(2008, JUNE, 25));
LocalDate startDate = new LocalDate(2008, MAY, 23);
LocalDate dateWhenMeetingWillBeChanged = new LocalDate(2008, MAY, 25);
MeetingBO meeting = setupWeeklyMeeting(startDate, EVERY_WEEK);
MeetingBO newMeeting = TestObjectFactory.getNewMeeting(RecurrenceType.WEEKLY, EVERY_WEEK, MeetingType.CUSTOMER_MEETING, WeekDay.WEDNESDAY);
testChangeInMeetingScheduleForDates(meeting, newMeeting, startDate, dateWhenMeetingWillBeChanged);
validateSchedules(expectedMeetingDates);
}
Aggregations