diff --git a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/FastaStreamerTest.java b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/FastaStreamerTest.java index 614c6f06c8..6c93c912c1 100644 --- a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/FastaStreamerTest.java +++ b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/FastaStreamerTest.java @@ -5,6 +5,8 @@ import org.junit.Test; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; @@ -16,9 +18,9 @@ public class FastaStreamerTest { @Test - public void stream() throws IOException { - String file = this.getClass().getResource("PF00104_small.fasta.gz").getFile(); - Path path = Paths.get(file); + public void stream() throws IOException, URISyntaxException { + URI fileUri = this.getClass().getResource("PF00104_small.fasta.gz").toURI(); + Path path = Paths.get(fileUri); List sequences; sequences = FastaStreamer.from(path).stream().collect(Collectors.toList()); @@ -38,9 +40,9 @@ public void stream() throws IOException { } @Test - public void iterate() { - String file = this.getClass().getResource("PF00104_small.fasta.gz").getFile(); - Path path = Paths.get(file); + public void iterate() throws URISyntaxException { + URI fileUri = this.getClass().getResource("PF00104_small.fasta.gz").toURI(); + Path path = Paths.get(fileUri); int count = 0; for (ProteinSequence sequence : FastaStreamer.from(path).each()) { count++;