We're updating the issue view to help you get more done. 

Create a TimeProvider contract to get the current data time

Description

Currently date based constraint validators for @Past and @Future use the default system time to create the instant to compare with. This causes problems during testing, where there always will be border cases based on when the test is run. For testing purposes we want to be able to provide for example a constant instant via the TimeProvider contract. This way the test harness could be easily setup. Per default the TimeProvider would of course use the system time.

We can also consider to make the contract available for users, so that they can plug in their custom implementation. To a certain degree this is what for example java.lang.Clock tries to solve as well.

Environment

None

Status

Assignee

Hardy Ferentschik

Reporter

Hardy Ferentschik

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major