O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Service tests

These tests are in the middle level of the test pyramid and they focus on interacting with one microservice in its entirety, and in isolation. The collaboration of this microservice with the outside world is replaced by mock JSON. Service-level tests test scenarios, rather than making a single request. They make a sequence of requests that together form a complete picture. These are real HTTP requests and responses, rather than mocked responses.

For example, a service-level test for a credits program can do the following:

  1. Send a command to trigger a user in the credits category (the command here follows the CQRS pattern seen in Chapter 1, Debunking Microservices. CQRS follows a synchronous pattern of communication, so, its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required