EntsoeCaseRepository implements CaseRepository { @Override public List<Network> load(DateTime date, CaseType type, Country country) { Objects.requireNonNull(date); Objects.requireNonNull(type); List<Network> networks2 = scanRepository(toCetDate(date), type, country, importContexts -> { List<Network> networks = null; if (importContexts.size() > 0) { networks = new ArrayList<>(); for (ImportContext importContext : importContexts) { LOGGER.info("Loading {} in {} format", importContext.ds.getBaseName(), importContext.importer.getFormat()); networks.add(importContext.importer.importData(importContext.ds, null)); } } return networks; }); return networks2 == null ? Collections.emptyList() : networks2; } EntsoeCaseRepository(EntsoeCaseRepositoryConfig config, List<EntsoeFormat> formats, ReadOnlyDataSourceFactory dataSourceFactory);   EntsoeCaseRepository(EntsoeCaseRepositoryConfig config, ComputationManager computationManager); static CaseRepository create(ComputationManager computationManager); EntsoeCaseRepositoryConfig getConfig(); @Override List<Network> load(DateTime date, CaseType type, Country country); @Override boolean isDataAvailable(DateTime date, CaseType type, Country country); @Override Set<DateTime> dataAvailable(CaseType type, Set<Country> countries, Interval interval);  }
@Test public void testLoad() throws Exception { assertTrue(caseRepository.load(DateTime.parse("2013-01-13T00:15:00+01:00"), CaseType.SN, Country.FR).size() == 1); assertTrue(caseRepository.load(DateTime.parse("2013-01-13T00:30:00+01:00"), CaseType.SN, Country.FR).isEmpty()); assertTrue(caseRepository.load(DateTime.parse("2013-01-13T00:15:00+01:00"), CaseType.FO, Country.FR).isEmpty()); assertTrue(caseRepository.load(DateTime.parse("2013-01-13T00:15:00+01:00"), CaseType.SN, Country.BE).isEmpty()); assertEquals(Collections.singletonList(cimNetwork), caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR)); caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "CIM1"); assertEquals(Collections.singletonList(uctNetwork), caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR)); assertEquals(4, caseRepository.load(DateTime.parse("2013-01-15T00:15:00+01:00"), CaseType.SN, Country.DE).size()); }