CompanyOperatingReportParser implements Callable<CompanyOperatingReports> { @Override public CompanyOperatingReports call() throws Exception { final CompanyOperatingReports reports = new CompanyOperatingReports(); final FlatFileItemReader<CompanyOperatingReports> items = CompanyOperatingReportParserMapper.newItemReader( cirReportCsv, reports); try { items.open(new ExecutionContext()); CompanyOperatingReports item = null; do { item = items.read(); } while (item != null); } finally { items.close(); } return reports; } CompanyOperatingReportParser(final Resource cirReportCsv); @Override CompanyOperatingReports call();  }
@Test public void testParse() throws Exception { final CompanyOperatingReportParser parser = new CompanyOperatingReportParser( new ClassPathResource("/" + getClass().getPackage().getName().replace(".", "/") + "/COR_Y19.csv")); final CompanyOperatingReports reports = parser.call(); Assertions.assertThat(reports.getAdminExpenses().getGeneralAdministrativeExpenses()).isNotNull(); }