A Spring Boot 2 application that demonstrates how to customize the Hibernate Validator.
Specifically, this example configures a ClockProvider, and sets the
hibernate.validator.temporal_validation_tolerance global property.
This allows for a margin of error, due to out of sync clocks for example, when validating temporal constraints such as:
javax.validation.constraints.Past
javax.validation.constraints.PastOrPresent
javax.validation.constraints.Future
javax.validation.constraints.FutureOrPresent
This example also demonstrates how to mock a ClockProvider during unit testing. Use the following
command line to execute the tests:
./gradlew clean test