January 2020
Intermediate to advanced
640 pages
16h 56m
English
Before we dive deeper into the inner workings of the price calculator, let's spend a bit of time examining how the two microservice dependencies work; after all, we will need this information to write our tests.
The price microservice provides a REST endpoint for retrieving an item's published price on a particular date. The service responds with a JSON payload that looks like this:
{ "price": 10.0, "currency": "GBP" }
The second microservice in this example is called vat and is also RESTful. It exposes an endpoint for retrieving the VAT rate that was applicable on a particular date. The service responds with a JSON payload as follows:
{ "vat_rate": 0.29 }
As you can see, the returned JSON payload is quite ...