Rename doesExist() to exists() for header assertions

This commit is contained in:
Sam Brannen
2018-01-26 17:24:54 +01:00
parent 0e734d83d5
commit b612f53e27
4 changed files with 16 additions and 16 deletions

View File

@@ -77,7 +77,7 @@ public class HeaderAssertions {
* Expect that the header with the given name is present.
* @since 5.0.3
*/
public WebTestClient.ResponseSpec doesExist(String name) {
public WebTestClient.ResponseSpec exists(String name) {
if (!getHeaders().containsKey(name)) {
String message = getMessage(name) + " does not exist";
this.exchangeResult.assertWithDiagnostics(() -> fail(message));

View File

@@ -91,10 +91,10 @@ public class HeaderResultMatchers {
}
/**
* Assert that the named response header does exist.
* Assert that the named response header exists.
* @since 5.0.3
*/
public ResultMatcher doesExist(final String name) {
public ResultMatcher exists(final String name) {
return result -> assertTrue("Response should contain header '" + name + "'",
result.getResponse().containsHeader(name));
}