Integration testing

One of the major features our users are interested in is integration tests.

An Integration test is when you don’t just test an endpoint and its content, but you want to create a complete flow, simulating what a real API consumer would do.

This approach addresses a common mistake that becomes almost unavoidable when you need to deal with, like, 30 micro-services, 300 endpoints maintained by 3 different teams: seeing the full picture.

Integration testing is actually pretty easy. Here’s a typical example:

  • you start with a login call, store the payload in a “loginPayload” variable and verify its content

login

  • you then call the search endpoint, and to do so, you use the “access token” stored in the “loginPayload” variable. You will store the results in the “resultsPayload” variable and verify its content

token

access_token

search

  • you then proceed by iterating on the results one by one, using the “product id” and the “access token” to make a third call to the details endpoint, store it in the “detailsPayload” variable and verify its content

each

  • you can also compare the summary of the search items with the actual details, verifying the results match the details

equals