/** * Return a "mock" controller instance. When an {@code @RequestMapping} method * on the controller is invoked, the supplied argument values are remembered * and the result can then be used to create a {@code UriComponentsBuilder} * via {@link #fromMethodCall(Object)}. * <p>Note that this is a shorthand version of {@link #controller(Class)} intended * for inline use (with a static import), for example: * <pre class="code"> * MvcUriComponentsBuilder.fromMethodCall(on(FooController.class).getFoo(1)).build(); * </pre> * <p><strong>Note:</strong> This method extracts values from "Forwarded" * and "X-Forwarded-*" headers if found. See class-level docs. * * @param controllerType the target controller */ public static <T> T on(Class<T> controllerType) { return controller(controllerType); }
/** * Return a "mock" controller instance. When an {@code @RequestMapping} method * on the controller is invoked, the supplied argument values are remembered * and the result can then be used to create a {@code UriComponentsBuilder} * via {@link #fromMethodCall(Object)}. * <p>Note that this is a shorthand version of {@link #controller(Class)} intended * for inline use (with a static import), for example: * <pre class="code"> * MvcUriComponentsBuilder.fromMethodCall(on(FooController.class).getFoo(1)).build(); * </pre> * <p><strong>Note:</strong> This method extracts values from "Forwarded" * and "X-Forwarded-*" headers if found. See class-level docs. * * @param controllerType the target controller */ public static <T> T on(Class<T> controllerType) { return controller(controllerType); }
/** * Return a "mock" controller instance. When an {@code @RequestMapping} method * on the controller is invoked, the supplied argument values are remembered * and the result can then be used to create a {@code UriComponentsBuilder} * via {@link #fromMethodCall(Object)}. * <p>Note that this is a shorthand version of {@link #controller(Class)} intended * for inline use (with a static import), for example: * <pre class="code"> * MvcUriComponentsBuilder.fromMethodCall(on(FooController.class).getFoo(1)).build(); * </pre> * <p><strong>Note:</strong> This method extracts values from "Forwarded" * and "X-Forwarded-*" headers if found. See class-level docs. * * @param controllerType the target controller */ public static <T> T on(Class<T> controllerType) { return controller(controllerType); }