Added httpOnly cookie ResultMatcher

This commit is contained in:
nyo
2017-04-04 19:48:58 +02:00
parent 547c4f69a4
commit e80de55929
2 changed files with 16 additions and 2 deletions

View File

@@ -198,4 +198,14 @@ public class CookieResultMatchers {
};
}
/**
* Assert whether the cookie must be httpOnly.
*/
public ResultMatcher httpOnly(final String name, final boolean httpOnly) {
return result -> {
Cookie cookie = result.getResponse().getCookie(name);
assertEquals("Response cookie httpOnly", httpOnly, cookie.isHttpOnly());
};
}
}