Integration Test for 3rd party API
Guys, I would like to ask opinions regarding integration test related to 3rd party API.
My Opinion for Integration Test
- Do actual API request to the 3rd party API so that we can get the actual value and verify the application work flow in general. ( We don't pay per request)
Reason : The purpose of integration is to check the current application can communicate with other applications without any issues.
If Anything has been changed from the 3rd party, we can verify just by running the test all. No require to figure out where it came from.
Team member Opinion
- Mock the http client and response so that we can isolate the response from the outside. Also, we already have manual testing from the QA side so if anything is changed, we can notice the issue from that side.
May I ask any opinions regarding this?
2 Replies
I'd certainly test in isolation, to check that just your code works
What happens when the API goes down, but you have some code to write? Do you just not run the tests? Or do you let them all fail?
Whether to test the 3rd party API...? Ideally, it's that 3rd party that would be doing the testing, and the API itself would be versioned
If that is not the case, I'd probably make a test suite in Bruno/Insomnia/Postman/whatever
More like let them fail for the failure scenario.
Basically if API is down, we are going to figure out from the prod application side and developers will be notified to identify the problems. For that scenario, easily can check why it fails just through the testing projects.
I guess the logic within the VendorServie is pretty straightforward - just request to the API and get the json string and return
But I get your point, Thanks.