use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class CenterCreationTest method createsCenterWithCustomerAccount.
@Test
public void createsCenterWithCustomerAccount() throws Exception {
// setup
OfficeBO withOffice = new OfficeBO(new Short("1"), "testOffice", new Integer("1"), new Short("1"));
CenterBO center = new CenterBuilder().withLoanOfficer(anyLoanOfficer()).with(withOffice).build();
center.setCustomerDao(customerDao);
List<AccountFeesEntity> accountFees = new ArrayList<AccountFeesEntity>();
// stub
CalendarEvent upcomingCalendarEvents = new CalendarEventBuilder().build();
when(holidayDao.findCalendarEventsForThisYearAndNext((short) 1)).thenReturn(upcomingCalendarEvents);
when(customerAccountFactory.create(center, accountFees, meeting, upcomingCalendarEvents)).thenReturn(customerAccount);
when(customerAccount.getType()).thenReturn(AccountTypes.CUSTOMER_ACCOUNT);
// exercise test
customerService.createCenter(center, meeting, accountFees);
// verification
assertThat(center.getCustomerAccount(), is(customerAccount));
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class ConfigurationIntegrationTest method testAreaOfficeConfiguration.
@Test
public void testAreaOfficeConfiguration() throws Exception {
OfficeBO areaOffice = new OfficePersistence().getOffice(TestObjectFactory.SAMPLE_AREA_OFFICE);
OfficeConfig officeConfig = configuration.getOfficeConfig(areaOffice.getOfficeId());
assertForAccountConfig(officeConfig.getAccountConfig());
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class ConfigurationIntegrationTest method testBranchOfficeConfiguration.
@Test
public void testBranchOfficeConfiguration() throws Exception {
OfficeBO branchOffice = new OfficePersistence().getOffice(TestObjectFactory.SAMPLE_BRANCH_OFFICE);
OfficeConfig officeConfig = configuration.getOfficeConfig(branchOffice.getOfficeId());
assertForAccountConfig(officeConfig.getAccountConfig());
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class PersonActionStrutsTest method testLoad.
@Test
public void testLoad() throws Exception {
addActionAndMethod(Methods.load.toString());
addRequestParameter("officeId", "1");
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
OfficeBO office = (OfficeBO) SessionUtils.getAttribute(PersonnelConstants.OFFICE, request);
Assert.assertNotNull(office);
Assert.assertEquals(1, office.getOfficeId().intValue());
verifyMasterData();
PersonActionForm personActionForm = (PersonActionForm) request.getSession().getAttribute("personActionForm");
Assert.assertNotNull(personActionForm);
// Assert.assertEquals(1, personActionForm.getCustomFields().size());
verifyForward(ActionForwards.load_success.toString());
PersonActionForm actionForm = (PersonActionForm) request.getSession().getAttribute("personActionForm");
Date currentDate = DateUtils.getCurrentDateWithoutTimeStamp();
Assert.assertEquals(currentDate, DateUtils.getDateAsSentFromBrowser(actionForm.getDateOfJoiningMFI()));
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class CustSearchActionStrutsTest method testLoadMainSearchLoBoUser.
@Test
public void testLoadMainSearchLoBoUser() throws Exception {
OfficeBO officeBO = TestObjectFactory.getOffice(TestObjectFactory.SAMPLE_BRANCH_OFFICE);
userContext.setId(Short.valueOf("3"));
createGroupWithCenter();
addActionAndMethod(Methods.loadMainSearch.toString());
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(CustomerSearchConstants.LOADFORWARDLOANOFFICER_SUCCESS);
List<CustomerBO> customerList = (List<CustomerBO>) SessionUtils.getAttribute(CustomerSearchConstants.CUSTOMERLIST, request);
Assert.assertNotNull(customerList);
Assert.assertEquals(0, customerList.size());
Assert.assertEquals(officeBO.getOfficeName(), SessionUtils.getAttribute(CustomerSearchConstants.OFFICE, request));
}
Aggregations