@Test public void shouldNotCreateAnyErrors() throws Exception { validator.validate(dto, errors); assertFalse(errors.getErrorCount() > 0); }
@Override public void validate(Object target, Errors errors) { final TraversingStack traversingStack = new TraversingStack(updateValidationContext.getEntity()); ObjectGraphTraverser traverser = new ObjectGraphTraverser(new ValidationCallback(traversingStack, errors), new AnnotationFieldFilter(traversingAnnotation), new AnnotationFieldFilter(ValidateExpression.class)); traverser.setBeforeTraverse(new BeforeTraverseCallback(traversingStack)); traverser.setAfterTraverse(new AfterTraverseCallback(traversingStack) { }); traverser.traverse(target); }
DtoFieldExpressionValidator implements Validator { @Override public void validate(Object target, Errors errors) { final TraversingStack traversingStack = new TraversingStack(updateValidationContext.getEntity()); ObjectGraphTraverser traverser = new ObjectGraphTraverser(new ValidationCallback(traversingStack, errors), new AnnotationFieldFilter(traversingAnnotation), new AnnotationFieldFilter(ValidateExpression.class)); traverser.setBeforeTraverse(new BeforeTraverseCallback(traversingStack)); traverser.setAfterTraverse(new AfterTraverseCallback(traversingStack) { }); traverser.traverse(target); } }
DtoFieldExpressionValidator implements Validator { @Override public void validate(Object target, Errors errors) { final TraversingStack traversingStack = new TraversingStack(updateValidationContext.getEntity()); ObjectGraphTraverser traverser = new ObjectGraphTraverser(new ValidationCallback(traversingStack, errors), new AnnotationFieldFilter(traversingAnnotation), new AnnotationFieldFilter(ValidateExpression.class)); traverser.setBeforeTraverse(new BeforeTraverseCallback(traversingStack)); traverser.setAfterTraverse(new AfterTraverseCallback(traversingStack) { }); traverser.traverse(target); }  }
DtoFieldExpressionValidator implements Validator { @Override public void validate(Object target, Errors errors) { final TraversingStack traversingStack = new TraversingStack(updateValidationContext.getEntity()); ObjectGraphTraverser traverser = new ObjectGraphTraverser(new ValidationCallback(traversingStack, errors), new AnnotationFieldFilter(traversingAnnotation), new AnnotationFieldFilter(ValidateExpression.class)); traverser.setBeforeTraverse(new BeforeTraverseCallback(traversingStack)); traverser.setAfterTraverse(new AfterTraverseCallback(traversingStack) { }); traverser.traverse(target); }  @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors); }
DtoFieldExpressionValidator implements Validator { @Override public void validate(Object target, Errors errors) { final TraversingStack traversingStack = new TraversingStack(updateValidationContext.getEntity()); ObjectGraphTraverser traverser = new ObjectGraphTraverser(new ValidationCallback(traversingStack, errors), new AnnotationFieldFilter(traversingAnnotation), new AnnotationFieldFilter(ValidateExpression.class)); traverser.setBeforeTraverse(new BeforeTraverseCallback(traversingStack)); traverser.setAfterTraverse(new AfterTraverseCallback(traversingStack) { }); traverser.traverse(target); }  @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors);  }