Class RequestHeadersSnippet
java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.headers.AbstractHeadersSnippet
org.springframework.restdocs.headers.RequestHeadersSnippet
- All Implemented Interfaces:
Snippet
A
Snippet
that documents the headers in a request.- Author:
- Andreas Evers, Andy Wilkinson
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
RequestHeadersSnippet
(List<HeaderDescriptor> descriptors) Creates a newRequestHeadersSnippet
that will document the headers in the request using the givendescriptors
.protected
RequestHeadersSnippet
(List<HeaderDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestHeadersSnippet
that will document the headers in the request using the givendescriptors
. -
Method Summary
Modifier and TypeMethodDescriptionfinal RequestHeadersSnippet
and
(List<HeaderDescriptor> additionalDescriptors) Returns a newRequestHeadersSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestHeadersSnippet
and
(HeaderDescriptor... additionalDescriptors) Returns a newRequestHeadersSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.extractActualHeaders
(Operation operation) Extracts the names of the headers from the request or response of the givenoperation
.Methods inherited from class org.springframework.restdocs.headers.AbstractHeadersSnippet
createModel, createModelForDescriptor, findMissingHeaders, getHeaderDescriptors
Methods inherited from class org.springframework.restdocs.snippet.TemplatedSnippet
document, getAttributes, getSnippetName
-
Constructor Details
-
RequestHeadersSnippet
Creates a newRequestHeadersSnippet
that will document the headers in the request using the givendescriptors
.- Parameters:
descriptors
- the descriptors
-
RequestHeadersSnippet
Creates a newRequestHeadersSnippet
that will document the headers in the request using the givendescriptors
. The givenattributes
will be included in the model during template rendering.- Parameters:
descriptors
- the descriptorsattributes
- the additional attributes
-
-
Method Details
-
extractActualHeaders
Description copied from class:AbstractHeadersSnippet
Extracts the names of the headers from the request or response of the givenoperation
.- Specified by:
extractActualHeaders
in classAbstractHeadersSnippet
- Parameters:
operation
- the operation- Returns:
- the header names
-
and
Returns a newRequestHeadersSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.- Parameters:
additionalDescriptors
- the additional descriptors- Returns:
- the new snippet
-
and
Returns a newRequestHeadersSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.- Parameters:
additionalDescriptors
- the additional descriptors- Returns:
- the new snippet
-