Summary
In this chapter, you learned about multiple libraries that are needed to create unit tests and integration tests for the Cargo Tracker application and your own projects. This is an important skill to have as it gives you confidence in your own code bases. Creating unit and integration tests are part of the day-to-day tasks of a professional developer.
In the first section of this chapter, you learned that unit tests are small tests that only cover the smallest unit of code. For Java, that is a single method. You created your first test from the ground up and made it run using JUnit.
In the second part of the chapter, you learned that integration tests cover the integration of internal and external dependencies. You created an integration using Testcontainers, which uses Docker and an image of the Cargo Tracker application for the integration tests. After setting up the test container of the Cargo Tracker application, we showed you how you can test this instance using...