Skip to content

Introduce @TestPropertySource support in the TestContext framework [SPR-12051] #16667

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

  1. Introduce a new @TestPropertySource annotation for configuring a test-specific PropertySource.
  2. @TestPropertySource must support attributes analogous to those found in @PropertySource (i.e., for declaring resource locations).
  3. @TestPropertySource must support an additional attribute that allows for key/value pairs to be declared inline.
  4. As with @ActiveProfiles, @TestPropertySource declarations on test classes should be inherited by default but overridable via a boolean flag (i.e., attribute in the annotation).
  5. The context cache key (i.e., MergedContextConfiguration) must take test property sources into account.

Further Resources


Issue Links:

Referenced from: commits f2ac025, 2cf4147

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions