in component-test/src/main/java/org/apache/fineract/cn/office/EmployeeApiDocumentation.java [327:368]
public void documentSetContactDetail ( ) throws Exception {
final Office office = OfficeFactory.createRandomOffice();
office.setIdentifier("ourOffice");
this.organizationManager.createOffice(office);
this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());
ContactDetail orangeContact = new ContactDetail();
orangeContact.setType(ContactDetail.Type.MOBILE.name());
orangeContact.setGroup(ContactDetail.Group.PRIVATE.name());
orangeContact.setValue("699889988");
orangeContact.setPreferenceLevel(new Integer(1));
ContactDetail mtnContact = new ContactDetail();
mtnContact.setType(ContactDetail.Type.PHONE.name());
mtnContact.setGroup(ContactDetail.Group.BUSINESS.name());
mtnContact.setValue("677557700");
mtnContact.setPreferenceLevel(new Integer(1));
List <ContactDetail> contacts = new ArrayList <>();
contacts.add(orangeContact);
final Employee employee = EmployeeFactory.createRandomEmployee();
employee.setIdentifier("employeeNo20");
employee.setGivenName("Manu");
employee.setMiddleName("Ngoh");
employee.setSurname("Haba");
employee.setAssignedOffice(office.getIdentifier());
employee.setContactDetails(contacts);
this.organizationManager.createEmployee(employee);
this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
contacts.add(mtnContact);
Gson gson = new Gson();
this.mockMvc.perform(put("/employees/" + employee.getIdentifier() + "/contacts")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(gson.toJson(contacts))
.accept(MediaType.ALL_VALUE))
.andExpect(status().isAccepted())
.andDo(document("document-set-contact-detail", preprocessResponse(prettyPrint())));
}