use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class MeetingBOTest method testWeeklyMeetingInterval.
@Test
public void testWeeklyMeetingInterval() {
MeetingBO meeting = new MeetingBuilder().weekly().every(1).occuringOnA(WeekDay.THURSDAY).build();
meeting.setFiscalCalendarRules(fiscalCalendarRules);
when(fiscalCalendarRules.getStartOfWeekWeekDay()).thenReturn(WeekDay.MONDAY);
LocalDate paymentDate = new LocalDate(2010, 2, 4);
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 1, 31), paymentDate), is(false));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 2, 1), paymentDate), is(true));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 2, 7), paymentDate), is(true));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 2, 8), paymentDate), is(false));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class MeetingBOTest method testMonthlyOnDayOfMonthMeetingInterval.
@Test
public void testMonthlyOnDayOfMonthMeetingInterval() throws MeetingException {
MeetingBO meeting = new MeetingBuilder().monthly().every(1).buildMonthlyForDayNumber(20);
meeting.setFiscalCalendarRules(fiscalCalendarRules);
when(fiscalCalendarRules.getStartOfWeekWeekDay()).thenReturn(WeekDay.MONDAY);
LocalDate paymentDate = new LocalDate(2010, 2, 3);
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 1, 31), paymentDate), is(false));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 2, 1), paymentDate), is(true));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 2, 28), paymentDate), is(true));
assertThat(meeting.queryDateIsInMeetingIntervalForFixedDate(new LocalDate(2010, 3, 1), paymentDate), is(false));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterServiceFacadeWebTierIntegrationTest method shouldCreateCenterWithExpectedSearchId.
@Test
public void shouldCreateCenterWithExpectedSearchId() {
MeetingBO meeting = new MeetingBuilder().withStartDate(new DateTime().minusWeeks(2)).build();
MeetingDto meetingDto = meeting.toDto();
String displayName = "testCenter";
String externalId = null;
AddressDto addressDto = new AddressDto("here", "", "", "", "", "", "", "");
PersonnelBO user = IntegrationTestObjectMother.findPersonnelById(Short.valueOf("1"));
Short loanOfficerId = user.getPersonnelId();
List<CreateAccountFeeDto> feesToApply = new ArrayList<CreateAccountFeeDto>();
CustomerStatus.GROUP_ACTIVE.getValue();
OfficeBO headOffice = IntegrationTestObjectMother.findOfficeById(Short.valueOf("1"));
// setup
createOfficeHierarchyUnderHeadOffice(headOffice);
Short officeId = branch1.getOfficeId();
DateTime mfiJoiningDate = new DateTime().minusWeeks(2);
new DateTime().minusWeeks(1);
CenterCreationDetail centerCreationDetail = new CenterCreationDetail(mfiJoiningDate.toLocalDate(), displayName, externalId, addressDto, loanOfficerId, officeId, feesToApply);
// exercise test
CustomerDetailsDto newlyCreatedCenterDetails = centerServiceFacade.createNewCenter(centerCreationDetail, meetingDto);
// verification
CenterBO center = customerDao.findCenterBySystemId(newlyCreatedCenterDetails.getGlobalCustNum());
Assert.assertThat(center.getSearchId(), is("1." + center.getCustomerId()));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterStatusChangeIntegrationTest method cleanDatabaseTables.
@Before
public void cleanDatabaseTables() throws Exception {
databaseCleaner.clean();
Locale locale = Localization.getInstance().getConfiguredLocale();
AuditConfiguration.init(locale);
existingUser = IntegrationTestObjectMother.testUser();
existingLoanOfficer = IntegrationTestObjectMother.testUser();
existingOffice = IntegrationTestObjectMother.sampleBranchOffice();
existingMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
IntegrationTestObjectMother.saveMeeting(existingMeeting);
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class GroupCreationUsingCustomerServiceIntegrationTest method cleanDatabaseTables.
@Before
public void cleanDatabaseTables() {
databaseCleaner.clean();
noAccountFees = new ArrayList<AccountFeesEntity>();
existingUser = IntegrationTestObjectMother.testUser();
existingLoanOfficer = IntegrationTestObjectMother.testUser();
existingOffice = IntegrationTestObjectMother.sampleBranchOffice();
existingMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
IntegrationTestObjectMother.saveMeeting(existingMeeting);
existingCenter = new CenterBuilder().with(existingMeeting).withName("Center-IntegrationTest").with(existingOffice).withLoanOfficer(existingLoanOfficer).withUserContext().build();
IntegrationTestObjectMother.createCenter(existingCenter, existingMeeting);
}
Aggregations