Skip to content

Preserve ordering of inlined properties in @TestPropertySource [SPR-12710] #17307

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-12710 and commented

Status Quo

@TestPropertySource currently does not preserve the order of its inlined properties. Since it uses java.util.Properties internally to parse the property values, the order is lost.

Spring's Environment PropertySource is not restricted in the same way (for instance a Spring Boot app using YAML has ordered properties), so there is no way for a test to mimic the behavior of the configuration for the production application.

Proposal

Using an ordered Map as the source of the PropertySource would work.

Further Resources


Affects: 4.1 GA

Issue Links:

Referenced from: commits e5d41d9, d6a799a, 67934a2, f82c663

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions