API Testing
Building an API product without testing it is like trying to cross the ocean without a compass. Testing is a crucial activity that helps you identify issues related to performance, security, functionality, and also alignment with your stakeholders. API testing is a way to guarantee that you’re building what you’ve planned. It’s also a way to confirm that what’s running is what you have defined and that it works as expected.
You begin this chapter by exploring contract testing. You’ll learn that the goal of contract testing is to make sure that your API is behaving consistently. You’ll then learn how to define a contract test and find out what API elements can go into the definition. You’ll learn that you can not only test requests and responses but also the structure of payloads, data serialization formats, and headers, among other things. After that, you’ll see how having a well-written machine-readable definition...