Example usage for org.springframework.restdocs.operation.preprocess Preprocessors modifyUris

List of usage examples for org.springframework.restdocs.operation.preprocess Preprocessors modifyUris

Introduction

In this page you can find the example usage for org.springframework.restdocs.operation.preprocess Preprocessors modifyUris.

Prototype

public static UriModifyingOperationPreprocessor modifyUris() 

Source Link

Document

Returns a UriModifyingOperationPreprocessor that will modify URIs in the request or response by changing one or more of their host, scheme, and port.

Usage

From source file:com.netflix.genie.web.controllers.RestControllerIntegrationTestBase.java

/**
 * Clean out the db before every test.//from w  w w. j av a  2s.c o m
 *
 * @throws Exception on error
 */
public void setup() throws Exception {
    this.jobRepository.deleteAll();
    this.clusterRepository.deleteAll();
    this.commandRepository.deleteAll();
    this.applicationRepository.deleteAll();
    this.fileRepository.deleteAll();
    this.tagRepository.deleteAll();

    this.requestSpecification = new RequestSpecBuilder()
            .addFilter(RestAssuredRestDocumentation.documentationConfiguration(this.restDocumentation)
                    .snippets().withAdditionalDefaults(new WireMockSnippet()).and().operationPreprocessors()
                    .withRequestDefaults(Preprocessors.prettyPrint(),
                            Preprocessors.modifyUris().scheme(URI_SCHEME).host(URI_HOST).removePort())
                    .withResponseDefaults(Preprocessors.prettyPrint(),
                            Preprocessors.modifyUris().host(URI_HOST).scheme(URI_SCHEME).removePort()))
            .build();
}