This chapter covers
- Introducing the testing pyramid and examining persistence testing in its context
- Creating a persistence application to test using Spring Boot
- Using the Spring TestContext Framework
- Working with Spring profiles to test Java persistence applications
- Using execution listeners to test Java persistence applications
All code needs to be tested. During development, we code, compile, and run. When we run, we may sometimes test how our code works. Testing persistence applications involves more than this. In those cases, our code interacts with the external database, and how our program works may be dependent on it.
In previous chapters, we focused on developing code that interacts with a database. We examined different alternatives for doing this, and different frameworks, and we interacted with various databases. Now we need to make sure that our programs are safe and bug-free. We need to be able to introduce changes without creating bugs, add new features without affecting the old features, and refactor code without breaking existing functionality. That is the purpose of this final chapter.