Response Validation Fields

21 views
Skip to first unread message

Marcelo Esperandio Lucio

unread,
Oct 22, 2021, 9:12:47 AM10/22/21
to REST assured
I'm new to RestAssured and would like to know, how do I validate a particular field of the response. However, I would need to validate the existence of the fields (user, DataHouse, Value.) in the response. I did it, but it's going wrong. :( 

String userSale = responseSerasaComplete.path("sale.userSale").toString() Assert.assertEquals("user",userSale); 

"Sale": { 
                "user": 4, 
                 "DataHouse": "2019-12-17T00:00:00", 
                 "Value": 24391.24,
{

Sajitha Pathirana

unread,
Oct 22, 2021, 9:24:07 AM10/22/21
to rest-a...@googlegroups.com
Hi Marcelo,
You can use jpath, extract each value to assert.


with regards,
Sajitha Pathirana.


Be kinder than necessary because everyone you meet is fighting some kind of 
battle.



--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rest-assured/32c67d8d-4570-479e-84a2-3cdd4f8ece72n%40googlegroups.com.

Marcelo Esperandio Lucio

unread,
Oct 22, 2021, 10:08:16 AM10/22/21
to REST assured
Sajitha 

Tks mate, 

Sajitha Pathirana

unread,
Oct 22, 2021, 11:48:33 AM10/22/21
to rest-a...@googlegroups.com
No worries mate!

with regards,
Sajitha Pathirana.


Be kinder than necessary because everyone you meet is fighting some kind of 
battle.


Reply all
Reply to author
Forward
0 new messages