When we send a request using the HTTP GET method, the API responds with the data. I need to ensure that the values of a specific input key match exactly what was specified in the GET URL.
The URL that was used for the request:
https://dummy.dns.com/Wells/resource?$filter=employee.address eq 'France FR'
The API provided the following response:
{"next":"https://dummy.dns.com/Wells/resource?$skip=10&$filter=employee.address eq 'France FR'","value":[{"customer.name":"Stefan Peter","customer.landlinePhoneNumber":"97642","employee.country.name":"France","employee.country.id":"FR","employee.address":"France FR","employee.latitude":49,"employee.longitude":7.6,"leave.count":0,"_id":"M1023453","_externalId":"WF3453","_name":"WellsFargo","_employeeType":["contractual"],"_employee":"WF3453","_customer":"M1023453","leave.sickCount":0,"leave.casualCount":0},{"customer.name":"Stefan Peter","customer.landlinePhoneNumber":"97642","employee.country.name":"France","employee.country.id":"FR","employee.address":"France FR Junk","employee.latitude":49,"employee.longitude":7.6,"leave.count":0,"_id":"M1023454","_externalId":"WF3454","_name":"WellsFargo","_employeeType":["contractual"],"_employee":"WF3454","_customer":"M1023454","leave.sickCount":0,"leave.casualCount":0},{"customer.name":"Stefan Peter","customer.landlinePhoneNumber":"97642","employee.country.name":"France","employee.country.id":"FR","employee.address":"France FR","employee.latitude":49,"employee.longitude":7.6,"leave.count":0,"_id":"M1023455","_externalId":"WF3455","_name":"WellsFargo","_employeeType":["contractual"],"_employee":"WF3455","_customer":"M1023455","leave.sickCount":0,"leave.casualCount":0}]}
Now I need to verify that the key-value pairs match the ones I provided in the URL as input/query parameters.
I am utilizing JMeter as my client for API testing. Can someone recommend a custom assertion to validate this? The response contains an array that could potentially grow to 100 or 200 entries. I appreciate any suggestions. Thank you.