@Test public void shouldGetReportParameters() throws Exception { Long id = 2L; Template template = new Template(); when(templateService.getLWById(id)).thenReturn(template); Template reportWithParameters = controller.getReportWithParameters(id); assertThat(reportWithParameters, is(template)); }
@RequestMapping(method = GET, value = "/reports/{id}") public Template getReportWithParameters(@PathVariable("id") Long id) { return templateService.getLWById(id); }
ReportController { @RequestMapping(method = GET, value = "/reports/{id}") public Template getReportWithParameters(@PathVariable("id") Long id) { return templateService.getLWById(id); } }
ReportController { @RequestMapping(method = GET, value = "/reports/{id}") public Template getReportWithParameters(@PathVariable("id") Long id) { return templateService.getLWById(id); }  }
ReportController { @RequestMapping(method = GET, value = "/reports/{id}") public Template getReportWithParameters(@PathVariable("id") Long id) { return templateService.getLWById(id); }  @RequestMapping(method = GET, value = "/reports/{id}") Template getReportWithParameters(@PathVariable("id") Long id); @RequestMapping(method = GET, value = "/reports/{id}/{format}") ModelAndView generateReport(HttpServletRequest request, @PathVariable("id") Long id,
                                     @PathVariable("format") String format); }
ReportController { @RequestMapping(method = GET, value = "/reports/{id}") public Template getReportWithParameters(@PathVariable("id") Long id) { return templateService.getLWById(id); }  @RequestMapping(method = GET, value = "/reports/{id}") Template getReportWithParameters(@PathVariable("id") Long id); @RequestMapping(method = GET, value = "/reports/{id}/{format}") ModelAndView generateReport(HttpServletRequest request, @PathVariable("id") Long id,
                                     @PathVariable("format") String format); static final String USER_ID; }