Kata 7: Mocking Me

Kata 7: Mocking Me

The App

SmartFashion is a clothes store. It has an API which can be used by their own website or other websites they have partnered with, hence the need for the API.

The API is basically a CRUD (Create, Read, Update, Delete) API.

Basic Clients can:

  • Search for items
  • Buy items

Admin Clients can also:

  • Add items
  • Remove items
  • Update items

Problem Statement

Now that you have tested the API thoroughly, it’s time to test the integration of our API with an external system. For example, it would be quite important to test that the payment system is used correctly, even if we certainly do not want to use the real payment system during the tests. A good read to get up to speed on this is our Best Practices: API Mocking article.

Clues

Highlight the text below to reveal the clues:

  • Assume that there’s at least two different payment systems which a user can select from.
  • Also assume that you’re able to plug a “fake” payment system (which is under your control so that you can send whatever response you want for each request) easily into the API back-end.
  • Try to ensure the API does the right thing for every possible response received from the payment system.