public void documentFetchApplications()

in component-test/src/main/java/org/apache/fineract/cn/provisioner/application/ApplicationsApiDocumentation.java [127:159]


  public void documentFetchApplications ( ) throws Exception {
    Application firstApplication = new Application();
    firstApplication.setName("first-comp-test-app");
    firstApplication.setDescription("First Component Test Application");
    firstApplication.setHomepage("http://www.first-component.test");
    firstApplication.setVendor("First Component Test");

    Application secondApplication = new Application();
    secondApplication.setName("second-comp-test-app");
    secondApplication.setDescription("Second Component Test Application");
    secondApplication.setHomepage("http://www.second-component.test");
    secondApplication.setVendor("Second Component Test");

    provisioner.createApplication(firstApplication);
    provisioner.createApplication(secondApplication);

    this.mockMvc.perform(get("/applications")
            .accept(MediaType.APPLICATION_JSON_VALUE)
            .contentType(MediaType.APPLICATION_JSON_VALUE))
            .andExpect(status().isOk())
            .andDo(document("document-fetch-applications", preprocessResponse(prettyPrint()),
                    responseFields(
                            fieldWithPath("[].name").description("First Application's name"),
                            fieldWithPath("[].description").description("First Application's description"),
                            fieldWithPath("[].vendor").description("First Application's vendor"),
                            fieldWithPath("[].homepage").description("First Application's homepage"),
                            fieldWithPath("[1].name").description("Second Application's name"),
                            fieldWithPath("[1].description").description("Second Application's description"),
                            fieldWithPath("[1].vendor").description("Second Application's vendor"),
                            fieldWithPath("[1].homepage").description("Second Application's homepage")
                    )
            ));
  }