空手道模拟
我想创建一个与空手道的模拟,以对进行
if-none-Match
标题。我试图做显示的事情在这里
Scenario: pathMatches('/path') && methodIs('get') && karate.get('requestHeaders.If-None-Match[0]') == '1'
* def responseStatus = 304
* def responseHeaders = { 'ETag': '1' }
。它忽略了空手道。get
零件,使用后定义的方案(没有标头的相同的方案):
Scenario: pathMatches('/path') && methodIs('get')
...
我在这里做错了什么?
I want to create a mock with karate to act on If-None-Match
header. I tried to do what is shown here
Scenario: pathMatches('/path') && methodIs('get') && karate.get('requestHeaders.If-None-Match[0]') == '1'
* def responseStatus = 304
* def responseHeaders = { 'ETag': '1' }
It is not working. It is ignoring the karate.get
part, and using the scenario defined after (the same one without headers):
Scenario: pathMatches('/path') && methodIs('get')
...
What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这样做。我能够获得响应匹配。
Do it like this. I was able to get a response match.