本文介绍了如何确保不存在 cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在REST Assured 中确保不存在 cookie 的好方法是什么?我检查了有很多 .cookie
和 .cookies
方法,但没有一个支持检查 cookie 的缺失.
What would be a good way in REST Assured to ensure that a cookie is absent? I checked that there are many .cookie
and .cookies
methods, but none support checking the absence of a cookie.
推荐答案
我没有发现任何 OOTB,但这有效:
I'm not finding anything OOTB, but this works:
assertThat(response.getCookie("foo"), is(nullValue()));
这篇关于如何确保不存在 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!