List of usage examples for org.springframework.restdocs.payload PayloadDocumentation subsectionWithPath
public static SubsectionDescriptor subsectionWithPath(String path)
From source file:com.netflix.genie.web.controllers.JobRestControllerIntegrationTest.java
private void checkJobApplications(final int documentationId, final String id) { final RestDocumentationFilter getResultFilter = RestAssuredRestDocumentation.document( "{class-name}/" + documentationId + "/getJobApplications/", Snippets.ID_PATH_PARAM, // Path parameters Snippets.HAL_CONTENT_TYPE_HEADER, // Response Headers PayloadDocumentation.responseFields(PayloadDocumentation.subsectionWithPath("[]") .description("The applications for the job").attributes(Snippets.EMPTY_CONSTRAINTS)) // Response fields );/* w ww. jav a 2s. co m*/ RestAssured.given(this.getRequestSpecification()).filter(getResultFilter).when().port(this.port) .get(JOBS_API + "/{id}/applications", id).then().statusCode(Matchers.is(HttpStatus.OK.value())) .contentType(Matchers.is(MediaTypes.HAL_JSON_UTF8_VALUE)).body("$", Matchers.hasSize(2)) .body("[0].id", Matchers.is(APP1_ID)).body("[1].id", Matchers.is(APP2_ID)); }