public void documentGetOfficeAddress()

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


  public void documentGetOfficeAddress ( ) throws Exception {

    final Address address = AddressFactory.createRandomAddress();
    address.setStreet("The Street");
    address.setCity("The City");
    address.setRegion("The Region");
    address.setPostalCode("8085");
    address.setCountry("Gambia");

    final Office office = OfficeFactory.createRandomOffice();
    office.setIdentifier("theOffice");
    office.setName("The Office");
    office.setDescription("The Office");
    office.setAddress(address);
    this.organizationManager.createOffice(office);
    this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());

    this.mockMvc.perform(get("/offices/" + office.getIdentifier() + "/address")
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .accept(MediaType.ALL_VALUE))
            .andExpect(status().isOk())
            .andDo(document("document-get-office-address", preprocessResponse(prettyPrint()),
                    responseFields(
                            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"))));
  }