I have implemented the firebase dispatcher as following-
public Job createJob(FirebaseJobDispatcher dispatcher){
return dispatcher.newJobBuilder()
//persist the task across boots
.setLifetime(Lifetime.FOREVER)
//.setLifetime(Lifetime.UNTIL_NEXT_BOOT)
//call this service when the criteria are met.
.setService(WeeklyJobService.class)
//unique id of the task
.setTag("Weekly")
//don't overwrite an existing job with the same tag
.setReplaceCurrent(false)
// job is periodic.
.setRecurring(true)
// Run between 1week - 1week+24hrs from now.
.setTrigger(Trigger.executionWindow(Constants.WINDOW_START, Constants.WINDOW_END))
// retry with exponential backoff
.setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)
//.setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)
//Run this job only when the network is available.
.setConstraints(Constraint.ON_ANY_NETWORK)
.build();
}
My question is how do I test this if firebase dispatcher is getting triggered weekly within this time window.I have tested this for an hour time window and it is working fine but is there any way to test it for weekly without actually having to wait for a week?