Testing the Routes: Use Case - Loading
Explore how to test HTTP routes in Scala by loading non-existing and existing products. Understand handling empty responses and validating correct data retrieval through unit and integration tests.
We'll cover the following...
We'll cover the following...
Load a non-existing product
Let’s write a test for our first use case: loading a product!
Again, we will use the beforeEach and afterEach helpers to clean up our database. Let’s take a look at a test for loading a product that does not exist.
Maybe a bit verbose, but we make a real HTTP request, and check the response ...