What I've found useful in this scenario is to have an intermediate bean that has a default setting - for use in the main application - and provide an override for other applications, or test scenarios.
So, for example, let's say that your main application uses 'type1' - set up you main config file like this...
Then, in your test environment, have and additional config file that is added to (the end of) the list of config file that you load...
<bean id="type1" .../>
<bean id="type2" .../>
<bean id="actualType" parent="type1"/>
<bean id="middle" ...>
<property name="a" ref="actualType">
<bean id="actualType" parent="type2"/>
The same technique works just as well for applications that need to use something other than 'type1'
Hope this makes sense.
If you didn't learn anything today, you weren't paying attention!