LogViewEndpoint implements MvcEndpoint { @RequestMapping public void redirect(HttpServletResponse response) throws IOException { response.sendRedirect("log/"); } LogViewEndpoint(String loggingPath, List<String> stylesheets); @RequestMapping void redirect(HttpServletResponse response); @RequestMapping("/") @ResponseBody String list(Model model, // TODO model should no longer be injected
                       @RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy,
                       @RequestParam(required = false, defaultValue = "false") boolean desc,
                       @RequestParam(required = false) String base); @RequestMapping("/view") void view(@RequestParam String filename,
                     @RequestParam(required = false) String base,
                     @RequestParam(required = false) Integer tailLines,
                     HttpServletResponse response); @RequestMapping("/search") void search(@RequestParam String term, HttpServletResponse response); @Override String getPath(); @Override boolean isSensitive(); @Override Class<? extends Endpoint> getEndpointType();  }
@Test public void shouldRedirectWithoutTrainingSlash() throws IOException { logViewEndpoint.redirect(response); verify(response).sendRedirect("log/"); }