@Test
@TestForIssue(jiraKey = "HV-626")
public void onlyLocallyDefinedConstraintsAreConsidered() {
List<BeanConfiguration<? super Person>> beanConfigurations = provider.getBeanConfigurationForHierarchy( Person.class );
ConstrainedType personType = findConstrainedType( beanConfigurations, Person.class );
assertThat( personType.getConstraints() ).hasSize( 1 );
ConstraintDescriptor<?> constraintInSubType = personType.getConstraints()
.iterator()
.next()
.getDescriptor();
assertThat( constraintInSubType.getAnnotation().annotationType() ).isEqualTo( ScriptAssert.class );
ConstrainedType personBaseType = findConstrainedType( beanConfigurations, PersonBase.class );
assertThat( personBaseType.getConstraints() ).hasSize( 1 );
ConstraintDescriptor<?> constraintInSuperType = personBaseType.getConstraints()
.iterator()
.next()
.getDescriptor();
assertThat( constraintInSuperType.getAnnotation().annotationType() ).isEqualTo( ClassLevelConstraint.class );
}