I need to test a function that whose result will depend on current time (using Joda time's isBeforeNow()
, it so happens).
public boolean isAvailable() {
return (this.someDate.isBeforeNow());
}
Is it possible to stub/mock out the system time with (using Mockito, for example) so that I can reliably test the function?