RESTful API testing

There are two ways to test a RESTful API. The first way is to test a RESTful API of a running application that is deployed to a server. In this approach, the test code acts as the client of the API. This is usually called an integration test because it tests all of the code that's involved in that the API's execution. Normally, the integration test is executed at a late stage, during Continuous Delivery (CD).

The second way is to isolate the API handler itself, using mocks for its dependencies and writing code to test the logic of the API handler. This is called unit testing and is where we have control of the dependencies and hence can expect the result of the execution to be precisely what we want. This is the approach we will use to test the RESTful API.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.62