You discovered the root cause: your old Hibernate Validator version supports org.hibernate.validator.constraints.NotBlank
but not the javax.validation.constraints.NotBlank
properly.
Upgrading Hibernate Validator to 6.x fixes the problem, but you're stuck with 5.1.0 due to project constraints.
So your version of Hibernate Validator simply does not recognize or enforce the newer javax.validation.constraints.NotBlank annotation
.
suggested solutions:
javax.validation.constraints.NotBlank
with org.hibernate.validator.constraints.NotBlank
in your code.