0

I am integrating with different third-party payment provider via their API. Just wondering what is the good approach of testing these third party service/API?

Consumer/Producer contract testing?
end-to-end test?

Comments
  • 1
    For unit tests, you can stub those api calls and make assertions around all the possible scenarios and responses that can come from those APIs and make sure your program handles them.

    For integration or end to end tests, you can write mock implementations and some valid fixture data, which will be returned by these mocks. You can even spin docker containers which will be running those mock implementations. Now for your application this container will act like that third party API. However this approach is a bit painful.
Add Comment