Provide mechanism for disabling automatic annotation-driven autowiring in tests [SPR-6050] #10719
Labels
in: test
Issues in the test module
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Sam Brannen opened SPR-6050 and commented
In the Spring TestContext Framework (i.e., specifically in AbstractGenericContextLoader), annotation-driven autowiring is automatically enabled. In other words, all ApplicationContexts created by subclasses of AbstractGenericContextLoader (e.g., GenericXmlContextLoader) are automatically configured to process annotations.
If you explicitly wish that annotation processing not be enabled for the configuration files you specify -- for example, if some of the beans are annotated with
@Autowired
, etc. but you do not want those beans to be autowired -- you are at a loss: there is currently no way to disable this.As indirectly suggested in the forum, it would be nice if Spring provided a mechanism for disabling automatic annotation-driven autowiring in tests.
Affects: 2.5.6
Reference URL: http://forum.springsource.org/showthread.php?t=74298
Issue Links:
2 votes, 2 watchers
The text was updated successfully, but these errors were encountered: