QueryParamClassValidator implements ClassVisitor { public void validate() { validator.validate(); } QueryParamClassValidator(Class<?> beanClass, BeanClassNameValidator beanClassNameValidator); void validate(); @Override void visitClass(Class<?> objectClass, String path); @Override void visitField(Field field, String parentPath); @Override void visitEnum(Class<?> enumClass);  }
@Test void validate() { new QueryParamClassValidator(TestQueryParamBean.class, new BeanClassNameValidator()).validate(); }
@Test void validateWithPropertyAnnotation() { assertThatThrownBy(() -> new QueryParamClassValidator(TestQueryParamBeanWithPropertyAnnotation.class, new BeanClassNameValidator()).validate()) .isInstanceOf(Error.class) .hasMessageContaining("field must not have @Property"); }