ScheduleFetchTodaysSentenceUC extends AbstractUseCase<ScheduleFetchEvent, Void, Void> { @Override public void run() { scheduleNextFetch(); } ScheduleFetchTodaysSentenceUC(SentenceFetchScheduler sentenceFetchScheduler); @Override void run();  }
@Test public void testNormalScheduleFetch() { long startTime = System.currentTimeMillis(); ScheduleFetchEvent event = new ScheduleFetchEvent(startTime, ScheduleFetchEvent.TYPE.NORMAL); mScheduleFetchTodaysSentenceUC.setRequestValue(event); mScheduleFetchTodaysSentenceUC.run(); verify(mSentenceFetchScheduler).nextFetchScheduleAt(startTime + ScheduleFetchTodaysSentenceUC.NORMAL_FETCHING_INTERVAL); }
@Test public void testRetryScheduleFetch() { long startTime = System.currentTimeMillis(); ScheduleFetchEvent event = new ScheduleFetchEvent(startTime, ScheduleFetchEvent.TYPE.RETRY); mScheduleFetchTodaysSentenceUC.setRequestValue(event); mScheduleFetchTodaysSentenceUC.run(); verify(mSentenceFetchScheduler).nextFetchScheduleAt(startTime + ScheduleFetchTodaysSentenceUC.RETRY_FETCHING_INTERVAL); }