I have this bean in my Spring Java configuration:
@Bean
@Scope( proxyMode=ScopedProxyMode.TARGET_CLASS, value=SpringScopes.DESKTOP )
public BirtSession birtSession() {
return new BirtSession();
}
For tests, I need a layout without scope (in the test, there is no "Desktop" area). But when I create my test configuration, which imports the above configuration and contains:
@Bean
public BirtSession birtSession() {
return new MockSession();
}
I get a "Desktop" with a fake bean: - (
How to make Spring forget the annotation @Scope?
PS: It works when I do not use @Importand use copy & paste, but I do not want to do this.
source
share