Spring Boot and H2 Database: Integration Example
Learn to configure Spring boot with H2 database to create and use an in-memory database in runtime, generally for unit testing or POC purposes.
Learn to configure Spring boot with H2 database to create and use an in-memory database in runtime, generally for unit testing or POC purposes.
Unit test Hibernate repositories against an in-memory H2 database with JUnit 6: one EntityManagerFactory per test class, data from import.sql, a fresh copy of the data before every test with truncate(), and the H2 settings and pitfalls that break tests.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.