Rename doesExist() to exists() for header assertions
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user