Solution for Chapter 9: Testing APIs

In the exercise for this chapter (Chapter 9, ​Testing APIs​), your task is to create a Postman test collection for your credit-check API project and write two tests: a “happy path” test for the Home resource (http://localhost:8181/) and a “sad path” test for the From resource (http://localhost:8181/form/). You were supplied with extensive instructions for each test.

For extra credit, you were given the task to export the completed tests and use the newman command-line utility to run the tests locally.

Note: Before you start this exercise, make sure your local version of the credit-check API that you built in the last chapter is up and running. You can use the copy of that service in the /testing/exercises/before/credit-check ...

Get Design and Build Great Web APIs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.