-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Wrong semantic for immutable @ConfigurationProperties contributed via @Import #17831
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
Comments
Replacing
|
@mpalourdio Thanks for reporting it. It would be nice if What bugs me is that if it wasn't immutable it would just work and I'd like users don't have to care about that. |
Thanks for feedback. My bad, just deleted the repository as I thought the intended behaviour was Do you want me to reproduce another sample ? |
No, I have one. Thank you. |
The repository has been restored! |
Thanks for the report @mpalourdio. We've decided that we need a clearer signal for constructor property binding so we've introduced some new annotations (see #18469). Whilst this doesn't solve your problem, it does allow us to give a much better error message. If you update your sample and change
|
@philwebb Thanks for feedback and clarification ! |
@philwebb @snicoll So I have updated my sample with the very fresh RC1. Here is what I observe at the moment :
What bugs me is that something that used to work before (point 2 above) does not work anymore. Is this expected ? Should we really have to use the good annotation on a property class regardless it is immutable or not ? Thanks for feedback ! |
@mpalourdio Thank you for trying out 2.2.0.RC1. Yes, the behaviour you are now seeing is expected. We realised that we were trying to be too clever in attempting to determine whether a |
@wilkinsona Thanks for clarification. Looks like the way to go :) |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
As of SB 2.2.0.M5, the changelog states that
@ConfigurationProperties-annotated types are no longer scanned in slice tests unless imported explicitly. This restores the behaviour that slice tests should only scan what is described in the documentation.
When an immutable
@ConfigurationProperties
is imported in a test slice, and the constructor parameters are not beans (ex : strings), the test fail.As it's not that easy to describe, I have done a repository that reproduces the issue : https://github.com/mpalourdio/demorepro . Please run the single test to see it fail.
In order to make it work with SB 2.0.0.M4, remove the
@Import
in the test class, and change the SB version inpom.xml
to target SB 2.0.0.M4. The test will succeed.Thanks by advance, and let me know if you need more information.
The text was updated successfully, but these errors were encountered: