我有如下响应 json
{
"orderId": "16057421778",
"displayOrderId": "160574217786",
"numberOfItems": 2,
"items": [
{
"orderItemId": "3291379",
"item": {
"itemId": "10127763",
"definingAttrs": null,
"itemAttrs": {
"ColorLevelURLIndicator": "true"
},
"descriptiveAttrs": null,
"inventory": {
"inventoryStatus": "Available",
"lastUpdateDate": "2018-07-20T22:00:32"
},
"priceFlag": "2",
"kicId": "KIC_131-7541-1347-476"
},
"quantity": 1,
"bogoMessage": ""
},
{
"orderItemId": "3292201",
"shortSku": "628711393",
"item": {
"itemId": "10127763",
"itemAttrs": {
"ColorLevelURLIndicator": "true"
},
"descriptiveAttrs": null,
"inventory": {
"inventoryStatus": "Available",
"lastUpdateDate": "2018-07-20T22:00:32"
},
"priceFlag": "2",
"imageId": "anf_175595_02",
"kicId": "KIC_131-7541-1347-476"
},
"quantity": 1,
"bogoMessage": ""
}
],
"payment": null
}
我现在有一个JsonArray
类似的东西["orderId","displayOrderId"]
,我想验证这两个键没有空值或空值作为响应。
我知道我可以使用数组值迭代响应,但是如果响应非常大并且我有n
许多值要断言,那将浪费大量时间。
我正在使用RestAssured
和JsonPath
验证