Spring Applications

Project: Order REST Service

The objective of this exercise is to implement a REST interface of the order service and to integrate it with the catalog microservice.
  1. Implement a REST controller OrderController that supports the following REST requests (details see API Documentation):
    • POST /orders − Place an order
    • GET /orders/{id} − Find an order by its identifier/li>
    • GET /orders?customerId={id}&year={year} − Search for orders by customer and year/li>
    • PATCH /orders/{id} − Cancel an order
  2. Instead of the entity classes, use the DTO classes as parameter types of the controller.
  3. Implement a REST client component CatalogClient and use it in the controller to look up the books of a purchase order in the catalog microservice.
  4. Test the controller using the Postman utility and run the OrderControllerIT integration test.