ReportViewFactory { public static final JasperReportsMultiFormatView newJasperReportsMultiFormatView( ReportProps reportProps) { final JasperReportsMultiFormatView view = new JasperReportsMultiFormatView(); view.setUrl(reportProps.getTemplateUrl()); view.setReportDataKey(reportProps.getDatasourceKey()); return view; } private  ReportViewFactory(); static final JasperReportsMultiFormatView newJasperReportsMultiFormatView(
			ReportProps reportProps);  }
@Test public void testNewJasperReportsMultiFormatView() { final String name = "name"; final String templateLocationValue = "templateLocation"; final String templateUrl = templateLocationValue + name + ReportProps.REPORT_TEMPLATE_FORMAT; final Optional<String> templateLocation = Optional .of(templateLocationValue); final String datasourceKeyValue = "datasourceKey"; final Optional<String> datasourceKey = Optional.of(datasourceKeyValue); final Map<String, String> imageMappingValue = new HashMap<>(); final String key = "key"; final String value = "value"; imageMappingValue.put(key, value); final Optional<Map<String, String>> imageMapping = Optional .of(imageMappingValue); final String baseClasspathSqlScriptResourcesValue = "baseClasspathSqlScriptResourcesValue"; final Optional<String> baseClasspathSqlScriptResources = Optional .of(baseClasspathSqlScriptResourcesValue); final String sqlScriptFileNameValue = "sqlScriptFileNameValue"; final Optional<String> sqlScriptFileName = Optional .of(sqlScriptFileNameValue); final ReportProps reportProps = new ReportProps(name, templateLocation, datasourceKey, imageMapping, baseClasspathSqlScriptResources, sqlScriptFileName); final JasperReportsMultiFormatView view = ReportViewFactory .newJasperReportsMultiFormatView(reportProps); assertNotNull(view); assertEquals(templateUrl, view.getUrl()); assertEquals(datasourceKeyValue, ReflectionTestUtils.getField(view, "reportDataKey")); }