Search in sources :

Example 1 with ContentTypeValidationResult

use of com.enonic.xp.schema.content.validator.ContentTypeValidationResult in project xp by enonic.

the class SuperTypeValidatorTest method validationResult.

@Test
public void validationResult() {
    ContentTypeValidationResult validationResult1 = ContentTypeValidationResult.from(new ContentTypeValidationError("superType not found: superTypeName", ContentTypeName.media()));
    ContentTypeValidationResult validationResult2 = ContentTypeValidationResult.from(Collections.singleton(new ContentTypeValidationError("superType not found: superTypeName", ContentTypeName.media())));
    ContentTypeValidationResult validationResult3 = ContentTypeValidationResult.empty();
    assertNotEquals(validationResult1, validationResult2);
    assertNotEquals(validationResult1.hashCode(), validationResult2.hashCode());
    assertFalse(validationResult3.hasErrors());
    assertNotEquals(validationResult2.hashCode(), validationResult3.hashCode());
    assertNotEquals(validationResult2.toString(), validationResult3.toString());
}
Also used : ContentTypeValidationResult(com.enonic.xp.schema.content.validator.ContentTypeValidationResult) ContentTypeValidationError(com.enonic.xp.schema.content.validator.ContentTypeValidationError) Test(org.junit.jupiter.api.Test)

Aggregations

ContentTypeValidationError (com.enonic.xp.schema.content.validator.ContentTypeValidationError)1 ContentTypeValidationResult (com.enonic.xp.schema.content.validator.ContentTypeValidationResult)1 Test (org.junit.jupiter.api.Test)1