<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Data-Jpa-Test on Devops Monk</title><link>https://devops-monk.com/tags/data-jpa-test/</link><description>Recent content in Data-Jpa-Test on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 03 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/data-jpa-test/index.xml" rel="self" type="application/rss+xml"/><item><title>Testing the Repository Layer with @DataJpaTest</title><link>https://devops-monk.com/tutorials/spring-boot/spring-boot-repository-testing/</link><pubDate>Sun, 03 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/spring-boot/spring-boot-repository-testing/</guid><description>Repository tests verify your queries work correctly against a real database. Spring Boot&amp;rsquo;s @DataJpaTest starts a minimal slice — only JPA components — making tests fast while still catching real SQL issues.
@DataJpaTest — What It Loads @DataJpaTest is a test slice annotation:
@DataJpaTest class OrderRepositoryTest { // Spring loads: // - Your @Entity classes // - Your @Repository interfaces // - JPA infrastructure (EntityManager, transactions) // - An in-memory H2 database (by default) // // Spring does NOT load: // - @Service, @Controller, @Component classes // - Security configuration // - The full ApplicationContext } Each test method runs in a transaction that&amp;rsquo;s rolled back at the end — no data pollution between tests.</description></item></channel></rss>