简体   繁体   中英

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{

"code": 200, "meta": { "pagination": { "total": 1526, "pages": 77, "page": 5, "limit": 20 } }

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM