LimsFactory { @NotNull public static Lims fromLimsDirectory(@NotNull String limsDirectory) throws IOException { String limsJsonPath = limsDirectory + File.separator + LIMS_JSON_FILE; Map<String, LimsJsonSampleData> dataPerSampleBarcode = readLimsJsonSamples(limsJsonPath); Map<String, LimsJsonSubmissionData> dataPerSubmission = readLimsJsonSubmissions(limsJsonPath); Map<String, LimsShallowSeqData> shallowSeqPerSampleBarcode = readLimsShallowSeqTsv(limsDirectory + File.separator + LIMS_SHALLOW_SEQ_TSV); Map<String, LocalDate> preLimsArrivalDates = readPreLimsArrivalDateTsv(limsDirectory + File.separator + PRE_LIMS_ARRIVAL_DATES_TSV); Set<String> sampleIdsWithoutSamplingDate = readSingleColumnTsv(limsDirectory + File.separator + SAMPLES_WITHOUT_SAMPLING_DATE_TSV); Set<String> blacklistedPatients = readSingleColumnTsv(limsDirectory + File.separator + PATIENT_BLACKLIST_TSV); HospitalModel hospitalModel = HospitalModelFactory.fromLimsDirectory(limsDirectory); return new Lims(dataPerSampleBarcode, dataPerSubmission, shallowSeqPerSampleBarcode, preLimsArrivalDates, sampleIdsWithoutSamplingDate, blacklistedPatients, hospitalModel); } private  LimsFactory(); @NotNull static Lims fromLimsDirectory(@NotNull String limsDirectory); @NotNull static Lims empty();  }
@Test public void canBuildLimsFromTestData() throws IOException { assertNotNull(LimsFactory.fromLimsDirectory(LIMS_DIRECTORY)); }
@Test(expected = IOException.class) public void exceptionWhenJsonFileDoesNotExist() throws IOException { LimsFactory.fromLimsDirectory("Does not exist"); }