I've been using the @Required annotation up to now to ensure DI of my beans in a Spring configured application.
To enable the annotation, you need to declare a RequiredAnnotationBeanPostProcessor bean in your configuration.
In your test configuration you just don't declare it, so that if some beans are not needed you don't have to have them in your config.
I want to switch to less XML and use @Autowired annotation, but it is by default required=true, which is fine for the runtime configuration.
But I need @Autowired to be required=false for testing purpose only - while keeping it required for runtime.
Is that possible at all? I can't find a way to declaratively turn the required property to false.
cheers