Exercise: API Tests

Write an extension that can run API tests.

Problem Statement

When testing the REST API of a microservice, it’s common practice to treat the service as a black box. Testing is performed by sending requests to the REST API and verifying the response. These requests and responses are contracts of this API. To enable non-technical users to write API tests, we can use a JSON file to describe the request and desired response.

The JSON code below shows an example of a REST API test. The request sends a POST call to create a new user. The status code, headers, and body of the response are verified.

Get hands-on with 1400+ tech skills courses.