@SpecAssertions({
@SpecAssertion(section = "6.2", id = "g"),
@SpecAssertion(section = "6.7", id = "c")
})
public void testFindConstraintsForMethodDefinedOnSuperTypeLookingAt() {
CrossParameterDescriptor descriptor = Executables.crossParameterConstrainedMethodFromSuperType()
.getCrossParameterDescriptor();
Set<ConstraintDescriptor<?>> constraints = descriptor.findConstraints()
.lookingAt( Scope.LOCAL_ELEMENT )
.getConstraintDescriptors();
assertEquals(
constraints.size(),
0,
"Should have no local constraints"
);
constraints = descriptor.findConstraints()
.lookingAt( Scope.HIERARCHY )
.getConstraintDescriptors();
assertEquals( constraints.size(), 1, "Should have constraints" );
ConstraintDescriptor<?> constraint = constraints.iterator().next();