我想从 RestAssured 的响应中断言 "Total" 有人可以建议我怎么做吗
I want to assert "Total" from the response in RestAssured can someone suggest me how to do that
Headers: Authorization=Bearer4796aea4838ce5487518c706d49cc847b57e4196b52f0921539697e2d44bf060Accept=*/*Cookies: <none>Multiparts: <none>Body: <none>200{
“代码”:200,
“元”:{
“分页”:{
“总计”:1526,
“页面”:77,
“页面”:5,
“限制”:20
}
}
使用JsonPath获取key的值然后断言
Assert.assertEquals(response.body().jsonPath().getInt("meta.pagination.total"), 1534);
Headers: Authorization=Bearer4796aea4838ce5487518c706d49cc847b57e4196b52f0921539697e2d44bf060Accept=*/*Cookies: <none>Multiparts: <none>Body: <none>200{
“代码”:200, “元”:{ “分页”:{ “总计”:1526, “页面”:77, “页面”:5, “限制”:20 } }
使用JsonPath获取key的值然后断言
Assert.assertEquals(response.body().jsonPath().getInt("meta.pagination.total"), 1534);