How would you go about integration testing a spring application that is annotation-configured and component-scanned and does not have an XML configuration at all? I'm hitting a wall with the need to replace production components with testing components without actually resorting to xml configuration or reflection injections to all the @autowired parts.
Example:
interface A {...}
@Component
class AImpl implements A {
...
}
interface B {...}
@Component
class BImpl implements B {
@Autowired A a;
...
}
interface C {...}
class CImpl implements C {
@Autowired B b;
...
}
then in my test I want to use ATestImpl, but I only have access to C (integration testing C).
How would you go about doing that?