Search in sources :

Example 1 with ValidatorUtil.getValidator

use of org.hibernate.validator.testutils.ValidatorUtil.getValidator in project hibernate-validator by hibernate.

the class ElementDescriptorTest method testGetTypeForConstrainedBean.

@Test
public void testGetTypeForConstrainedBean() {
    Validator validator = ValidatorUtil.getValidator();
    BeanDescriptor beanDescriptor = validator.getConstraintsForClass(Customer.class);
    assertEquals(beanDescriptor.getElementClass(), Customer.class, "Wrong type.");
}
Also used : BeanDescriptor(jakarta.validation.metadata.BeanDescriptor) Validator(jakarta.validation.Validator) ValidatorUtil.getValidator(org.hibernate.validator.testutils.ValidatorUtil.getValidator) Test(org.testng.annotations.Test)

Aggregations

Validator (jakarta.validation.Validator)1 BeanDescriptor (jakarta.validation.metadata.BeanDescriptor)1 ValidatorUtil.getValidator (org.hibernate.validator.testutils.ValidatorUtil.getValidator)1 Test (org.testng.annotations.Test)1