Which statement is true? (Choose the best answer.)
A.
@ActiveProfiles is a class-level annotation that is used to instruct the Spring TestContext Framework to record all application events that are published in the ApplicationContext during the execution of a single test.
B.
@ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
C.
@ActiveProfiles is a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.
D.
@ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loaded an ApplicationContext for an integration test.
The Corect answer is D. And here is why others are not correct. A: @ActiveProfiles doesn't deal with recording application events. The Spring TestContext Framework handles event publication and listening separately.
B: @ActiveProfiles is specific to activating bean definition profiles for integration tests. It doesn't configure the overall bootstrapping of the TestContext Framework.
C: While @ActiveProfiles indirectly affects the environment, it doesn't directly configure the locations of property files or inline properties. That's typically done through @TestPropertySource or other configuration mechanisms.
'@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.'
Source https://docs.spring.io/spring-framework/reference/testing/annotations/integration-spring/annotation-activeprofiles.html
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
2211094
5 months, 2 weeks agojames2033
9 months, 2 weeks ago