@Test
  public void basicImmediateJob() throws Exception {
    final SettableFuture<Bundle> bundleFuture = SettableFuture.create();
    TestJobService.setProxy(
        new TestJobService.JobServiceProxy() {
          @Override
          public boolean onStartJob(JobService jobService, JobParameters job) {
            bundleFuture.set(job.getExtras());
            return false;
          }

          @Override
          public boolean onStopJob(JobService jobService, JobParameters job) {
            return false;
          }
        });

    Bundle extras = new Bundle();
    extras.putBoolean("extras", true);

    dispatcher.mustSchedule(
        dispatcher
            .newJobBuilder()
            .setService(TestJobService.class)
            .setTrigger(Trigger.NOW)
            .setTag("basic-immediate-job")
            .setExtras(extras)
            .build());

    assertBundlesEqual(extras, bundleFuture.get(120, TimeUnit.SECONDS));
  }
Basic end to end test for the JobDispatcher. Requires Google Play services be installed and
available.
jobdispatcher/src/androidTest/java/com/firebase/jobdispatcher/EndToEndAndroidTest.java