use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project FP-PSP-SERVER by FundacionParaguaya.
the class WebMvcConfig method validator.
@Bean
public LocalValidatorFactoryBean validator() {
LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
factory.setMessageInterpolator(i18n());
factory.setValidationMessageSource(messageSource());
return factory;
}
use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project Flare-event-calendar by PollubCafe.
the class MessagesConfig method validator.
@Bean
public Validator validator() {
final LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
factory.setValidationMessageSource(messageSource());
return factory;
}
use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project spring-boot by spring-projects.
the class ValidatorAdapterTests method wrapperInvokesCallbackOnNonManagedBean.
@Test
void wrapperInvokesCallbackOnNonManagedBean() {
this.contextRunner.withUserConfiguration(NonManagedBeanConfig.class).run((context) -> {
LocalValidatorFactoryBean validator = context.getBean(NonManagedBeanConfig.class).validator;
then(validator).should().setApplicationContext(any(ApplicationContext.class));
then(validator).should().afterPropertiesSet();
then(validator).should(never()).destroy();
context.close();
then(validator).should().destroy();
});
}
use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project spring-boot by spring-projects.
the class ValidatorAdapterTests method wrapperDoesNotInvokeCallbackOnManagedBean.
@Test
void wrapperDoesNotInvokeCallbackOnManagedBean() {
this.contextRunner.withUserConfiguration(ManagedBeanConfig.class).run((context) -> {
LocalValidatorFactoryBean validator = context.getBean(ManagedBeanConfig.class).validator;
then(validator).should(never()).setApplicationContext(any(ApplicationContext.class));
then(validator).should(never()).afterPropertiesSet();
then(validator).should(never()).destroy();
context.close();
then(validator).should(never()).destroy();
});
}
use of org.springframework.validation.beanvalidation.LocalValidatorFactoryBean in project erp-catering by liuyandong33.
the class HibernateValidatorConfiguration method localValidatorFactoryBean.
@Bean(name = "validator")
public Validator localValidatorFactoryBean() {
LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
localValidatorFactoryBean.setProviderClass(HibernateValidator.class);
localValidatorFactoryBean.setValidationMessageSource(messageSource);
return localValidatorFactoryBean;
}
Aggregations