Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow test property sources to override command line args #29404

Closed
philwebb opened this issue Jan 14, 2022 · 0 comments
Closed

Allow test property sources to override command line args #29404

philwebb opened this issue Jan 14, 2022 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

Whilst working on #29169 we discovered that the inlined test property sources are always added below the commandLineArgs. This is a bit unusual and if they could be added above other property sources our code would be a lot simpler.

We'd like to change the order from this:

SimpleCommandLinePropertySource {name='commandLineArgs'}, 
MapPropertySource {name='Inlined Test Properties'}, 
PropertiesPropertySource {name='systemProperties'}, 
OriginAwareSystemEnvironmentPropertySource {name='systemEnvironment'},
RandomValuePropertySource {name='random'}, 
OriginTrackedMapPropertySource {name='Config resource 'class path resource [application.properties]' via location 'optional:classpath:/''}

To this:

MapPropertySource {name='Inlined Test Properties'}, 
SimpleCommandLinePropertySource {name='commandLineArgs'}, 
PropertiesPropertySource {name='systemProperties'}, 
OriginAwareSystemEnvironmentPropertySource {name='systemEnvironment'},
RandomValuePropertySource {name='random'}, 
OriginTrackedMapPropertySource {name='Config resource 'class path resource [application.properties]' via location 'optional:classpath:/''}

We can't really do this in a patch release, but it seems like something we could do in a minor.

@philwebb philwebb self-assigned this Jan 14, 2022
@philwebb philwebb added the type: enhancement A general enhancement label Jan 14, 2022
@philwebb philwebb changed the title Add test property sources above command line arguments Test property sources cannot override command line args Jan 14, 2022
@philwebb philwebb changed the title Test property sources cannot override command line args Allow test property sources to override command line args Jan 14, 2022
@philwebb philwebb added this to the 2.7.0-M1 milestone Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant