Addresses https://github.com/spring-projects/spring-boot/issues/27854 with unit test demonstrating desired functionality
Comment From: pivotal-cla
@dominiccroce Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@dominiccroce Thank you for signing the Contributor License Agreement!
Comment From: dominiccroce
Running into
What went wrong:
Execution failed for task ':spring-boot-project:spring-boot-properties-migrator:checkFormatTest'.
> Formatting violations found in the following files:
* src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java
Run `format` to fix.
I've run ./gradlew format locally and get
BUILD SUCCESSFUL in 41s
233 actionable tasks: 230 executed, 3 up-to-date
A build scan was not published as you have not authenticated with server 'ge.spring.io'.
Any ideas on how to determine what is wrong with my format?
EDIT: nevermind I see the format command made the changes automatically
Comment From: dominiccroce
Thanks for the PR but it doesn't address the issue.
It looks like there is some confusion between
MapPropertySource(an implementation detail, irrelevant to this issue) and a property that happens to be of type map.I think one way of fixing this would be to patch
getMatchingProperties. Right now, it looks for an exact match but we could also look for properties that would match the prefix if the property is deprecated.Would you be willing to give it another try? No problem if you can't, I can take over.
I have pushed a new commit to address the issues. The main problem I am facing is for any PropertyResource, I want to be able to iterate through the ConfigurationPropertyNames. Once we have those, I rely on existing code to handle prefix matching. From there I handle prefix matching. I am lacking some context on PropertySource but feels like there should be a way to get all PropertyNames without casting to IterableConfigurationPropertySource.
Comment From: snicoll
@dominiccroce thanks but I think we will have to restart this one from scratch I am afraid. The last changes are breaking existing tests and we should really consider looking at filter.