[英]How to check whether one node in API response has same value under all object using postman tests?
假设API请求提取用户ID,电子邮件地址及其指定的角色。 以下示例API请求:
GET: /v1/users HTTP/1.1
Content-Type: application/json
Authorization: bearer {access_token}
对于上述请求,以下是响应:
{
"content": [
{
"id": 1,
"email": "random@random.com",
"full_name": "AlbusDumbledore",
"role": "OWNER"
},
{
"id": 40,
"email": "random1@random1.com",
"role": "OWNER"
}
],
"last": false,
"total_elements": 2,
"total_pages": 1,
"sort": null,
"first": true,
"number_of_elements": 2,
"size": 20,
"number": 0
}
现在,postman中的测试将确保角色节点下的所有返回值等于OWNER?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.