@Test
public void testRootNodesInFilterPartlyContainedInDependencies() throws IOException, ConfigurationException {

    DefaultWorkspaceFilter dependencyFilter = new DefaultWorkspaceFilter();
    try (InputStream input = this.getClass().getResourceAsStream("/dependency1-filter.xml")) {
        dependencyFilter.load(input);
    }
    
    DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
    try (InputStream input = this.getClass().getResourceAsStream("/filter-with-uncovered-roots.xml")) {
        filter.load(input);
    }
    validRoots.add("/customroot");
    dependenciesMetaInfo.add(new DefaultPackageInfo(PackageId.fromString("group:dependency1"), dependencyFilter, PackageType.APPLICATION));
    validator = new AdvancedFilterValidator(
            factory,
            ValidationMessageSeverity.ERROR,
            ValidationMessageSeverity.ERROR,
            ValidationMessageSeverity.ERROR,
            ValidationMessageSeverity.ERROR,
            false,
            dependenciesMetaInfo,
            filter, // this is per test
            validRoots);
    Collection<ValidationMessage> messages = validator.validate(filter);
    ValidationExecutorTest.assertViolation(messages, ValidationMessageSeverity.INFO,
            new ValidationMessage(ValidationMessageSeverity.ERROR,
                    String.format(AdvancedFilterValidator.MESSAGE_FILTER_ROOT_ANCESTOR_UNCOVERED, "/apps/uncovered")),
            new ValidationMessage(ValidationMessageSeverity.ERROR,
                    String.format(AdvancedFilterValidator.MESSAGE_FILTER_ROOT_ANCESTOR_COVERED_BUT_EXCLUDED, "/apps/covered2/excluded", "group:dependency1")),
            new ValidationMessage(ValidationMessageSeverity.ERROR,
                    String.format(AdvancedFilterValidator.MESSAGE_FILTER_ROOT_ANCESTOR_UNCOVERED, "/invalidroot")));
}