@Test public void testDisplayPageList() throws Exception { setUpMockAuditDataService(SITE_AUDIT_GENERAL_PAGE_LIST_ID); setUpMockUserDataService(); setUpActDataService(true); setUpMockAuthenticationContext(); MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter(AUDIT_ID_KEY, String.valueOf(SITE_AUDIT_GENERAL_PAGE_LIST_ID)); assertEquals(PAGE_LIST_VIEW_NAME, instance.displayPageList(request, new ExtendedModelMap())); }
@RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) public String displayPageList(HttpServletRequest request, Model model) throws Exception { String auditId = ServletRequestUtils.getStringParameter(request, AUDIT_ID_KEY); if (auditId == null) { throw new AuditParameterMissingException(); } Audit audit; try { audit = auditDataService.read(Long.valueOf(auditId)); } catch (NumberFormatException e) { throw new ForbiddenPageException(e); } if (isUserAllowedToDisplayResult(audit)) { return pageLinkDispatcher(request, audit, model); } else { return ACCESS_DENIED_VIEW_NAME; } }
PageListController extends AbstractAuditDataHandlerController { @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) public String displayPageList(HttpServletRequest request, Model model) throws Exception { String auditId = ServletRequestUtils.getStringParameter(request, AUDIT_ID_KEY); if (auditId == null) { throw new AuditParameterMissingException(); } Audit audit; try { audit = auditDataService.read(Long.valueOf(auditId)); } catch (NumberFormatException e) { throw new ForbiddenPageException(e); } if (isUserAllowedToDisplayResult(audit)) { return pageLinkDispatcher(request, audit, model); } else { return ACCESS_DENIED_VIEW_NAME; } } }
PageListController extends AbstractAuditDataHandlerController { @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) public String displayPageList(HttpServletRequest request, Model model) throws Exception { String auditId = ServletRequestUtils.getStringParameter(request, AUDIT_ID_KEY); if (auditId == null) { throw new AuditParameterMissingException(); } Audit audit; try { audit = auditDataService.read(Long.valueOf(auditId)); } catch (NumberFormatException e) { throw new ForbiddenPageException(e); } if (isUserAllowedToDisplayResult(audit)) { return pageLinkDispatcher(request, audit, model); } else { return ACCESS_DENIED_VIEW_NAME; } } PageListController(TestDataService testDataService,
                              StatisticsDataService statisticsDataService,
                              TgolPaginatedListFactory tgolPaginatedListFactory); }
PageListController extends AbstractAuditDataHandlerController { @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) public String displayPageList(HttpServletRequest request, Model model) throws Exception { String auditId = ServletRequestUtils.getStringParameter(request, AUDIT_ID_KEY); if (auditId == null) { throw new AuditParameterMissingException(); } Audit audit; try { audit = auditDataService.read(Long.valueOf(auditId)); } catch (NumberFormatException e) { throw new ForbiddenPageException(e); } if (isUserAllowedToDisplayResult(audit)) { return pageLinkDispatcher(request, audit, model); } else { return ACCESS_DENIED_VIEW_NAME; } } PageListController(TestDataService testDataService,
                              StatisticsDataService statisticsDataService,
                              TgolPaginatedListFactory tgolPaginatedListFactory); @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) String displayPageList(HttpServletRequest request, Model model); }
PageListController extends AbstractAuditDataHandlerController { @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) public String displayPageList(HttpServletRequest request, Model model) throws Exception { String auditId = ServletRequestUtils.getStringParameter(request, AUDIT_ID_KEY); if (auditId == null) { throw new AuditParameterMissingException(); } Audit audit; try { audit = auditDataService.read(Long.valueOf(auditId)); } catch (NumberFormatException e) { throw new ForbiddenPageException(e); } if (isUserAllowedToDisplayResult(audit)) { return pageLinkDispatcher(request, audit, model); } else { return ACCESS_DENIED_VIEW_NAME; } } PageListController(TestDataService testDataService,
                              StatisticsDataService statisticsDataService,
                              TgolPaginatedListFactory tgolPaginatedListFactory); @RequestMapping(value = PAGE_LIST_CONTRACT_URL, method = RequestMethod.GET) @Secured({ROLE_USER_KEY, ROLE_ADMIN_KEY}) String displayPageList(HttpServletRequest request, Model model);  }