Skip to content
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

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

Closed
spring-projects-issues opened this issue Aug 28, 2009 · 2 comments
Assignees
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

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 28, 2009

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

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Mar 13, 2011

Sam Brannen commented

This issue is essentially a duplicate of #9309 in some respects, but the difference is that #9309 recommends to have annotation-driven dependency injection enabled only for the test instance; whereas, this issue proposes to provide a mechanism to disable this functionality on a per-test-instance basis.

Thus I'm leaving both issues open until a decision has been made as to what route to take (if either).

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Feb 10, 2014

Sam Brannen commented

Resolving this issue as "Won't Fix" since we have opted to implement the "child context" solution proposed in #9309 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants