-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Description
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
- Spring Boot Issue #1110 regarding syntax and parsing of inlined properties
- Major overhaul of
extractEnvironmentProperties()from Spring Boot'sSpringApplicationContextLoader
Affects: 4.1 GA
Issue Links:
- Open up TestPropertySourceUtils for public consumption [SPR-12721] #17318 Open up TestPropertySourceUtils for public consumption
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement