BioentityPropertiesSource { Stream<ArrayDesignMappingFile> getArrayDesignMappingFiles() { return getBioentityPropertyFiles( arrayDesignsDirPath, ARRAY_DESIGN_FILE_NAME_PATTERN, ArrayDesignMappingFile::new); } BioentityPropertiesSource(Path annotationsDirPath,
                                     Path arrayDesignsDirPath,
                                     Path reactomeDirPath,
                                     SpeciesFactory speciesFactory);   }
@Test public void arrayDesignsHaveNoHeader() throws Exception { addTemporaryFile( "array_designs", "Homo_sapiens.A-AFFY-1.tsv", ImmutableList.of(new String[]{"ENSG00000000003", "39361_f_at"})); assertThat( subject.getArrayDesignMappingFiles() .flatMap(BioentityPropertiesSource.ArrayDesignMappingFile::get) .collect(toList()), containsInAnyOrder( new BioentityProperty("ENSG00000000003", "Homo_sapiens", DESIGN_ELEMENT.name, "39361_f_at"))); }
@Test public void arrayDesignsCanHaveEmptyProperties() throws Exception { addTemporaryFile( "array_designs", "Homo_sapiens.A-AFFY-1.tsv", ImmutableList.of(new String[]{"ENSG00000000003", ""})); assertThat( subject.getArrayDesignMappingFiles() .flatMap(BioentityPropertiesSource.ArrayDesignMappingFile::get) .collect(toList()), is(empty())); }
@Test public void arrayDesignsCanComeFromDifferentFiles() throws Exception { addTemporaryFile( "array_designs", "Homo_sapiens.A-AFFY-1.tsv", ImmutableList.of(new String[]{"ENSG00000000003", "39361_f_at"})); addTemporaryFile( "array_designs", "Homo_sapiens.A-AFFY-2.tsv", ImmutableList.of(new String[]{"ENSG00000000003", "something_different_at"})); assertThat( subject.getArrayDesignMappingFiles() .flatMap(BioentityPropertiesSource.ArrayDesignMappingFile::get) .collect(toList()), containsInAnyOrder( new BioentityProperty( "ENSG00000000003", "Homo_sapiens", DESIGN_ELEMENT.name, "39361_f_at"), new BioentityProperty( "ENSG00000000003", "Homo_sapiens", DESIGN_ELEMENT.name, "something_different_at"))); }