Third-party API testing methods

There are a few things to consider when trying to figure out the best method of testing third-party API's. One solution may not be the best fit for another so each should be considered individually.

Using the third party's production API

  • Is there a cost per request?

  • Are there many failures due to slow to respond requests?

  • Are there many failures due to the CI tool losing the network connection?

Check in the API responses (e.g. .json files) into source control

  • We would not notice right away if there is a mismatch between the response in the .json file and the actual response.

  • We would also not notice directly whether the API provider breaks the API by removing fields

Consumer driven contract testing (CDCT) - CDCT is often called TDD for microservices.

For more details, check out Contract Testing