Skip to content

Provide mechanism for disabling automatic annotation-driven autowiring in tests [SPR-6050] #10719

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulestatus: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions