This is the first video of the @DataJpaTest mini-series. We’ll inspect @DataJpaTest for writing tests for our persistence layer and encounter the pitfalls of using an in-memory database (like H2).

Part I:
Part II:
Part III:
Part IV:

Source code:


0:00 Which parts of our Spring Data JPA persistence layer should we test?
1:54 Inspecting @DataJpaTest
4:12 Running the first test with @DataJpaTest
5:50 Why H2 is not suitable for our test case
7:45 Add Flyway to the project for creating the database schema on our own

Vlad Mihalcea’s hibernate-types project:

More testing related content is available on my blog:

» For more deep-dive into testing your Spring Boot persistence layer, consider joining the Testing Spring Boot Applications Masterclass:

» Revamp your Testing Knowledge with this 14 Days Free Email Course on Testing Java Applications:

#databases #@datajpatest

Introduction to @DataJpaTest and Pitfalls of In-Memory Databases For Testing
1.40 GEEK