public void explicitExtractor() throws Exception { RestAssured.given(this.spec) .accept("application/json") // tag::explicit-extractor[] .filter(document("index", links(halLinks(), // <1> linkWithRel("alpha").description("Link to the alpha resource"), linkWithRel("bravo").description("Link to the bravo resource")))) // end::explicit-extractor[] .get("/").then().assertThat().statusCode(is(200)); }
public void explicitExtractor() throws Exception { this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) //tag::explicit-extractor[] .andDo(document("index", links(halLinks(), // <1> linkWithRel("alpha").description("Link to the alpha resource"), linkWithRel("bravo").description("Link to the bravo resource")))); // end::explicit-extractor[] }
public void explicitExtractor() throws Exception { this.webTestClient.get().uri("/").accept(MediaType.APPLICATION_JSON).exchange() .expectStatus().isOk().expectBody() // tag::explicit-extractor[] .consumeWith(document("index",links(halLinks(), // <1> linkWithRel("alpha").description("Link to the alpha resource"), linkWithRel("bravo").description("Link to the bravo resource")))); // end::explicit-extractor[] }
links(halLinks(), linkWithRel("curies").description("CUR-ies"), linkWithRel("self").description("This ad"),
links(halLinks(), linkWithRel("curies").description("CUR-ies"), linkWithRel("self").description("This ad"),