Skip to content

Commit

Permalink
enhance yaml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fslev committed Sep 19, 2022
1 parent 1ab7047 commit 97c948a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/io/jtest/utils/common/ResourceReadTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ public void testReadFromYamlFile() throws IOException {
assertEquals(expected, ResourceUtils.readYaml("yaml/config.yaml"));
}

@Test
public void testReadFromInvalidYamlFile() {
assertThrows(ClassCastException.class, () -> ResourceUtils.readYaml("foobar/file1.txt"));
}

@Test
public void testReadFromMissingYamlFile() {
assertThrows(IOException.class, () -> ResourceUtils.readYaml("i/do/not/exist"));
}

@Test
public void testReadFromEmptyYamlFile() throws IOException {
assertNull(ResourceUtils.readYaml("yaml/empty.yaml"));
}

@Test
public void testGetFileName() throws IOException, URISyntaxException {
assertEquals("config.yaml", ResourceUtils.getFileName("yaml/config.yaml"));
Expand Down
Empty file.

0 comments on commit 97c948a

Please sign in to comment.