Start here. This is the direct spoken answer to practice first.
Overview
A JPA slice is valuable only when its database and transaction behavior match the claim the test makes.
@DataJpaTest loads a focused JPA test slice with entity mappings, repositories, and related persistence infrastructure. Tests are normally transactional and roll back afterward, which gives convenient isolation. Depending on configuration, Spring Boot may replace the application data source with an embedded database. That is useful for fast repository checks, but it cannot prove behavior specific to the production engine.