Skip to content

Commit

Permalink
Properly guard validation support
Browse files Browse the repository at this point in the history
Prevent the validation support to kick in if the Validation API is not
available.

Closes spring-projectsgh-5353
  • Loading branch information
snicoll committed Mar 8, 2016
1 parent 86d87f6 commit 9bbde5b
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@
@EnableConfigurationProperties(CouchbaseProperties.class)
public class CouchbaseAutoConfiguration {

@Bean
@ConditionalOnBean(Validator.class)
public ValidatingCouchbaseEventListener validationEventListener(Validator validator) {
return new ValidatingCouchbaseEventListener(validator);
@Configuration
@ConditionalOnClass(Validator.class)
public static class ValidationConfiguration {

@Bean
@ConditionalOnBean(Validator.class)
public ValidatingCouchbaseEventListener validationEventListener(Validator validator) {
return new ValidatingCouchbaseEventListener(validator);
}
}

@Configuration
Expand Down

0 comments on commit 9bbde5b

Please sign in to comment.