-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Allow to set spring.test.constructor.autowire.mode in application.properties #25083
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
Thanks for the suggestion. Unfortunately, I'm not sure that this could be implemented in a way that wouldn't be confusing. Not, at least, without some changes to Spring Framework. As you know, the property is typically set in If the properties could be set in We'd need some changes to Spring Framework to allow the All in all, I don't think we should try to support setting |
@hansdesmet, you may not be aware of it, but as of Spring Framework 5.3 the Thus, if you already have a |
A nice alternative would be that If |
@hansdesmet, autowiring semantics in tests is a topic specific to Spring Framework and has been discussed in various Framework issues including spring-projects/spring-framework#18629, spring-projects/spring-framework#22286, and spring-projects/spring-framework#22924. |
Given the discussions above I think using Thanks anyway for the suggestion. |
application.properties can contain general settings. Examples:
It can also contain settings about testing:
The setting spring.test.constructor.autowire.mode can not be set in application.properties.
It must be set in test/resources/spring.properties
This is annoying:
Can spring.test.constructor.autowire.mode be set in application.properties ?
The text was updated successfully, but these errors were encountered: