*/
public class TestExecutingEndpointAdapter extends XmlTestExecutingEndpointAdapter {
@Override
public Message dispatchMessage(final Message request, String mappingName) {
final CitrusTestBuilder testBuilder;
try {
testBuilder = getApplicationContext().getBean(mappingName, CitrusTestBuilder.class);
} catch (NoSuchBeanDefinitionException e) {
throw new CitrusRuntimeException("Unable to find test builder with name '" +
mappingName + "' in Spring bean context", e);
}
getTaskExecutor().execute(new Runnable() {
public void run() {
prepareExecution(request, testBuilder);
testBuilder.execute();
}
});
return getResponseEndpointAdapter().handleMessage(request);
}