Which of the following annotations is specifically designed for testing JPA components?

  • @Autowired
  • @DataJpaTest
  • @RestController
  • @SpringBootApplication
The @DataJpaTest annotation is specifically designed for testing JPA (Java Persistence API) components in a Spring Boot application. It configures a slice of the application context that contains only JPA-related beans, making it suitable for JPA testing.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *