use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class OfficePersistenceIntegrationTest method testGetChildOffices.
@Test
public void testGetChildOffices() throws Exception {
OfficeBO headOffice = TestObjectFactory.getOffice(TestObjectFactory.HEAD_OFFICE);
List<OfficeDetailsDto> officeList = getOfficePersistence().getChildOffices(headOffice.getSearchId());
Assert.assertEquals(3, officeList.size());
officeList = null;
headOffice = null;
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class OfficeBusinessServiceIntegrationTest method testGetChildOffices.
@Test
public void testGetChildOffices() throws ServiceException {
OfficeBO headOffice = TestObjectFactory.getOffice(TestObjectFactory.HEAD_OFFICE);
List<OfficeDetailsDto> officeList = officeBusinessService.getChildOffices(headOffice.getSearchId());
Assert.assertEquals(3, officeList.size());
officeList = null;
headOffice = null;
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class PersonnelDaoHibernateIntegrationTest method shouldFindAppUserWithNoRolesByUsername.
@Test
public void shouldFindAppUserWithNoRolesByUsername() {
OfficeBO office = IntegrationTestObjectMother.sampleBranchOffice();
PersonnelBO userWithNoRoles = new PersonnelBuilder().withUsername("noRoles").asLoanOfficer().with(office).build();
IntegrationTestObjectMother.createPersonnel(userWithNoRoles);
// exercise test
MifosUser user = personnelDao.findAuthenticatedUserByUsername("noRoles");
// verification
assertNotNull(user);
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class PersonActionStrutsTest method testLoadWithBranchOffice.
@SuppressWarnings("unchecked")
@Test
public void testLoadWithBranchOffice() throws Exception {
addActionAndMethod(Methods.load.toString());
addRequestParameter("officeId", "3");
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
OfficeBO office = (OfficeBO) SessionUtils.getAttribute(PersonnelConstants.OFFICE, request);
Assert.assertNotNull(office);
Assert.assertEquals(3, office.getOfficeId().intValue());
verifyMasterData();
PersonActionForm personActionForm = (PersonActionForm) request.getSession().getAttribute("personActionForm");
Assert.assertNotNull(personActionForm);
// Assert.assertEquals(1, personActionForm.getCustomFields().size());
Assert.assertNotNull(SessionUtils.getAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, request));
Assert.assertEquals(2, ((List) SessionUtils.getAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, request)).size());
verifyForward(ActionForwards.load_success.toString());
}
use of org.mifos.customers.office.business.OfficeBO in project head by mifos.
the class PersonnelFixture method createPersonnel.
public static PersonnelBO createPersonnel(String officeSearchId) {
OfficeBO office = OfficecFixture.createOffice(officeSearchId);
PersonnelBO personnel = new PersonnelBO();
personnel.setOffice(office);
return personnel;
}
Aggregations