ReportingService { public void renderReport(boolean removeFrame) { try { JasperPrint jasperPrint = generateReport(removeFrame); log.info("BEGIN: Export report"); switch (reportType) { case HTML: JasperExportManager.exportReportToHtmlFile(jasperPrint, outputReportLocation); break; case PDF: JasperExportManager.exportReportToPdfStream(jasperPrint, Files.newOutputStream(Paths.get(outputReportLocation))); break; default: throw new ConfigurationException("ReportType is not specified"); } if (doGenerateXmlReport) { XMLReporter.create(context, sessionId).generateReport(); } log.info("END: Export report"); } catch (JRException | IOException e) { log.error("Error during report rendering", e); throw new TechnicalException(e); } }  JasperPrint generateReport(boolean removeFrame); void renderReport(boolean removeFrame); void setContext(ReportingContext context); void setRootTemplateLocation(String rootTemplateLocation); void setReportType(ReportType reportType); void setOutputReportLocation(String outputReportLocation); boolean isDoGenerateXmlReport(); void setDoGenerateXmlReport(boolean doGenerateXmlReport); ReportingContext getContext(); String getRootTemplateLocation(); ReportType getReportType(); String getOutputReportLocation(); String getSessionId(); void setSessionId(String sessionId);  }
@Test(enabled = false) public void testReportingService() throws IOException, SAXException { ApplicationContext context = new ClassPathXmlApplicationContext("spring/test-reporting.xml"); ReportingService reportingService = (ReportingService) context.getBean("reportingService"); reportingService.renderReport(true); checkXML(); }