diff --git a/annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/fluentvalidator/FluentElementValidatorTest.java b/annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/fluentvalidator/FluentElementValidatorTest.java index e71aadbd..f02207e1 100644 --- a/annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/fluentvalidator/FluentElementValidatorTest.java +++ b/annotationprocessor/src/test/java/io/toolisticon/annotationprocessortoolkit/tools/fluentvalidator/FluentElementValidatorTest.java @@ -1466,6 +1466,110 @@ protected void testCase(TypeElement element) { .build() + }, + { + "validate Exclusive Characteristics Element based validator - none of", + AnnotationProcessorUnitTestConfigurationBuilder.createTestConfig() + .compilationShouldFail() + .setProcessor(new AbstractUnitTestAnnotationProcessorClass() { + @Override + protected void testCase(TypeElement element) { + + MatcherAssert.assertThat( + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createElementBasedExclusiveCriteriaCoreMatcher(String.class, "SUCCESS", false, false)).hasNoneOf("XX", "YY").validateAndIssueMessages() + , Matchers.equalTo(true)); + + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createElementBasedExclusiveCriteriaCoreMatcher(String.class, "FAILURE", false, true)).hasNoneOf("XX", "YY").validateAndIssueMessages(); + + } + } + ) + .addMessageValidator() + .setErrorChecks("FAILURE") + .finishMessageValidator() + .build() + + + }, + { + "validate Exclusive Characteristics validator - none of", + AnnotationProcessorUnitTestConfigurationBuilder.createTestConfig() + .compilationShouldFail() + .setProcessor(new AbstractUnitTestAnnotationProcessorClass() { + @Override + protected void testCase(TypeElement element) { + + MatcherAssert.assertThat( + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createExclusiveCriteriaCoreMatcher(TypeElement.class, String.class, "SUCCESS", false, false)).hasNoneOf("XX", "YY").validateAndIssueMessages() + , Matchers.equalTo(true)); + + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createExclusiveCriteriaCoreMatcher(TypeElement.class, String.class, "FAILURE", false, true)).hasNoneOf("XX", "YY").validateAndIssueMessages(); + + } + } + ) + .addMessageValidator() + .setErrorChecks("FAILURE") + .finishMessageValidator() + .build() + + + }, + { + "validate Exclusive Characteristics Element based validator - one of", + AnnotationProcessorUnitTestConfigurationBuilder.createTestConfig() + .compilationShouldFail() + .setProcessor(new AbstractUnitTestAnnotationProcessorClass() { + @Override + protected void testCase(TypeElement element) { + + MatcherAssert.assertThat( + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createElementBasedExclusiveCriteriaCoreMatcher(String.class, "SUCCESS", false, true)).hasOneOf("XX", "YY").validateAndIssueMessages() + , Matchers.equalTo(true)); + + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createElementBasedExclusiveCriteriaCoreMatcher(String.class, "FAILURE", true, true)).hasOneOf("XX", "YY").validateAndIssueMessages(); + + } + } + ) + .addMessageValidator() + .setErrorChecks("FAILURE") + .finishMessageValidator() + .build() + + + }, + { + "validate Exclusive Characteristics validator - one of", + AnnotationProcessorUnitTestConfigurationBuilder.createTestConfig() + .compilationShouldFail() + .setProcessor(new AbstractUnitTestAnnotationProcessorClass() { + @Override + protected void testCase(TypeElement element) { + + MatcherAssert.assertThat( + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createExclusiveCriteriaCoreMatcher(TypeElement.class, String.class, "SUCCESS", false, true)).hasOneOf("XX", "YY").validateAndIssueMessages() + , Matchers.equalTo(true)); + + FluentElementValidator.createFluentElementValidator(element) + .error().applyValidator(TestCoreMatcherFactory.createExclusiveCriteriaCoreMatcher(TypeElement.class, String.class, "FAILURE", true, true)).hasOneOf("XX", "YY").validateAndIssueMessages(); + + } + } + ) + .addMessageValidator() + .setErrorChecks("FAILURE") + .finishMessageValidator() + .build() + + }, { "validate IS Element based validator",