* @return the created server
* @throws IllegalArgumentException if the given application context contains neither a {@link WebServiceTemplate}
* nor a {@link WebServiceGatewaySupport}.
*/
public static MockWebServiceServer createServer(ApplicationContext applicationContext) {
MockStrategiesHelper strategiesHelper = new MockStrategiesHelper(applicationContext);
WebServiceTemplate webServiceTemplate = strategiesHelper.getStrategy(WebServiceTemplate.class);
if (webServiceTemplate != null) {
return createServer(webServiceTemplate);
}
WebServiceGatewaySupport gatewaySupport = strategiesHelper.getStrategy(WebServiceGatewaySupport.class);
if (gatewaySupport != null) {
return createServer(gatewaySupport);
}
throw new IllegalArgumentException(
"Could not find either WebServiceTemplate or WebServiceGatewaySupport in application context");