Search in sources :

Example 21 with PersonnelBuilder

use of org.mifos.domain.builders.PersonnelBuilder in project head by mifos.

the class GroupValidationTest method givenGroupWithNullMeetingShouldThrowBusinessRuleException.

@Test(expected = BusinessRuleException.class)
public void givenGroupWithNullMeetingShouldThrowBusinessRuleException() {
    OfficeBO office = new OfficeBuilder().build();
    PersonnelBO loanOfficer = new PersonnelBuilder().asLoanOfficer().build();
    group = new GroupBuilder().withName("group-On-branch").withOffice(office).withLoanOfficer(loanOfficer).withMeeting(null).buildAsTopOfHierarchy();
}
Also used : OfficeBuilder(org.mifos.domain.builders.OfficeBuilder) PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) OfficeBO(org.mifos.customers.office.business.OfficeBO) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) GroupBuilder(org.mifos.domain.builders.GroupBuilder) Test(org.junit.Test)

Example 22 with PersonnelBuilder

use of org.mifos.domain.builders.PersonnelBuilder in project head by mifos.

the class GroupValidationTest method givenGroupWithNullParentShouldThrowIllegalArgumentException.

@Test(expected = IllegalArgumentException.class)
public void givenGroupWithNullParentShouldThrowIllegalArgumentException() {
    OfficeBO office = new OfficeBuilder().build();
    PersonnelBO loanOfficer = new PersonnelBuilder().asLoanOfficer().build();
    MeetingBO meeting = new MeetingBuilder().customerMeeting().build();
    group = new GroupBuilder().withName("group-On-center").withOffice(office).withLoanOfficer(loanOfficer).withMeeting(meeting).withParentCustomer(null).build();
}
Also used : OfficeBuilder(org.mifos.domain.builders.OfficeBuilder) PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) OfficeBO(org.mifos.customers.office.business.OfficeBO) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) MeetingBO(org.mifos.application.meeting.business.MeetingBO) GroupBuilder(org.mifos.domain.builders.GroupBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) Test(org.junit.Test)

Example 23 with PersonnelBuilder

use of org.mifos.domain.builders.PersonnelBuilder in project head by mifos.

the class GroupValidationTest method setupDependencies.

@Before
public void setupDependencies() {
    OfficeBO office = new OfficeBuilder().build();
    PersonnelBO loanOfficer = new PersonnelBuilder().asLoanOfficer().build();
    MeetingBO meeting = new MeetingBuilder().customerMeeting().build();
    center = new CenterBuilder().with(office).withLoanOfficer(loanOfficer).with(meeting).build();
}
Also used : OfficeBuilder(org.mifos.domain.builders.OfficeBuilder) PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) OfficeBO(org.mifos.customers.office.business.OfficeBO) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) MeetingBO(org.mifos.application.meeting.business.MeetingBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) Before(org.junit.Before)

Example 24 with PersonnelBuilder

use of org.mifos.domain.builders.PersonnelBuilder in project head by mifos.

the class GroupValidationTest method givenGroupIsTrainedButTrainedDateIsNotSetThenShouldThrowCustomerException.

@Test
public void givenGroupIsTrainedButTrainedDateIsNotSetThenShouldThrowCustomerException() {
    PersonnelBO formedBy = new PersonnelBuilder().build();
    group = new GroupBuilder().withName("group-On-center").withParentCustomer(center).formedBy(formedBy).isTrained().trainedOn(null).build();
    try {
        group.validate();
        fail("should throw customer exception as trained date must be provided if in trained state when creating group.");
    } catch (CustomerException e) {
        assertThat(e.getKey(), is(CustomerConstants.INVALID_TRAINED_OR_TRAINEDDATE));
    }
}
Also used : PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) CustomerException(org.mifos.customers.exceptions.CustomerException) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) GroupBuilder(org.mifos.domain.builders.GroupBuilder) Test(org.junit.Test)

Example 25 with PersonnelBuilder

use of org.mifos.domain.builders.PersonnelBuilder in project head by mifos.

the class CenterValidationTest method setupDependencies.

@Before
public void setupDependencies() {
    OfficeBO office = new OfficeBuilder().build();
    PersonnelBO loanOfficer = new PersonnelBuilder().asLoanOfficer().build();
    MeetingBO meeting = new MeetingBuilder().customerMeeting().build();
    center = new CenterBuilder().with(office).withLoanOfficer(loanOfficer).with(meeting).build();
}
Also used : OfficeBuilder(org.mifos.domain.builders.OfficeBuilder) PersonnelBuilder(org.mifos.domain.builders.PersonnelBuilder) OfficeBO(org.mifos.customers.office.business.OfficeBO) PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) MeetingBO(org.mifos.application.meeting.business.MeetingBO) CenterBuilder(org.mifos.domain.builders.CenterBuilder) MeetingBuilder(org.mifos.domain.builders.MeetingBuilder) Before(org.junit.Before)

Aggregations

PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)31 PersonnelBuilder (org.mifos.domain.builders.PersonnelBuilder)31 Test (org.junit.Test)27 SavingsAccountBuilder (org.mifos.domain.builders.SavingsAccountBuilder)18 Money (org.mifos.framework.util.helpers.Money)12 DateTime (org.joda.time.DateTime)10 InterestCalculationPeriodResult (org.mifos.accounts.savings.interest.InterestCalculationPeriodResult)8 InterestCalculationPeriodResultBuilder (org.mifos.accounts.savings.interest.InterestCalculationPeriodResultBuilder)8 InterestPostingPeriodResult (org.mifos.accounts.savings.interest.InterestPostingPeriodResult)8 InterestPostingPeriodResultBuilder (org.mifos.accounts.savings.interest.InterestPostingPeriodResultBuilder)8 InterestScheduledEvent (org.mifos.accounts.savings.interest.schedule.InterestScheduledEvent)8 MonthlyOnLastDayOfMonthInterestScheduledEvent (org.mifos.accounts.savings.interest.schedule.internal.MonthlyOnLastDayOfMonthInterestScheduledEvent)8 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)7 OfficeBO (org.mifos.customers.office.business.OfficeBO)7 OfficeBuilder (org.mifos.domain.builders.OfficeBuilder)7 LocalDate (org.joda.time.LocalDate)6 GroupBuilder (org.mifos.domain.builders.GroupBuilder)6 ArrayList (java.util.ArrayList)5 AccountNotesEntity (org.mifos.accounts.business.AccountNotesEntity)5 AccountNotesEntityBuilder (org.mifos.accounts.business.AccountNotesEntityBuilder)5