如何使用放心的 .body() 方法在“描述”数组中断言我的属性。
例子:
.body ("[0] .userType", equalTo (1)); // error
Run Code Online (Sandbox Code Playgroud)
这是我当前想要断言的 JSON 数据:
{
"validSession": true,
"value": "xxx",
"description": [
{
"userType": 1,
"userTypeDescription": "xxx",
"uname": "xx",
"distributorId": 1
}
]}
Run Code Online (Sandbox Code Playgroud) java rest rest-assured web-api-testing rest-assured-jsonpath