Search in sources :

Example 46 with OfficeBO

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;
}
Also used : OfficeBO(org.mifos.customers.office.business.OfficeBO) OfficeDetailsDto(org.mifos.dto.domain.OfficeDetailsDto) Test(org.junit.Test)

Example 47 with OfficeBO

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;
}
Also used : OfficeBO(org.mifos.customers.office.business.OfficeBO) OfficeDetailsDto(org.mifos.dto.domain.OfficeDetailsDto) Test(org.junit.Test)

Example 48 with OfficeBO

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);
}
Also used : PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) OfficeBO(org.mifos.customers.office.business.OfficeBO) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) MifosUser(org.mifos.security.MifosUser) Test(org.junit.Test)

Example 49 with OfficeBO

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());
}
Also used : PersonActionForm(org.mifos.customers.personnel.struts.actionforms.PersonActionForm) OfficeBO(org.mifos.customers.office.business.OfficeBO) Test(org.junit.Test)

Example 50 with OfficeBO

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;
}
Also used : OfficeBO(org.mifos.customers.office.business.OfficeBO)

Aggregations

OfficeBO (org.mifos.customers.office.business.OfficeBO)115 Test (org.junit.Test)62 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)45 DateTime (org.joda.time.DateTime)33 ArrayList (java.util.ArrayList)31 MeetingBO (org.mifos.application.meeting.business.MeetingBO)28 UserContext (org.mifos.security.util.UserContext)25 OfficeBuilder (org.mifos.domain.builders.OfficeBuilder)23 CenterBO (org.mifos.customers.center.business.CenterBO)21 CenterBuilder (org.mifos.domain.builders.CenterBuilder)21 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)19 MifosUser (org.mifos.security.MifosUser)18 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)17 Address (org.mifos.framework.business.util.Address)17 GroupBO (org.mifos.customers.group.business.GroupBO)16 OfficePersistence (org.mifos.customers.office.persistence.OfficePersistence)16 MifosRuntimeException (org.mifos.core.MifosRuntimeException)14 ClientBO (org.mifos.customers.client.business.ClientBO)14 GroupBuilder (org.mifos.domain.builders.GroupBuilder)14 AddressDto (org.mifos.dto.domain.AddressDto)13