### Question:
ControllerExtractor extends AbstractSpringContextModelExtractor { void buildFromControllerClass(ServiceModelBuilder builder, Class<?> controllerClass) { ReflectionUtils.doWithMethods(controllerClass, method -> { buildFromControllerMethod(builder, controllerClass, method); }, method -> AnnotationUtils.findAnnotation(method, RequestMapping.class) != null); }  @Override void extract(ServiceModelBuilder builder);  }### Answer:
@Test public void shouldHandleSimpleCase() { class MyController1 { @RequestMapping(method= RequestMethod.GET, path="/orders") public void getOrders() { } } extractor.buildFromControllerClass(builder, MyController1.class); verify(builder).addSynchronousQueryEndpoint("getOrders", "GET", "/orders"); }
@Test public void shouldHandleComplexCase() { @RequestMapping(path="/orders") class MyController2 { @RequestMapping(method= RequestMethod.GET) public void getOrders() { } } extractor.buildFromControllerClass(builder, MyController2.class); verify(builder).addSynchronousQueryEndpoint("getOrders", "GET", "/orders"); }