@Override public Object intercept(T proxy, Method method, Object[] args, SuperMethod superMethod) { checkArgument(acceptsHttpGet(method), "Your logic method must accept HTTP GET method if you want to redirect to it"); try { String url = router.urlFor(type, method, args); String path = request.getContextPath() + url; includeParametersInFlash(type, method, args); logger.debug("redirecting to {}", path); response.sendRedirect(path); return null; } catch (IOException e) { throw new ProxyInvocationException(e); } }
@Before public void setup() { MockitoAnnotations.initMocks(this); proxifier = new JavassistProxifier(); methodInfo = new MethodInfo(new ParanamerNameProvider()); this.logicResult = new DefaultLogicResult(proxifier, router, request, response, container, resolver, extractor, flash, methodInfo); }