use of org.mifos.customers.business.service.CustomerService in project head by mifos.
the class AccountRegenerateScheduleIntegrationTestCase method testChangeInMeetingScheduleForDates.
public void testChangeInMeetingScheduleForDates(MeetingBO customerMeeting, MeetingBO loanMeeting, MeetingBO newMeeting, LocalDate startDate, LocalDate dateWhenMeetingWillBeChanged, boolean useClosedAndCancelled) throws Exception {
log("Start: " + startDate + ", Test: " + dateWhenMeetingWillBeChanged);
accountBO = createLoanAccount(customerMeeting, loanMeeting);
savingsBO = createSavingsAccount(customerMeeting);
// center initially set up with meeting today
center = TestObjectFactory.getCenter(center.getCustomerId());
accountBO = TestObjectFactory.getObject(LoanBO.class, accountBO.getAccountId());
if (useClosedAndCancelled) {
PersonnelBO loggedInUser = IntegrationTestObjectMother.testUser();
accountBO.changeStatus(AccountState.LOAN_CANCELLED, null, "", loggedInUser);
savingsBO.changeStatus(AccountState.SAVINGS_CANCELLED.getValue(), null, "", loggedInUser);
CustomerStatusEntity customerStatusEntity = new CustomerStatusEntity(CustomerStatus.GROUP_CLOSED);
CustomerBOTestUtils.setCustomerStatus(group, customerStatusEntity);
StaticHibernateUtil.flushSession();
}
new DateTimeService().setCurrentDateTime(dateWhenMeetingWillBeChanged.toDateTimeAtStartOfDay());
CustomerService customerService = ApplicationContextProvider.getBean(CustomerService.class);
newMeeting.updateDetails(TestUtils.makeUser());
customerService.updateCustomerMeetingSchedule(newMeeting, center);
TestObjectFactory.updateObject(center);
List<Days> workingDays = new FiscalCalendarRules().getWorkingDaysAsJodaTimeDays();
List<Holiday> holidays = new ArrayList<Holiday>();
boolean isTopOfHierarchy = center.isTopOfHierarchy();
center.getCustomerAccount().handleChangeInMeetingSchedule(workingDays, holidays, isTopOfHierarchy);
accountBO.handleChangeInMeetingSchedule(workingDays, holidays, isTopOfHierarchy);
savingsBO.handleChangeInMeetingSchedule(workingDays, holidays, isTopOfHierarchy);
StaticHibernateUtil.flushSession();
}
use of org.mifos.customers.business.service.CustomerService in project head by mifos.
the class CustomerPersistenceIntegrationTest method ignore_testFindCustomerWithNoAssocationsLoadedDoesntReturnInactiveCenter.
public void ignore_testFindCustomerWithNoAssocationsLoadedDoesntReturnInactiveCenter() throws Exception {
meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
center = TestObjectFactory.createWeeklyFeeCenter("Inactive Center", meeting);
StaticHibernateUtil.flushSession();
CustomerStatusFlag customerStatusFlag = CustomerStatusFlag.GROUP_CANCEL_BLACKLISTED;
CustomerNoteEntity customerNote = new CustomerNoteEntity("Made Inactive", new java.util.Date(), center.getPersonnel(), center);
CustomerService customerService = ApplicationContextProvider.getBean(CustomerService.class);
customerService.updateCenterStatus((CenterBO) center, CustomerStatus.CENTER_INACTIVE, customerStatusFlag, customerNote);
CustomerDao customerDao = ApplicationContextProvider.getBean(CustomerDao.class);
center = customerDao.findCenterBySystemId(center.getGlobalCustNum());
verifyCustomerNotLoaded(center.getCustomerId(), center.getDisplayName());
}
use of org.mifos.customers.business.service.CustomerService in project head by mifos.
the class EditCustomerStatusActionStrutsTest method testUpdateStatusFailureWhenGroupHasActiveClientsWhenCenterIsInactiveWhileChangingStatusCancelToPartial.
@Test
public void testUpdateStatusFailureWhenGroupHasActiveClientsWhenCenterIsInactiveWhileChangingStatusCancelToPartial() throws Exception {
// setup
createInitialObjects(CustomerStatus.CENTER_ACTIVE, CustomerStatus.GROUP_CANCELLED, CustomerStatus.CLIENT_CLOSED);
CustomerService customerService = ApplicationContextProvider.getBean(CustomerService.class);
CustomerStatusFlag customerStatusFlag = CustomerStatusFlag.GROUP_CANCEL_BLACKLISTED;
CustomerNoteEntity customerNote = new CustomerNoteEntity("Made Inactive", new java.util.Date(), center.getPersonnel(), center);
customerService.updateCenterStatus((CenterBO) center, CustomerStatus.CENTER_INACTIVE, customerStatusFlag, customerNote);
invokeLoadAndPreviewSuccessfully(CustomerStatus.GROUP_PARTIAL, null);
setRequestPathInfo("/editCustomerStatusAction.do");
addRequestParameter("method", Methods.updateStatus.toString());
addRequestParameter("input", "group");
// exercise
actionPerform();
// verification
Assert.assertNotNull(request.getAttribute(Constants.CURRENTFLOWKEY));
verifyActionErrors(new String[] { GroupConstants.CENTER_INACTIVE });
cleanInitialObjects();
}
Aggregations