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();
}
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();
}
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();
}
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));
}
}
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();
}
Aggregations