I see your book has a chapter on Contract Tests. Would you recommend writing contract tests (I'd guess Consumer Contracts) for APIs that are 3rd party, i.e., not controlled by my company? I'm guessing APIs like Twitter or Stripe, etc., aren't going to need it, but there are many small APIs that are consumed that might change in unexpected ways.
Yes! There’s certainly usefulness in that. Would you prefer to find out in testing or production that a third party changed their API? You could also contact the third party and offer your tests to them to let them know you expect this contract. If they know you’re using their service they’re more likely to let you know of changes. Certainly worth doing, especially if you don’t have an SLA (service level agreement) with them.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad: