GenomeDataResolver { public Path resolveAbsoluteResourcePath(String fileResource) { return resolveAbsoluteResourcePath(Paths.get(fileResource)); } GenomeDataResolver(GenomeProperties genomeProperties, Path exomiserDataDirectory); String getVersionAssemblyPrefix(); Path getGenomeAssemblyDataPath(); Path resolveAbsoluteResourcePath(String fileResource); Path resolveAbsoluteResourcePath(Path fileResourcePath);  }
@Test public void testResolveAbsoluteResourcePathFromRelativePath() { GenomeProperties genomeProperties = new Hg19GenomeProperties(); genomeProperties.setDataVersion("1710"); genomeProperties.setDataDirectory("src/test/resources/data"); GenomeDataResolver instance = new GenomeDataResolver(genomeProperties, exomiserDataDirectory); Path relativeFilePath = Paths.get("genome.h2.db"); assertThat(instance.resolveAbsoluteResourcePath(relativeFilePath), equalTo(Paths.get("src/test/resources/data/genome.h2.db") .toAbsolutePath())); }
@Test public void testResolveAbsoluteResourcePathFromAbsolutePath() { GenomeProperties genomeProperties = new Hg19GenomeProperties(); genomeProperties.setDataVersion("1710"); genomeProperties.setDataDirectory("src/test/resources/data"); GenomeDataResolver instance = new GenomeDataResolver(genomeProperties, exomiserDataDirectory); Path absoluteFilePath = Paths.get("src/test/resources/user-defined/genome.h2.db").toAbsolutePath(); assertThat(instance.resolveAbsoluteResourcePath(absoluteFilePath), equalTo(Paths.get("src/test/resources/user-defined/genome.h2.db") .toAbsolutePath())); }
@Test public void testResolveAbsoluteResourcePathFromString() { GenomeProperties genomeProperties = new Hg19GenomeProperties(); genomeProperties.setDataVersion("1710"); genomeProperties.setDataDirectory("src/test/resources/user-defined"); GenomeDataResolver instance = new GenomeDataResolver(genomeProperties, exomiserDataDirectory); assertThat(instance.resolveAbsoluteResourcePath("genome.h2.db"), equalTo(Paths.get("src/test/resources/user-defined/genome.h2.db") .toAbsolutePath())); }