我想在RestAssured的响应中断言“总计”,有人可以建议我该怎么做

问题描述

Headers: Authorization=Bearer4796aea4838ce5487518c706d49cc847b57e4196b52f0921539697e2d44bf060Accept=*/*Cookies: <none>Multiparts: <none>Body: <none>200{

“代码”:200, “元”:{ “分页”:{ “总计”:1526, “页面”:77, “页面”:5 “限制”:20 } }

解决方法

使用JsonPath获取键的值,然后断言

Assert.assertEquals(response.body().jsonPath().getInt("meta.pagination.total"),1534);

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...