public class StaticTimeRule extends Object implements TestRule
At the start of each test the time as viewed by Joda Time classes is frozen to the provided time. At the end of the test it is returned to the system time. This makes time based testing predictable.
| Modifier and Type | Method and Description |
|---|---|
static StaticTimeRule |
always(ReadableInstant instant) |
static StaticTimeRule |
alwaysNow() |
static StaticTimeRule |
alwaysStartOfEpoch() |
Statement |
apply(Statement base,
Description description) |
ReadableInstant |
getInstant() |
public static StaticTimeRule alwaysStartOfEpoch()
public static StaticTimeRule alwaysNow()
public static StaticTimeRule always(ReadableInstant instant)
instant - the instant at which time will be frozenpublic Statement apply(Statement base, Description description)
public ReadableInstant getInstant()
Copyright © 2013. All Rights Reserved.