public class TestTimeSupplier extends Object implements org.mule.runtime.api.time.TimeSupplier
TimeSupplier for externalizing the system time. It is initialised at a given initial timeInMillis using
the TestTimeSupplier(long) constructor. The value can be retrieved through the get() method.
The usefulness of ths class comes from the behavior provided by the move(long, TimeUnit) method which allows changing
that value per the tests needs. After invoking this method, you can retrieved the modified value through the get()
method, although there's no way to retrieve the original one after move(long, TimeUnit) has been invoked.| Constructor and Description |
|---|
TestTimeSupplier(long timeInMillis)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
Long |
get()
Returns the current virtualized time in milliseconds
|
long |
move(long timeOffset,
TimeUnit unit)
|
public TestTimeSupplier(long timeInMillis)
timeInMillis - time in milliseconds to be supplied until its modified by move(long, TimeUnit)public Long get()
public long move(long timeOffset,
TimeUnit unit)
timeOffset - the offset to be applied on timeInMillisunit - a TimeUnit which qualifies the timeOffsettimeInMillisIllegalArgumentException - if timeOffset is negativeCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.