- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement
Milestone
Description
Sam Brannen opened SPR-12051 and commented
Status Quo
#14865 and #16004 proposed support for using @PropertySource on test classes and introducing @TestPropertyValue for declarative PropertySource value declarations, respectively. This issue supersedes those two issues by combining the two proposals into a dedicated @TestPropertySource annotation.
Deliverables
-  Introduce a new @TestPropertySourceannotation for configuring a test-specificPropertySource.
-  @TestPropertySourcemust support attributes analogous to those found in@PropertySource(i.e., for declaring resource locations).
-  @TestPropertySourcemust support an additional attribute that allows for key/value pairs to be declared inline.- See the proposal in Support declarative PropertySource annotations in the TestContext framework [SPR-11377] #16004 as well as the valueattribute in@IntegrationTestfrom Spring Boot for implementation ideas.
 
- See the proposal in Support declarative PropertySource annotations in the TestContext framework [SPR-11377] #16004 as well as the 
-  As with @ActiveProfiles,@TestPropertySourcedeclarations on test classes should be inherited by default but overridable via a boolean flag (i.e., attribute in the annotation).
-  The context cache key (i.e., MergedContextConfiguration) must take test property sources into account.
Further Resources
- See the proposals, analysis, and discussions in Allow @PropertySource to be specified on a test class [SPR-10232] #14865 and Support declarative PropertySource annotations in the TestContext framework [SPR-11377] #16004 for further insight.
- ConfigurationClassParser.processPropertySource(AnnotationAttributes)
Issue Links:
- Document @TestPropertySource support in the reference manual [SPR-12076] #16692 Document @TestPropertySourcesupport in the reference manual ("is depended on by")
- Allow @PropertySource to be specified on a test class [SPR-10232] #14865 Allow @PropertySourceto be specified on a test class ("supersedes")
- Support declarative PropertySource annotations in the TestContext framework [SPR-11377] #16004 Support declarative PropertySource annotations in the TestContext framework ("supersedes")
Referenced from: commits f2ac025, 2cf4147
1 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement