[英]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.