Search in sources :

Example 1 with WireMockSnippet

use of org.springframework.cloud.contract.wiremock.restdocs.WireMockSnippet in project spring-cloud-netflix by spring-cloud.

the class AbstractDocumentationTests method spec.

private RequestSpecification spec(Object body, Filter... filters) {
    RequestSpecBuilder builder = new RequestSpecBuilder().addFilter(documentationConfiguration(this.restDocumentation).snippets().withAdditionalDefaults(new WireMockSnippet()));
    for (Filter filter : filters) {
        builder = builder.addFilter(filter);
    }
    RequestSpecification spec = builder.setPort(this.port).build();
    if (body != null) {
        spec.contentType("application/json").body(body, new EurekaObjectMapper());
    }
    return spec;
}
Also used : RestDocumentationFilter(org.springframework.restdocs.restassured3.RestDocumentationFilter) Filter(io.restassured.filter.Filter) RequestSpecification(io.restassured.specification.RequestSpecification) WireMockSnippet(org.springframework.cloud.contract.wiremock.restdocs.WireMockSnippet) RequestSpecBuilder(io.restassured.builder.RequestSpecBuilder)

Aggregations

RequestSpecBuilder (io.restassured.builder.RequestSpecBuilder)1 Filter (io.restassured.filter.Filter)1 RequestSpecification (io.restassured.specification.RequestSpecification)1 WireMockSnippet (org.springframework.cloud.contract.wiremock.restdocs.WireMockSnippet)1 RestDocumentationFilter (org.springframework.restdocs.restassured3.RestDocumentationFilter)1