Class HeaderResultMatchers
java.lang.Object
org.springframework.test.web.servlet.result.HeaderResultMatchers
Factory for response header assertions.
 
An instance of this class is available via
 MockMvcResultMatchers.header().
- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Sam Brannen, Brian Clozel
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAssert the primary value of the named response header parsed into a date using the preferred date format described in RFC 7231.doesNotExist(String name) Assert that the named response header does not exist.Assert that the named response header exists.Assert the primary value of the named response header as along.Assert the primary value of the response header as a String value.Assert the primary value of the response header with the given Hamcrest StringMatcher.stringValues(String name, String... values) Assert the values of the response header as String values.stringValues(String name, Matcher<? super Iterable<String>> matcher) Assert the values of the response header with the given Hamcrest IterableMatcher.
- 
Constructor Details- 
HeaderResultMatchersprotected HeaderResultMatchers()Protected constructor. SeeMockMvcResultMatchers.header().
 
- 
- 
Method Details- 
stringAssert the primary value of the response header with the given Hamcrest StringMatcher.
- 
stringValuesAssert the values of the response header with the given Hamcrest IterableMatcher.- Since:
- 4.3
 
- 
stringAssert the primary value of the response header as a String value.
- 
stringValuesAssert the values of the response header as String values.- Since:
- 4.3
 
- 
existsAssert that the named response header exists.- Since:
- 5.0.3
 
- 
doesNotExistAssert that the named response header does not exist.- Since:
- 4.0
 
- 
longValueAssert the primary value of the named response header as along.The ResultMatcherreturned by this method throws anAssertionErrorif the response does not contain the specified header, or if the suppliedvaluedoes not match the primary value.
- 
dateValueAssert the primary value of the named response header parsed into a date using the preferred date format described in RFC 7231.The ResultMatcherreturned by this method throws anAssertionErrorif the response does not contain the specified header, or if the suppliedvaluedoes not match the primary value.- Since:
- 4.2
- See Also:
 
 
-