public void documentDeleteEmployee()

in component-test/src/main/java/org/apache/fineract/cn/office/EmployeeApiDocumentation.java [285:324]


  public void documentDeleteEmployee ( ) throws Exception {

    final Office office = OfficeFactory.createRandomOffice();
    office.setIdentifier("myOfficeTwo");
    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("699669966");
    orangeContact.setPreferenceLevel(new Integer(1));

    ContactDetail mtnContact = new ContactDetail();
    mtnContact.setType(ContactDetail.Type.PHONE.name());
    mtnContact.setGroup(ContactDetail.Group.BUSINESS.name());
    mtnContact.setValue("677667766");
    mtnContact.setPreferenceLevel(new Integer(1));

    List <ContactDetail> contacts = new ArrayList <>();
    contacts.add(orangeContact);
    contacts.add(mtnContact);

    final Employee employeeToDelete = EmployeeFactory.createRandomEmployee();
    employeeToDelete.setIdentifier("employeeNo2");
    employeeToDelete.setGivenName("Manu");
    employeeToDelete.setMiddleName("Ngoh");
    employeeToDelete.setSurname("Haba");
    employeeToDelete.setAssignedOffice(office.getIdentifier());
    employeeToDelete.setContactDetails(contacts);
    this.organizationManager.createEmployee(employeeToDelete);
    this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employeeToDelete.getIdentifier());

    Gson gson = new Gson();
    this.mockMvc.perform(delete("/employees/" + employeeToDelete.getIdentifier())
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .accept(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(status().isAccepted())
            .andDo(document("document-delete-employee", preprocessResponse(prettyPrint())));
  }