Closed
Description
Neale Upstone opened SPR-8503 and commented
When using @ContextConfiguration
in a test @Autowired
annotated fields get wired, even if context:annotation-driven/ has not been specified.
This is incorrect behaviour, as it means that a test can pass against a context configuration which when used in production will not behave that way.
A better approach would be to load the specified configuration into one application context, and then use a child context for wiring the test fixture.
The child context can then have the additional post processors, without polluting the application context under test.
Affects: 3.1 M2
Issue Links:
- Load dedicated child ApplicationContext for test instance in the TestContext framework [SPR-4632] #9309 Load dedicated child ApplicationContext for test instance in the TestContext framework ("duplicates")