* @param testClass the test class being executed
*/
protected void handleMockEndpointsAndSkip(ConfigurableApplicationContext context, Class<?> testClass) throws Exception {
if (testClass.isAnnotationPresent(MockEndpointsAndSkip.class)) {
final String mockEndpoints = testClass.getAnnotation(MockEndpointsAndSkip.class).value();
CamelSpringTestHelper.doToSpringCamelContexts(context, new DoToSpringCamelContextsStrategy() {
public void execute(String contextName, SpringCamelContext camelContext)
throws Exception {
logger.info("Enabling auto mocking and skipping of endpoints matching pattern [{}] on CamelContext with name [{}].", mockEndpoints, contextName);
camelContext.addRegisterEndpointCallback(new InterceptSendToMockEndpointStrategy(mockEndpoints, true));