use of jakarta.validation.metadata.ReturnValueDescriptor in project hibernate-validator by hibernate.
the class ReturnValueDescriptorTest method testIsCascaded.
@Test
public void testIsCascaded() {
ReturnValueDescriptor elementDescriptor = getMethodReturnValueDescriptor(CustomerRepository.class, "foo");
assertTrue(elementDescriptor.isCascaded());
}
use of jakarta.validation.metadata.ReturnValueDescriptor in project hibernate-validator by hibernate.
the class ReturnValueDescriptorTest method testHasConstraintsConsidersConstraintsFromSuperType.
@Test
public void testHasConstraintsConsidersConstraintsFromSuperType() {
ReturnValueDescriptor constrainedReturnDescriptor = getMethodReturnValueDescriptor(CustomerRepositoryExt.class, "bar");
assertTrue(constrainedReturnDescriptor.hasConstraints());
}
use of jakarta.validation.metadata.ReturnValueDescriptor in project hibernate-validator by hibernate.
the class ReturnValueDescriptorTest method testFindConstraintMatchingGroups.
@Test
public void testFindConstraintMatchingGroups() {
ReturnValueDescriptor returnValueDescriptor = getMethodReturnValueDescriptor(CustomerRepositoryExt.class, "baz");
assertConstraintTypes(returnValueDescriptor.findConstraints().unorderedAndMatchingGroups(ValidationGroup.class).getConstraintDescriptors(), NotNull.class);
}
use of jakarta.validation.metadata.ReturnValueDescriptor in project hibernate-validator by hibernate.
the class ReturnValueDescriptorTest method testIsNotCascaded.
@Test
public void testIsNotCascaded() {
ReturnValueDescriptor elementDescriptor = getMethodReturnValueDescriptor(CustomerRepository.class, "bar");
assertFalse(elementDescriptor.isCascaded());
}
use of jakarta.validation.metadata.ReturnValueDescriptor in project hibernate-validator by hibernate.
the class ConstructorDescriptorTest method testGetReturnValueDescriptor.
@Test
public void testGetReturnValueDescriptor() {
ConstructorDescriptor constructorDescriptor = getConstructorDescriptor(CustomerRepositoryExt.class, String.class);
ReturnValueDescriptor returnValueDescriptor = constructorDescriptor.getReturnValueDescriptor();
assertThat(returnValueDescriptor).isNotNull();
assertThat(returnValueDescriptor.getElementClass()).isEqualTo(CustomerRepositoryExt.class);
assertThat(returnValueDescriptor.hasConstraints()).isTrue();
assertThat(returnValueDescriptor.isCascaded()).isTrue();
Set<ConstraintDescriptor<?>> constraintDescriptors = returnValueDescriptor.getConstraintDescriptors();
assertThat(constraintDescriptors).hasSize(1);
ConstraintDescriptor<?> descriptor = constraintDescriptors.iterator().next();
assertThat(descriptor.getAnnotation().annotationType()).isEqualTo(ValidB2BRepository.class);
}
Aggregations