Monday, October 28, 2013

Time based tests with joda time

In unit tests it is helpful to set a fixed date and time. With joda time you can do this by simply calling
DateTimeUtils.setCurrentMillisFixed(new DateTime(2013, 3, 2, 0, 0).getMillis());

No comments:

Post a Comment