@Test public void submit() { FormTester formTester = tester.newFormTester( "printSelectionFrame:printSelectionFrame_body:blueBorder:blueBorder_body:selectionForm:criteriaForm"); formTester.selectMultiple("billableProjectGroup", new int[] {0, 2}); formTester.setValue("signOff", "true"); formTester.submit("store"); tester.assertNoErrorMessage(); assertEquals( Boolean.TRUE, reportCriteria .getUserSelectedCriteria() .getCustomParameters() .get(TimesheetExportParameter.INCL_SIGN_OFF.name())); assertEquals(2, reportCriteria.getUserSelectedCriteria().getProjects().size()); Integer id = reportCriteria.getUserSelectedCriteria().getProjects().get(1).getProjectId(); // order is unknown if (id != 0 && id != 2) { fail("id should be 0 or 2"); } verifyMocks(); }
/* (non-Javadoc) * @see net.rrm.ehour.persistence.persistence.ui.common.report.AbstractReportModel#getReportData(net.rrm.ehour.persistence.persistence.report.criteria.ReportCriteria) */ @Override protected ReportData getReportData(ReportCriteria reportCriteria) { WebUtils.springInjection(this); UserSelectedCriteria userSelectedCriteria = reportCriteria.getUserSelectedCriteria(); List<Audit> audit = auditService.findAudits((AuditReportRequest) userSelectedCriteria); return new ReportData(convert(audit), reportCriteria.getReportRange(), userSelectedCriteria); }