Class ResponseHeadersSnippet
java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.headers.AbstractHeadersSnippet
org.springframework.restdocs.headers.ResponseHeadersSnippet
- All Implemented Interfaces:
 Snippet
A 
Snippet that documents the headers in a response.- Author:
 - Andreas Evers, Andy Wilkinson
 - See Also:
 
- 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResponseHeadersSnippet(List<HeaderDescriptor> descriptors) Creates a newResponseHeadersSnippetthat will document the headers in the response using the givendescriptors.protectedResponseHeadersSnippet(List<HeaderDescriptor> descriptors, @Nullable Map<String, Object> attributes) Creates a newResponseHeadersSnippetthat will document the headers in the response using the givendescriptors. - 
Method Summary
Modifier and TypeMethodDescriptionfinal ResponseHeadersSnippetand(List<HeaderDescriptor> additionalDescriptors) Returns a newResponseHeadersSnippetconfigured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors.final ResponseHeadersSnippetand(HeaderDescriptor... additionalDescriptors) Returns a newResponseHeadersSnippetconfigured 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 AbstractHeadersSnippet
createModel, createModelForDescriptor, findMissingHeaders, getHeaderDescriptorsMethods inherited from class TemplatedSnippet
document, getAttributes, getSnippetName 
- 
Constructor Details
- 
ResponseHeadersSnippet
Creates a newResponseHeadersSnippetthat will document the headers in the response using the givendescriptors.- Parameters:
 descriptors- the descriptors
 - 
ResponseHeadersSnippet
protected ResponseHeadersSnippet(List<HeaderDescriptor> descriptors, @Nullable Map<String, Object> attributes) Creates a newResponseHeadersSnippetthat will document the headers in the response using the givendescriptors. The givenattributeswill be included in the model during template rendering.- Parameters:
 descriptors- the descriptorsattributes- the additional attributes
 
 - 
 - 
Method Details
- 
extractActualHeaders
Description copied from class:AbstractHeadersSnippetExtracts the names of the headers from the request or response of the givenoperation.- Specified by:
 extractActualHeadersin classAbstractHeadersSnippet- Parameters:
 operation- the operation- Returns:
 - the header names
 
 - 
and
Returns a newResponseHeadersSnippetconfigured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors.- Parameters:
 additionalDescriptors- the additional descriptors- Returns:
 - the new snippet
 
 - 
and
Returns a newResponseHeadersSnippetconfigured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors.- Parameters:
 additionalDescriptors- the additional descriptors- Returns:
 - the new snippet
 
 
 -