diff --git a/sparql-anything-parser/src/test/java/com/github/sparqlanything/parser/test/FacadeIRIParserTest.java b/sparql-anything-parser/src/test/java/com/github/sparqlanything/parser/test/FacadeIRIParserTest.java index 6750e9f5..d46cb548 100644 --- a/sparql-anything-parser/src/test/java/com/github/sparqlanything/parser/test/FacadeIRIParserTest.java +++ b/sparql-anything-parser/src/test/java/com/github/sparqlanything/parser/test/FacadeIRIParserTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStreamReader; +import java.util.Objects; import java.util.Properties; public class FacadeIRIParserTest { @@ -108,11 +109,11 @@ public void specialCharsArgs() { @Test public void specialCharsArgsFromFile() throws IOException { - String uri = IOUtils - .toString(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("./exampleIRI.txt"))); + String uri = IOUtils.toString(new InputStreamReader(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("./exampleIRI.txt")))); + String expected = IOUtils.toString(new InputStreamReader(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("./expected.txt")))); Properties p = new FacadeIRIParser(uri).getProperties(); - Assert.assertEquals(p.get("location"), "https://myfile.json?fo,o=bar&tab=goal#hack"); - Assert.assertEquals(p.get("same"), "汉字"); + Assert.assertEquals("https://myfile.json?fo,o=bar&tab=goal#hack", p.get("location")); + Assert.assertEquals(expected, p.get("same" )); } @Test diff --git a/sparql-anything-parser/src/test/resources/expected.txt b/sparql-anything-parser/src/test/resources/expected.txt new file mode 100644 index 00000000..9c116aba --- /dev/null +++ b/sparql-anything-parser/src/test/resources/expected.txt @@ -0,0 +1 @@ +汉字 \ No newline at end of file