use of jakarta.validation.metadata.BeanDescriptor in project hibernate-validator by hibernate.
the class BeanDescriptorTest method testIsTypeConstrainedForConstructorReturnValueConstrainedType.
@Test
public void testIsTypeConstrainedForConstructorReturnValueConstrainedType() {
BeanDescriptor descriptor = getBeanDescriptor(ConstructorReturnValueConstrainedType.class);
assertFalse(descriptor.isBeanConstrained(), "The entity should have no bean constraints");
assertTrue(descriptor.getConstrainedMethods(MethodType.NON_GETTER, MethodType.GETTER).isEmpty(), "The entity should have no constrained methods");
assertTrue(descriptor.getConstrainedConstructors().size() == 1, "The entity should have a constrained constructor");
}
use of jakarta.validation.metadata.BeanDescriptor in project hibernate-validator by hibernate.
the class BeanDescriptorTest method testGetConstraintsForConstructor.
@Test
public void testGetConstraintsForConstructor() {
BeanDescriptor descriptor = getBeanDescriptor(CustomerRepositoryExt.class);
ConstructorDescriptor constructorDescriptor = descriptor.getConstraintsForConstructor(String.class, Customer.class);
assertThat(constructorDescriptor).isNotNull();
}
use of jakarta.validation.metadata.BeanDescriptor in project hibernate-validator by hibernate.
the class BeanDescriptorTest method testIsTypeConstrainedForConstructorCascadingParameterType.
@Test
public void testIsTypeConstrainedForConstructorCascadingParameterType() {
BeanDescriptor descriptor = getBeanDescriptor(ConstructorCascadingParameterType.class);
assertFalse(descriptor.isBeanConstrained(), "The entity should have no bean constraints");
assertTrue(descriptor.getConstrainedMethods(MethodType.NON_GETTER).isEmpty(), "The entity should have no constrained methods");
assertTrue(descriptor.getConstrainedConstructors().size() == 1, "The entity should have a constrained constructor");
}
use of jakarta.validation.metadata.BeanDescriptor in project hibernate-validator by hibernate.
the class BeanDescriptorTest method testIsTypeConstrainedForConstructorCascadingReturnValueType.
@Test
public void testIsTypeConstrainedForConstructorCascadingReturnValueType() {
BeanDescriptor descriptor = getBeanDescriptor(ConstructorCascadingReturnValueType.class);
assertFalse(descriptor.isBeanConstrained(), "The entity should have no bean constraints");
assertTrue(descriptor.getConstrainedMethods(MethodType.NON_GETTER, MethodType.GETTER).isEmpty(), "The entity should have no constrained methods");
assertTrue(descriptor.getConstrainedConstructors().size() == 1, "The entity should have a constrained constructor");
}
use of jakarta.validation.metadata.BeanDescriptor in project hibernate-validator by hibernate.
the class BeanDescriptorTest method testGetBeanDescriptor.
@Test
public void testGetBeanDescriptor() {
BeanDescriptor beanDescriptor = getBeanDescriptor(CustomerRepository.class);
assertNotNull(beanDescriptor);
assertEquals(beanDescriptor.getElementClass(), CustomerRepository.class);
}
Aggregations