@Test
public void testExistenceOfPrimaryNodeTypes() throws IOException, ConfigurationException, RepositoryException, ParseException {

    validator = createValidator(filter, NodeType.NT_UNSTRUCTURED);
    Map<String, DocViewProperty> props = new HashMap<>();
    props.put("{}prop1", new DocViewProperty("{}prop1", new String[] { "value1" }, false, PropertyType.STRING));
    // order node only (no other property)
    DocViewNode node = new DocViewNode("jcr:root", "jcr:root", null, Collections.emptyMap(), null, null);
    Assert.assertThat(validator.validate(node, new NodeContextImpl("/apps/test", Paths.get("/some/path"), Paths.get("")), false),
            AnyValidationMessageMatcher.noValidationInCollection());
    // missing node type but not contained in filter (with properties)
    node = new DocViewNode("jcr:root", "jcr:root", null, props, null, null);
    Assert.assertThat(
            validator.validate(node, new NodeContextImpl("/apps/test2/invalid", Paths.get("/some/path"), Paths.get("")), false),
            AnyValidationMessageMatcher.noValidationInCollection());
    // missing node type and contained in filter (with properties)
    ValidationExecutorTest.assertViolation(
            validator.validate(node, new NodeContextImpl("/apps/test", Paths.get("/some/path"), Paths.get("")), false),
            new ValidationMessage(ValidationMessageSeverity.ERROR,
                    String.format(NodeTypeValidator.MESSAGE_MISSING_PRIMARY_TYPE, "/apps/test")));
    // primary node type set with additional properties
    props.put(NameConstants.JCR_PRIMARYTYPE.toString(), new DocViewProperty(NameConstants.JCR_PRIMARYTYPE.toString(),
            new String[] { "nt:unstructured" }, false, PropertyType.STRING));
    node = new DocViewNode("jcr:root", "jcr:root", null, props, null, "nt:unstructured");
    Assert.assertThat(validator.validate(node, new NodeContextImpl("/apps/test", Paths.get("/some/path"), Paths.get("")), false),
            AnyValidationMessageMatcher.noValidationInCollection());
}