@Test public void shouldGetAllReportTemplates() throws Exception { List<Template> expected = new ArrayList<>(); when(templateService.getAllTemplatesForUser(USER)).thenReturn(expected); assertThat(controller.getAllTemplatesForUser(request), is(expected)); }
@RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") public List<Template> getAllTemplatesForUser(HttpServletRequest request) { return templateService.getAllTemplatesForUser(loggedInUserId(request)); }
TemplateController extends BaseController { @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") public List<Template> getAllTemplatesForUser(HttpServletRequest request) { return templateService.getAllTemplatesForUser(loggedInUserId(request)); } }
TemplateController extends BaseController { @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") public List<Template> getAllTemplatesForUser(HttpServletRequest request) { return templateService.getAllTemplatesForUser(loggedInUserId(request)); }  }
TemplateController extends BaseController { @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") public List<Template> getAllTemplatesForUser(HttpServletRequest request) { return templateService.getAllTemplatesForUser(loggedInUserId(request)); }  @RequestMapping(value = "/report-templates", method = POST) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_REPORT')") ResponseEntity<OpenLmisResponse> createJasperReportTemplate(HttpServletRequest request, MultipartFile file, String name, String description); @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") List<Template> getAllTemplatesForUser(HttpServletRequest request); }
TemplateController extends BaseController { @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") public List<Template> getAllTemplatesForUser(HttpServletRequest request) { return templateService.getAllTemplatesForUser(loggedInUserId(request)); }  @RequestMapping(value = "/report-templates", method = POST) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_REPORT')") ResponseEntity<OpenLmisResponse> createJasperReportTemplate(HttpServletRequest request, MultipartFile file, String name, String description); @RequestMapping(value = "/report-templates", method = GET) @PreAuthorize("@permissionEvaluator.hasReportingPermission(principal)") List<Template> getAllTemplatesForUser(HttpServletRequest request); static final String JASPER_CREATE_REPORT_SUCCESS; static final String JASPER_CREATE_REPORT_ERROR; static final String CONSISTENCY_REPORT; }