use of org.apache.sling.servlets.post.PostResponse in project sling by apache.
the class SlingPostServletTest method testRedirection.
private void testRedirection(String requestPath, String resourcePath, String redirect, String expected) throws Exception {
RedirectServletResponse resp = new RedirectServletResponse();
SlingHttpServletRequest request = new RedirectServletRequest(redirect, requestPath);
PostResponse htmlResponse = new HtmlResponse();
htmlResponse.setPath(resourcePath);
assertEquals(expected != null, servlet.redirectIfNeeded(request, htmlResponse, resp));
assertEquals(expected, resp.redirectLocation);
}
Aggregations