FirebaseJobDispatcher { public void mustSchedule(@NonNull Job job) { if (schedule(job) != SCHEDULE_RESULT_SUCCESS) { throw new ScheduleFailedException(); } } FirebaseJobDispatcher(@NonNull Driver driver); @ScheduleResult int schedule(@NonNull Job job); @CancelResult int cancel(@NonNull String tag); @CancelResult int cancelAll(); void mustSchedule(@NonNull Job job); ValidationEnforcer getValidator(); @NonNull Job.Builder newJobBuilder(); RetryStrategy newRetryStrategy(
      @RetryPolicy int policy, int initialBackoff, int maximumBackoff); static final int SCHEDULE_RESULT_SUCCESS; static final int SCHEDULE_RESULT_UNKNOWN_ERROR; static final int SCHEDULE_RESULT_NO_DRIVER_AVAILABLE; static final int SCHEDULE_RESULT_UNSUPPORTED_TRIGGER; static final int SCHEDULE_RESULT_BAD_SERVICE; static final int CANCEL_RESULT_SUCCESS; static final int CANCEL_RESULT_UNKNOWN_ERROR; static final int CANCEL_RESULT_NO_DRIVER_AVAILABLE; }
@Test public void testMustSchedule_unavailable() throws Exception { setDriverAvailability(false); expectedException.expect(FirebaseJobDispatcher.ScheduleFailedException.class); dispatcher.mustSchedule(null); }