public void documentUpdateOffice()

in component-test/src/main/java/org/apache/fineract/cn/office/OfficeApiDocumentation.java [125:148]


  public void documentUpdateOffice ( ) throws Exception {

    final Office office = OfficeFactory.createRandomOffice();
    office.setIdentifier("originalOffice100");
    office.setName("Original Office");
    office.setDescription("My Original Office");
    this.organizationManager.createOffice(office);
    this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());

    office.setName("Updated Office");
    office.setDescription("My Updated Office");

    Gson gson = new Gson();
    this.mockMvc.perform(put("/offices/" + office.getIdentifier())
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .content(gson.toJson(office))
            .accept(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(status().isAccepted())
            .andDo(document("document-update-office", preprocessRequest(prettyPrint()),
                    requestFields(
                            fieldWithPath("identifier").description("office's identifier"),
                            fieldWithPath("name").description("office name"),
                            fieldWithPath("description").description("office description"))));
  }