Closed
Description
Mike opened SPR-10744 and commented
For testing purposes, I am trying to override a bean configured as a singleton (in production) by making it a scoped proxy using a custom testing scope. The testing configuration extends the production configuration.
However, this bean is never loaded as a scoped proxy at all! When I apply the test configuration, the bean is always autowired as a singleton instead of (the desired) scoped proxy (regardless whether it's a CGLIB or JDK dynamic proxy).
Affects: 3.2.2, 3.2.3
Reference URL: http://stackoverflow.com/questions/17688326/overriding-a-singleton-with-a-scoped-proxy
Issue Links:
- Regression in 4.0.0 - A scoped-proxy bean cannot override another bean [SPR-11229] #15854 Regression in 4.0.0 - A scoped-proxy bean cannot override another bean
- @Bean overriding does not pick up metadata from most specific method [SPR-10992] #15620
@Bean
overriding does not pick up metadata from most specific method
Referenced from: commits d0f9853, 299776f
Backported to: 3.2.5