-
Couldn't load subscription status.
- Fork 38.8k
Description
Bernard Macours opened SPR-5261 and commented
We would like to conditionally remotely expose some beans in our integration testing environment, but this is currently not possible (there is no out-of-the-box solution). Typically the condition would be based on a property value (a system property or a property from a property file), for example:
<bean id="MyHttpExporterToBeUsedInIntegrationTestingEnvironmentOnly" class="...">
<condition property-name="environment" property-value="INTEGRATION.*"/>
</bean>
Where "property-name" gives a property name and "property-value" a regular expression the property value must match for the bean to be instanciated.
To ease error detection, it would also be nice to get an exception like "ConditionalBeanAccessException" when trying to reference a conditional bean which has not been instanciated.
Affects: 2.5.5
Issue Links:
- Add environment abstraction and support bean definition profiles [SPR-7508] #12165 Add environment abstraction and support bean definition profiles ("is superseded by")