public final class UriModifyingOperationPreprocessor extends Object implements org.springframework.restdocs.operation.preprocess.OperationPreprocessor
OperationPreprocessor that modifies URIs in the request and in the response
by changing one or more of their host, scheme, and port. URIs in the following
locations are modified:
Request URI
Request headers
Request content
Request part headers
Request part content
Response headers
Response content
| Constructor and Description |
|---|
UriModifyingOperationPreprocessor() |
| Modifier and Type | Method and Description |
|---|---|
UriModifyingOperationPreprocessor |
host(String host)
Modifies the URI to use the given
host. |
UriModifyingOperationPreprocessor |
port(int port)
Modifies the URI to use the given
port. |
org.springframework.restdocs.operation.OperationRequest |
preprocess(org.springframework.restdocs.operation.OperationRequest request) |
org.springframework.restdocs.operation.OperationResponse |
preprocess(org.springframework.restdocs.operation.OperationResponse response) |
UriModifyingOperationPreprocessor |
removePort()
Removes the port from the URI.
|
UriModifyingOperationPreprocessor |
scheme(String scheme)
Modifies the URI to use the given
scheme. |
public UriModifyingOperationPreprocessor scheme(String scheme)
scheme. null, the default, will
leave the scheme unchanged.scheme - the schemethispublic UriModifyingOperationPreprocessor host(String host)
host. null, the default, will
leave the host unchanged.host - the hostthispublic UriModifyingOperationPreprocessor port(int port)
port.port - the portthispublic UriModifyingOperationPreprocessor removePort()
thispublic org.springframework.restdocs.operation.OperationRequest preprocess(org.springframework.restdocs.operation.OperationRequest request)
preprocess in interface org.springframework.restdocs.operation.preprocess.OperationPreprocessorpublic org.springframework.restdocs.operation.OperationResponse preprocess(org.springframework.restdocs.operation.OperationResponse response)
preprocess in interface org.springframework.restdocs.operation.preprocess.OperationPreprocessor