LegacyController { @Deprecated @GetMapping("support/ckfinder.action") public ResponseEntity<?> ckfinder(HttpServletRequest request, @RequestParam("path") String path) { try { URI uri = URI.create(request.getContextPath() + "/userfiles/").resolve(path.replaceAll("^/+", "")); if (!uri.isAbsolute()) { return ResponseEntity.status(HttpStatus.FOUND).location(uri).build(); } } catch (IllegalArgumentException ignored) { } return ResponseEntity.notFound().build(); }  @Deprecated @GetMapping("conteststanding") String contestStanding(@RequestParam("contest_id") long contestId,
            RedirectAttributes redirectAttributes); @Deprecated @GetMapping("showcontest") String showContest(@RequestParam("contest_id") long contestId,
            RedirectAttributes redirectAttributes); @Deprecated @GetMapping("support/ckfinder.action") ResponseEntity<?> ckfinder(HttpServletRequest request,
            @RequestParam("path") String path);  }
@Test public void testCkfinder() throws Exception { log.info("ckfinder"); String requestUri = "/support/ckfinder.action"; mvc.perform(get("/ctx" + requestUri).param("path", "files/a.jpg").contextPath("/ctx")) .andExpect(status().isFound()) .andExpect(redirectedUrl("/ctx/userfiles/files/a.jpg")) .andReturn(); mvc.perform(get(requestUri).param("path", "/files/a.jpg")) .andExpect(status().isFound()) .andExpect(redirectedUrl("/userfiles/files/a.jpg")) .andReturn(); mvc.perform(get(requestUri).param("path", "/files/%A.jpg")) .andExpect(status().isNotFound()) .andReturn(); mvc.perform(get(requestUri).param("path", "http: .andExpect(status().isNotFound()) .andReturn(); }