use of org.mifos.reports.admindocuments.business.AdminDocumentBO in project head by mifos.
the class BirtAdminDocumentUploadActionStrutsTest method testShouldSubmitSucessWhenUploadNewAdminDocument.
@Test
public void testShouldSubmitSucessWhenUploadNewAdminDocument() throws Exception {
setRequestPathInfo("/birtAdminDocumentUploadAction.do");
BirtAdminDocumentUploadActionForm form = new BirtAdminDocumentUploadActionForm();
form.setAdminiDocumentTitle("testShouldSubmitSucessWhenUploadNewAdminDocumentWithAVeryLongNameThatExceedsOneHundredCharactersInLength");
form.setIsActive("1");
form.setFile(new MockFormFile("testFileName1.rptdesign"));
setActionForm(form);
addRequestParameter("method", "upload");
actionPerform();
AdminDocumentBO adminDocument = (AdminDocumentBO) request.getAttribute(Constants.BUSINESS_KEY);
Assert.assertNotNull(adminDocument);
ReportsPersistence rp = new ReportsPersistence();
ReportsJasperMap jasper = rp.getPersistentObject(ReportsJasperMap.class, adminDocument.getAdmindocId());
Assert.assertNotNull(jasper);
verifyNoActionErrors();
verifyForward("create_success");
removeReport(adminDocument.getAdmindocId());
}
Aggregations