@Test public void testCaseConstraintInvoked() { ProcessorResult processorResult = processRaw(noStateAddress, "country", countryIsUSACaseConstraint); List<Constraint> constraints = processorResult.getConstraints(); Assert.assertNotNull(constraints); Assert.assertEquals(1, constraints.size()); Constraint constraint = constraints.get(0); Assert.assertTrue(constraint instanceof PrerequisiteConstraint); PrerequisiteConstraint prerequisiteConstraint = (PrerequisiteConstraint)constraint; Assert.assertEquals("state", prerequisiteConstraint.getPropertyName()); ConstraintValidationResult result = processorResult.getFirstConstraintValidationResult(); Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings()); Assert.assertEquals(0, dictionaryValidationResult.getNumberOfErrors()); Assert.assertEquals(ErrorLevel.OK, result.getStatus()); Assert.assertEquals(new CaseConstraintProcessor().getName(), result.getConstraintName()); }
@Override public String getName() { return CONSTRAINT_NAME; }
CaseConstraintProcessor extends MandatoryElementConstraintProcessor<CaseConstraint> { @Override public String getName() { return CONSTRAINT_NAME; } }
CaseConstraintProcessor extends MandatoryElementConstraintProcessor<CaseConstraint> { @Override public String getName() { return CONSTRAINT_NAME; }  }
CaseConstraintProcessor extends MandatoryElementConstraintProcessor<CaseConstraint> { @Override public String getName() { return CONSTRAINT_NAME; }  @Override ProcessorResult process(DictionaryValidationResult result, Object value, CaseConstraint caseConstraint,
            AttributeValueReader attributeValueReader); @Override String getName(); @Override Class<? extends Constraint> getConstraintType(); }
CaseConstraintProcessor extends MandatoryElementConstraintProcessor<CaseConstraint> { @Override public String getName() { return CONSTRAINT_NAME; }  @Override ProcessorResult process(DictionaryValidationResult result, Object value, CaseConstraint caseConstraint,
            AttributeValueReader attributeValueReader); @Override String getName(); @Override Class<? extends Constraint> getConstraintType();  }