Search in sources :

Example 1 with MeetingBuilder

use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.

the class AccountIntegrationTestCase method createInitialCustomerAccounts.

private void createInitialCustomerAccounts() {
    meeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    IntegrationTestObjectMother.saveMeeting(meeting);
    center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
    group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
    List<FeeDto> fees = new ArrayList<FeeDto>();
    client = TestObjectFactory.createClient("Client", CustomerStatus.CLIENT_ACTIVE, group, fees, "1034556", new DateTime(1986, 04, 02, 0, 0, 0, 0).toDate());
}
Also used : ArrayList(java.util.ArrayList) FeeDto(org.mifos.accounts.fees.business.FeeDto) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) DateTime(org.joda.time.DateTime)

Example 2 with MeetingBuilder

use of org.mifos.domain.builders.MeetingBuilder 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);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) LocalDate(org.joda.time.LocalDate) Test(org.junit.Test)

Example 3 with MeetingBuilder

use of org.mifos.domain.builders.MeetingBuilder 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);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) LocalDate(org.joda.time.LocalDate) Test(org.junit.Test)

Example 4 with MeetingBuilder

use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.

the class AccountRegenerateScheduleIntegrationTestCase method testChangeMonthlyMeetingScheduleOnADateInSecondMonth.

@Test
public void testChangeMonthlyMeetingScheduleOnADateInSecondMonth() 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, 9));
    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, JUNE, 1);
    MeetingBO meeting = setupMonthlyMeeting(startDate, 1, 9);
    MeetingBO newMeeting = TestObjectFactory.createMeeting(new MeetingBuilder().monthly().every(1).buildMonthlyForDayNumber(20));
    testChangeInMeetingScheduleForDates(meeting, newMeeting, startDate, dateWhenMeetingWillBeChanged);
    validateSchedules(expectedMeetingDates);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) LocalDate(org.joda.time.LocalDate) Test(org.junit.Test)

Example 5 with MeetingBuilder

use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.

the class EditStatusActionStrutsTest method createCenterGroupClientHierarchy.

private void createCenterGroupClientHierarchy() throws CustomerException {
    meeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
    IntegrationTestObjectMother.saveMeeting(meeting);
    center = new CenterBuilder().withName("Savings Center").with(meeting).with(sampleBranchOffice()).withLoanOfficer(testUser()).withActivationDate(mondayTwoWeeksAgo()).build();
    IntegrationTestObjectMother.createCenter(center, meeting);
    group = new GroupBuilder().withName("Group").withMeeting(meeting).withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(center).build();
    IntegrationTestObjectMother.createGroup(group, meeting);
    client = new ClientBuilder().withName("Client 1").active().withMeeting(meeting).withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(group).buildForIntegrationTests();
    IntegrationTestObjectMother.createClient(client, meeting);
}
Also used : GroupBuilder(org.mifos.domain.builders.GroupBuilder) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) ClientBuilder(org.mifos.domain.builders.ClientBuilder)

Aggregations

MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)106 Test (org.junit.Test)74 MeetingBO (org.mifos.application.meeting.business.MeetingBO)74 CenterBuilder (org.mifos.domain.builders.CenterBuilder)73 DateTime (org.joda.time.DateTime)58 ArrayList (java.util.ArrayList)47 CenterBO (org.mifos.customers.center.business.CenterBO)43 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)38 LocalDate (org.joda.time.LocalDate)27 GroupBuilder (org.mifos.domain.builders.GroupBuilder)24 Before (org.junit.Before)21 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)20 FeeBuilder (org.mifos.domain.builders.FeeBuilder)20 OfficeBO (org.mifos.customers.office.business.OfficeBO)19 ClientBuilder (org.mifos.domain.builders.ClientBuilder)15 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)14 CalendarEventBuilder (org.mifos.domain.builders.CalendarEventBuilder)14 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)13 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)11 Ignore (org.junit.Ignore)10