FootwearIndustryReportParser implements Callable<FootwearIndustryReports> { @Override public FootwearIndustryReports call() throws Exception { final FootwearIndustryReports reports = new FootwearIndustryReports(); final FlatFileItemReader<FootwearIndustryReports> items = FootwearIndustryReportParserMapper.newItemReader( firReportCsv, reports); try { items.open(new ExecutionContext()); FootwearIndustryReports item = null; do { item = items.read(); } while (item != null); } finally { items.close(); } return reports; } FootwearIndustryReportParser(final Resource firReportCsv); @Override FootwearIndustryReports call();  }
@Test public void testParse() throws Exception { final FootwearIndustryReportParser parser = new FootwearIndustryReportParser( new ClassPathResource("/" + getClass().getPackage().getName().replace(".", "/") + "/FIR_Y19.csv")); final FootwearIndustryReports reports = parser.call(); Assertions.assertThat(reports.getAvg().isHasValues()).isTrue(); Assertions.assertThat(reports.getForCompany(CompanyLetter.A).isHasValues()).isTrue(); Assertions.assertThat(reports.getForCompany(CompanyLetter.L).isHasValues()).isFalse(); }