Support multiple junit-platform.properties#5559
Open
holly-cummins wants to merge 1 commit intojunit-team:mainfrom
Open
Support multiple junit-platform.properties#5559holly-cummins wants to merge 1 commit intojunit-team:mainfrom
holly-cummins wants to merge 1 commit intojunit-team:mainfrom
Conversation
…sspath, rather than just the first. Where the same property exists in multiple files, maintain the current behaviour. Issue: 2794
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ingest properties from all junit-platform.properties files on the classpath, rather than just the first. Where the same property exists in multiple files, maintain the current behaviour.
Resolves #2794
This ended up being a fairly straightforward change, because all the testing was already in place, and just needed a slight extension for the new behaviour. What I've done is loaded all properties files with the expected name. I reverse the order so that if the same property is present in multiple files, the first occurrence 'wins'.
I also kept the warning (but with amended wording, of course). If we wanted to be really fancy we could only warn if there actually is a conflict, but I wasn't sure if the extra effort was warranted.
I strengthened the assertions in the test to equals rather than contains, since it's easy to accidentally use similar values in test properties files.
I looked through the docs but couldn't find anywhere where it says you can only have one properties file, so I don't think there's anything to change there.
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations