Added httpOnly cookie ResultMatcher
This commit is contained in:
@@ -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());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user