public void documentSetOfficeAddress()

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


  public void documentSetOfficeAddress ( ) throws Exception {

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

    final Address newAddress = AddressFactory.createRandomAddress();
    newAddress.setStreet("New Street");
    newAddress.setCity("New City");
    newAddress.setRegion("New region");
    newAddress.setPostalCode("8050");
    newAddress.setCountry("Cameroon");

    Gson gson = new Gson();
    this.mockMvc.perform(put("/offices/" + office.getIdentifier() + "/address")
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .content(gson.toJson(newAddress))
            .accept(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(status().isAccepted())
            .andDo(document("document-set-office-address", preprocessRequest(prettyPrint()),
                    requestFields(
                            fieldWithPath("street").description("Street"),
                            fieldWithPath("city").description("City"),
                            fieldWithPath("region").description("Region"),
                            fieldWithPath("postalCode").description("Postal Code"),
                            fieldWithPath("countryCode").description("Country Code"),
                            fieldWithPath("country").description("Country"))));
  }