Add doesExist assertion method to HeaderResultMatchers
This commit is contained in:
committed by
Rossen Stoyanchev
parent
cf812ba831
commit
81ca1f7c2b
@@ -99,6 +99,15 @@ public class HeaderResultMatchers {
|
||||
!result.getResponse().containsHeader(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the named response header does exist.
|
||||
* @since 4.3
|
||||
*/
|
||||
public ResultMatcher doesExist(final String name) {
|
||||
return result -> assertTrue("Response should contain header '" + name + "'",
|
||||
result.getResponse().containsHeader(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert the primary value of the named response header as a {@code long}.
|
||||
* <p>The {@link ResultMatcher} returned by this method throws an
|
||||
|
||||
Reference in New Issue
Block a user