2V0-72-22 practice question 6 of 15
Which statement is true? (Choose the best
Full set: 79 questionsThe @ActiveProfiles annotation is a core feature of the Spring TestContext Framework used in integration testing. It is a class-level annotation that lets you specify which bean definition profiles should be active when the ApplicationContext is loaded for the test. This allows developers to selectively register different bean configurations for testing environments, such as using an in-memory database for tests instead of a production database, without changing application code.
A: This describes the @RecordApplicationEvents annotation, which is used for testing application event listeners. B: This describes the @BootstrapWith annotation, which is used for customizing the test context bootstrapping strategy. C: This describes the @TestPropertySource annotation, which is used for adding test-specific properties to the environment.
1. Spring Framework Documentation, v6.0.11, "Part II. Testing", Section 13. "Testing", Subsection 13.3. "Spring TestContext Framework", Sub-subsection 13.3.4. "Context Management". The documentation states: "@ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loading an ApplicationContext for an integration test."
2. Spring Framework Documentation, v5.3.29, "Testing", Section 6.3.4. "Context Management and Caching", paragraph on "Activating bean definition profiles with @ActiveProfiles". This section provides the same definition and examples of its usage in test classes.
Keep practicing
Take the free 2V0-72-22 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 2V0-72-22 practice questions
- Question 1Which two statements describe Spring JdbcTemplate? (Choose two.)
- Question 2Which two options will inject the value of the daily.limit system property? (Choose two.)
- Question 3Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)
- Question 4Which two statements are correct regarding Spring Boot auto-configuration customization? …
- Question 5Which two statements are true about @Controller annotated classes? (Choose two.)
- Question 8Which two statements are correct regarding the Health Indicator status? (Choose two.)
