JaxbReportSpecDao implements ReportSpecDao { @Override public ReportSpec readReportSpec(final Path file) { try (final Reader reader = Files.newBufferedReader(file, UTF_8)) { Unmarshaller unmarshaller = context.createUnmarshaller(); return (ReportSpec) unmarshaller.unmarshal(reader); } catch (final JAXBException e) { log.error(e.getErrorCode(), e); return null; } catch (final IOException e) { log.error(e.getMessage(), e); throw new RuntimeException(e); } } JaxbReportSpecDao(); @Override ReportSpec readReportSpec(final Path file);  }
@Test public void testReportLoad() throws JAXBException { JaxbReportSpecDao dao = new JaxbReportSpecDao(); ReportSpec reportSpec = dao.readReportSpec(Paths.get("src/main/resources/File count and sizes by file format PUID.xml")); assertEquals(1, reportSpec.getItems().get(0).getFilter().getFilterCriteriaMap().size()); }