Class MockStrategiesHelper
java.lang.Object
org.springframework.ws.test.support.MockStrategiesHelper
Helper class for for loading default implementations of an interface.
- Since:
- 2.0
- Author:
- Arjen Poutsma
- 
Constructor SummaryConstructorsConstructorDescriptionMockStrategiesHelper(org.springframework.context.ApplicationContext applicationContext) Creates a new instance of theMockStrategiesHelperwith the given application context.
- 
Method SummaryModifier and TypeMethodDescriptionorg.springframework.context.ApplicationContextReturns the application context.<T> TgetStrategy(Class<T> type) Returns a single strategy found in the given application context.<T,D extends T> 
 TgetStrategy(Class<T> type, Class<D> defaultType) Returns a single strategy found in the given application context, or instantiates a default strategy if no applicable strategy was found.
- 
Constructor Details- 
MockStrategiesHelperpublic MockStrategiesHelper(org.springframework.context.ApplicationContext applicationContext) Creates a new instance of theMockStrategiesHelperwith the given application context.- Parameters:
- applicationContext- the application context
 
 
- 
- 
Method Details- 
getApplicationContextpublic org.springframework.context.ApplicationContext getApplicationContext()Returns the application context.
- 
getStrategyReturns a single strategy found in the given application context.- Parameters:
- type- the type of bean to be found in the application context
- Returns:
- the bean, or nullif no bean of the given type can be found
- Throws:
- org.springframework.beans.factory.BeanInitializationException- if there is more than 1 beans of the given type
 
- 
getStrategyReturns a single strategy found in the given application context, or instantiates a default strategy if no applicable strategy was found.- Parameters:
- type- the type of bean to be found in the application context
- defaultType- the type to instantiate and return when no bean of the specified type could be found
- Returns:
- the bean found in the application context, or the default type if no bean of the given type can be found
- Throws:
- org.springframework.beans.factory.BeanInitializationException- if there is more than 1 beans of the given type
 
 
-