Search in sources :

Example 1 with HibernateValidatorFactory

use of org.hibernate.validator.HibernateValidatorFactory in project wildfly by wildfly.

the class LazyValidatorFactoryTestCase method testHibernateValidatorIsUsedAsProviderByDefault.

@Test
public void testHibernateValidatorIsUsedAsProviderByDefault() {
    HibernateValidatorFactory hibernateValidatorFactory = validatorFactory.unwrap(HibernateValidatorFactory.class);
    assertNotNull("LazyValidatorFactory should delegate to the HV factory by default", hibernateValidatorFactory);
    Validator validator = validatorFactory.getValidator();
    assertNotNull("LazyValidatorFactory should provide a validator", validator);
}
Also used : HibernateValidatorFactory(org.hibernate.validator.HibernateValidatorFactory) Validator(javax.validation.Validator) Test(org.junit.Test)

Example 2 with HibernateValidatorFactory

use of org.hibernate.validator.HibernateValidatorFactory in project wildfly by wildfly.

the class BootStrapValidationTestCase method testBootstrapAsServiceDefault.

@Test
public void testBootstrapAsServiceDefault() {
    HibernateValidatorFactory factory = (HibernateValidatorFactory) Validation.buildDefaultValidatorFactory();
    assertNotNull(factory);
}
Also used : HibernateValidatorFactory(org.hibernate.validator.HibernateValidatorFactory) Test(org.junit.Test)

Aggregations

HibernateValidatorFactory (org.hibernate.validator.HibernateValidatorFactory)2 Test (org.junit.Test)2 Validator (javax.validation.Validator)1