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: https://youtu.be/DwBgx30ZWVc
Part II: https://youtu.be/2fPDw0PVbso
Part III: https://youtu.be/EPxII6TeqTQ
Part IV: https://youtu.be/zFkTA95w0oo

Source code: https://github.com/rieckpil/blog-tutorials/tree/master/spring-boot-datajpatest

Content:

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: https://github.com/vladmihalcea/hibernate-types

More testing related content is available on my blog: https://rieckpil.de/

» For more deep-dive into testing your Spring Boot persistence layer, consider joining the Testing Spring Boot Applications Masterclass: https://rieckpil.de/testing-spring-boot-applications-masterclass/

» Revamp your Testing Knowledge with this 14 Days Free Email Course on Testing Java Applications: https://rieckpil.de/getting-started-with-testing-java-applications-email-course/

#databases #@datajpatest

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