kbourdel
9 years agoOccasional Contributor
What is best practice when trying to compare a large json response to what is in the db
Looking for some advice to see if there is a more efficent way to do this - comparing json object in the response to the db.
I have a restful api which returns a large response (6000 objects).
I need to compare the response, to what is in the database.
So I created the following flow in the test case:
1. JDBC datasource - reading from the database, getting the 6000 names
2. Restful api (GET) - contained assertion is looking at the datasource to make sure it exists
3. Datasource loop
So when this runs, its looping through 6000 times, running the api & making sure in each iteriation the datasource property name exists. Not very efficent.
Is there a way to take the response from the api, and compare it in one shot to what is in the database?