@Test public void testInitFormData() throws Exception { String expected = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("txt/InitFormData.txt")); ROIForm form = gson.fromJson(expected, ROIForm.class); form.getReportInformation().setDate(new Date()); replayAll(); Object initFormData = roiServiceTest.get("init-form-data"); verifyAll(); assertEquals(gson.toJson(form), initFormData.toString()); }
private JSONObject initFormData() { ROIForm roiForm = new ROIForm(); ReportInformation reportInformation = new ReportInformation(); reportInformation.setDate(new Date()); roiForm.setReportInformation(reportInformation); JSONObject json = createResponse(roiForm); return json; }
ROIService extends FrevvoFormAbstractService { private JSONObject initFormData() { ROIForm roiForm = new ROIForm(); ReportInformation reportInformation = new ReportInformation(); reportInformation.setDate(new Date()); roiForm.setReportInformation(reportInformation); JSONObject json = createResponse(roiForm); return json; } }
ROIService extends FrevvoFormAbstractService { private JSONObject initFormData() { ROIForm roiForm = new ROIForm(); ReportInformation reportInformation = new ReportInformation(); reportInformation.setDate(new Date()); roiForm.setReportInformation(reportInformation); JSONObject json = createResponse(roiForm); return json; }  }
ROIService extends FrevvoFormAbstractService { private JSONObject initFormData() { ROIForm roiForm = new ROIForm(); ReportInformation reportInformation = new ReportInformation(); reportInformation.setDate(new Date()); roiForm.setReportInformation(reportInformation); JSONObject json = createResponse(roiForm); return json; }  @Override Object get(String action); @Override boolean save(String xml, MultiValueMap<String, MultipartFile> attachments); ApplicationEventPublisher getApplicationEventPublisher(); void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher); @Override String getFormName(); @Override Class<?> getFormClass(); ComplaintDao getComplaintDao(); void setComplaintDao(ComplaintDao complaintDao); CaseFileDao getCaseFileDao(); void setCaseFileDao(CaseFileDao caseFileDao); @Override Object convertToFrevvoForm(Object obj, Object form); }
ROIService extends FrevvoFormAbstractService { private JSONObject initFormData() { ROIForm roiForm = new ROIForm(); ReportInformation reportInformation = new ReportInformation(); reportInformation.setDate(new Date()); roiForm.setReportInformation(reportInformation); JSONObject json = createResponse(roiForm); return json; }  @Override Object get(String action); @Override boolean save(String xml, MultiValueMap<String, MultipartFile> attachments); ApplicationEventPublisher getApplicationEventPublisher(); void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher); @Override String getFormName(); @Override Class<?> getFormClass(); ComplaintDao getComplaintDao(); void setComplaintDao(ComplaintDao complaintDao); CaseFileDao getCaseFileDao(); void setCaseFileDao(CaseFileDao caseFileDao); @Override Object convertToFrevvoForm(Object obj, Object form);  }