in component-test/src/main/java/org/apache/fineract/cn/office/EmployeeApiDocumentation.java [423:465]
public void documentDeleteContactDetails ( ) throws Exception {
final Office office = OfficeFactory.createRandomOffice();
office.setIdentifier("Office24");
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("699699966");
orangeContact.setPreferenceLevel(new Integer(1));
ContactDetail mtnContact = new ContactDetail();
mtnContact.setType(ContactDetail.Type.PHONE.name());
mtnContact.setGroup(ContactDetail.Group.BUSINESS.name());
mtnContact.setValue("677688766");
mtnContact.setPreferenceLevel(new Integer(1));
List <ContactDetail> contacts = new ArrayList <>();
contacts.add(orangeContact);
final Employee employeeToDelete = EmployeeFactory.createRandomEmployee();
employeeToDelete.setIdentifier("employeeNo4");
employeeToDelete.setGivenName("Maimuna");
employeeToDelete.setMiddleName("Obale");
employeeToDelete.setSurname("Sehu");
employeeToDelete.setAssignedOffice(office.getIdentifier());
employeeToDelete.setContactDetails(contacts);
this.organizationManager.createEmployee(employeeToDelete);
this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employeeToDelete.getIdentifier());
contacts.add(mtnContact);
this.organizationManager.setContactDetails(employeeToDelete.getIdentifier(), contacts);
this.eventRecorder.wait(EventConstants.SELECTOR_PUT_CONTACT_DETAIL, employeeToDelete.getIdentifier());
Gson gson = new Gson();
this.mockMvc.perform(delete("/employees/" + employeeToDelete.getIdentifier() + "/contacts")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.accept(MediaType.ALL_VALUE))
.andExpect(status().isAccepted())
.andDo(document("document-delete-contact-details", preprocessResponse(prettyPrint())));
}