Search in sources :

Example 86 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingHelperIntegrationTest method testGetMonthMessage.

@Test
public void testGetMonthMessage() throws Exception {
    String expected = "Recur on First Monday of every 5 month(s)";
    MeetingBO meeting = new MeetingBO(WeekDay.MONDAY, RankOfDay.FIRST, (short) 5, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
    IntegrationTestObjectMother.saveMeeting(meeting);
    meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
    Assert.assertEquals(expected, helper.getMessage(meeting, TestUtils.makeUser()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 87 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingHelperIntegrationTest method testGetDetailMonthFrequecny.

@Test
public void testGetDetailMonthFrequecny() throws Exception {
    String expected = "Recur every 5 month(s)";
    MeetingBO meeting = new MeetingBO((short) 7, (short) 5, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
    IntegrationTestObjectMother.saveMeeting(meeting);
    meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
    Assert.assertEquals(expected, helper.getDetailMessageWithFrequency(meeting, TestUtils.makeUser()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 88 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingHelperIntegrationTest method testGetMonthFrequecny.

@Test
public void testGetMonthFrequecny() throws Exception {
    String expected = "5 month(s)";
    MeetingBO meeting = new MeetingBO((short) 7, (short) 5, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
    IntegrationTestObjectMother.saveMeeting(meeting);
    meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
    Assert.assertEquals(expected, helper.getMessageWithFrequency(meeting, TestUtils.makeUser()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 89 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO in project head by mifos.

the class MeetingHelperIntegrationTest method testGetMonthlyOnDayMessage.

@Test
public void testGetMonthlyOnDayMessage() throws Exception {
    String expected = "Recur on day 7 of every 2 month(s)";
    MeetingBO meeting = new MeetingBO((short) 7, (short) 2, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
    IntegrationTestObjectMother.saveMeeting(meeting);
    meeting = IntegrationTestObjectMother.getMeeting(meeting.getMeetingId());
    Assert.assertEquals(expected, helper.getMessage(meeting, TestUtils.makeUser()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) Date(java.util.Date) Test(org.junit.Test)

Example 90 with MeetingBO

use of org.mifos.application.meeting.business.MeetingBO 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()));
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) ArrayList(java.util.ArrayList) CenterBO(org.mifos.customers.center.business.CenterBO) AddressDto(org.mifos.dto.domain.AddressDto) DateTime(org.joda.time.DateTime) MeetingDto(org.mifos.dto.domain.MeetingDto) CenterCreationDetail(org.mifos.dto.domain.CenterCreationDetail) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) OfficeBO(org.mifos.customers.office.business.OfficeBO) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) CreateAccountFeeDto(org.mifos.dto.domain.CreateAccountFeeDto) CustomerDetailsDto(org.mifos.dto.domain.CustomerDetailsDto) Test(org.junit.Test)

Aggregations

MeetingBO (org.mifos.application.meeting.business.MeetingBO)355 Test (org.junit.Test)176 Date (java.util.Date)91 ArrayList (java.util.ArrayList)84 MeetingBuilder (org.mifos.domain.builders.MeetingBuilder)74 DateTime (org.joda.time.DateTime)68 LocalDate (org.joda.time.LocalDate)56 Money (org.mifos.framework.util.helpers.Money)56 CenterBuilder (org.mifos.domain.builders.CenterBuilder)54 CenterBO (org.mifos.customers.center.business.CenterBO)46 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)44 AccountFeesEntity (org.mifos.accounts.business.AccountFeesEntity)42 Date (java.sql.Date)40 UserContext (org.mifos.security.util.UserContext)34 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)33 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)30 OfficeBO (org.mifos.customers.office.business.OfficeBO)27 CustomerBO (org.mifos.customers.business.CustomerBO)23 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)22 MifosUser (org.mifos.security.MifosUser)20