@Inject CamelContextMap camelContextMap;
@Produces
@Mock
public MockEndpoint createMockEndpoint(InjectionPoint point) {
Mock annotation = point.getAnnotated().getAnnotation(Mock.class);
ObjectHelper.notNull(annotation, "Should be annotated with @Mock");
String uri = annotation.value();
if (ObjectHelper.isEmpty(uri)) {
uri = "mock:" + point.getMember().getName();
}
return CamelContextHelper.getMandatoryEndpoint(getCamelContext(point, annotation.context()), uri, MockEndpoint.class);
}