### Question:
PhpbbRedirectionController { @RequestMapping("/topics/{topicParams}.php") public void showTopicWithAdditionalParams( @PathVariable String topicParams, HttpServletResponse response, WebRequest request) { String id = StringUtils.substringBefore(topicParams, "-"); String redirectUrl = request.getContextPath() + "/topics/" + id; setHttp301Headers(response, redirectUrl); }  @RequestMapping({"/ftopic{topicParams}", "/ftopic{topicParams}.php", "/ftopic{topicParams}/**", "/ftopic{topicParams}.php/**"}) void showFtopicWithAdditionalParams(@PathVariable String topicParams, HttpServletResponse response,
                                               WebRequest request); @RequestMapping("/topics/{topicParams}.php") void showTopicWithAdditionalParams(
            @PathVariable String topicParams,
            HttpServletResponse response,
            WebRequest request); @RequestMapping({"/sutra{id}.php", "/sutra{id}"}) void showPost(@PathVariable String id, HttpServletResponse response, WebRequest request); @RequestMapping("/forum{id}.php") void showBranch(@PathVariable String id, HttpServletResponse response, WebRequest request); @RequestMapping("/viewforum{branchParams}.php") void showBranchWithViewPrefix(@PathVariable String branchParams, HttpServletResponse response,
                                         WebRequest request); @RequestMapping("/search.php") void showSearch(HttpServletResponse response, WebRequest request);  }### Answer:
@Test public void testShowTopic() { controller.showTopicWithAdditionalParams("1", response, request); this.assertHeadersSet(CONTEXT + "/topics/1"); }
@Test public void testShowTopicWithAdditionalParams() { controller.showTopicWithAdditionalParams("14912-0", response, request); this.assertHeadersSet(CONTEXT + "/topics/14912"); }
@Test public void testShowTopicWithSid() { String additionalParams = "32044-0-0-asc-.php&sid=632e7bd4377d9d784b9fa67700f2"; controller.showTopicWithAdditionalParams(additionalParams, response, request); this.assertHeadersSet(CONTEXT + "/topics/32044"); }
@Test public void testShowTopicWithSorting() { controller.showTopicWithAdditionalParams("25044-0-asc-90", response, request); this.assertHeadersSet(CONTEXT + "/topics/25044"); }