@VisibleForTesting
    static EntryFilterDefinition getEntryFilterDefinition(NarClassLoader ncl) throws IOException {
        String configStr;

        try {
            configStr = ncl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yaml");
        } catch (NoSuchFileException e) {
            configStr = ncl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yml");
        }

        return ObjectMapperFactory.getYamlMapper().reader().readValue(
                configStr, EntryFilterDefinition.class
        );
    }
@Test
    public void testReadYamlFile() throws IOException {
        try (NarClassLoader cl = mock(NarClassLoader.class)) {
            when(cl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yaml"))
                    .thenThrow(new NoSuchFileException(""));
            try {
                EntryFilterProvider.getEntryFilterDefinition(cl);
                Assert.fail();
            } catch (Exception e) {
                Assert.assertFalse(e instanceof NoSuchFileException);
            }
        }
        try (NarClassLoader cl = mock(NarClassLoader.class)) {
            when(cl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yml"))
                    .thenThrow(new NoSuchFileException(""));
            try {
                EntryFilterProvider.getEntryFilterDefinition(cl);
                Assert.fail();
            } catch (Exception e) {
                Assert.assertFalse(e instanceof NoSuchFileException);
            }
        }
        try (NarClassLoader cl = mock(NarClassLoader.class)) {
            when(cl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yaml"))
                    .thenThrow(new NoSuchFileException(""));
            when(cl.getServiceDefinition(ENTRY_FILTER_DEFINITION_FILE + ".yml"))
                    .thenThrow(new NoSuchFileException(""));
            try {
                EntryFilterProvider.getEntryFilterDefinition(cl);
                Assert.fail();
            } catch (Exception e) {
                Assert.assertTrue(e instanceof NoSuchFileException);
            }
        }
    }