PrepZone Logo
PrepZone
Back to Spring Boot

Spring Boot · Medium

What is @DataJpaTest used for?

Spring BootTestingTest SlicesSeniorStaff

Answer preview

Overview: @DataJpaTest is a JPA slice test annotation that loads only the JPA-related components: entities, repositories, Hibernate, and an embedded in-memory database (H2 by default).…