Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
core-1.4.0
-
None
Description
The ClockService delegates to the Clock singleton. If the absence of any explicit initialization, the Clock singleton lazily instantiates itself with a non-replaceable SystemClock that simply delegates to the system time.
In integration tests, however, we should use FixtureClock. The default behaviour of this is to act the same as the SystemClock, however it also exposes methods to allow the date/time to be set. Once set, any call for the date/time is fixed.
Currently, because of the way in which Isis bootstraps, by the time the test starts the Clock singleton has already been hit, meaning that it isn't possible for a developer-written fixture to install the FixtureClock explicitly.
This ticket is for the testing framework (in IsisSystemForTest) to automatically install the FixtureClock on behalf of any tests that want to use it.