Creating integration tests for the application
The three tests we've written so far have been unit tests for a single module, and an integration test between two different modules. However, to be confident that our code is working, it would be cool if we could test the application as a whole. That's what we'll do here. We'll wire up our application with a testing configuration and run a few tests against it.
We'll start by calling the same function we called to initialize the web server and then create instances of all its dependencies (controllers, repositories, and so on). We'll make sure we use things such as in-memory persistence to do so. This will make sure that our tests are replicable and don't need a complex teardown phase or a connection to a real database, as that would slow down the tests.
We'll start by creating a test file that, for now, will encompass the integration tests for the application. As the application evolves...