Which annotation is used to disable full auto-configuration and instead apply only configuration relevant to JPA tests in Spring Boot?
- @AutoConfigureTestDatabase
- @JpaTest
- @RunWith(SpringRunner.class)
- @SpringBootTest
The @JpaTest annotation is used in Spring Boot to disable full auto-configuration and apply configuration relevant to JPA tests. It sets up an environment for testing JPA repositories. @SpringBootTest and @RunWith(SpringRunner.class) are more general-purpose testing annotations, while @AutoConfigureTestDatabase is used for configuring the test database.
Loading...
Related Quiz
- Can you detail the process and considerations for creating efficient custom auto-configurations that do not negatively impact application startup time?
- For custom validation logic in Spring Boot, the _____ method of the ConstraintValidator interface needs to be implemented.
- What is the significance of the @MockBean annotation in Spring Boot testing?
- To externalize configuration properties in Spring Boot, the _____ annotation can be used on a configuration properties class.
- In Spring Boot, _____ annotation is used to map HTTP POST requests onto specific handler methods.