@Test
  public void workerProcessImmediateJob() throws Exception {
    final SettableFuture<Bundle> bundleFuture = SettableFuture.create();
    appContext.registerReceiver(
        new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {
            Bundle results = new Bundle();
            results.putBoolean(WorkerProcessTestJobService.EXTRA_MORE_WORK_REMAINING, false);
            setResultExtras(results);

            bundleFuture.set(
                intent.getBundleExtra(WorkerProcessTestJobService.EXTRA_BUNDLE_EXTRAS));
          }
        },
        new IntentFilter(WorkerProcessTestJobService.ACTION_JOBSERVICE_EVENT));

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

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

    assertBundlesEqual(extras, bundleFuture.get(120, TimeUnit.SECONDS));
  }
Tests that JobServices work correctly when defined in alternative processes. Relies on the
broadcast-sending code in {@link WorkerProcessTestJobService}.
jobdispatcher/src/androidTest/java/com/firebase/jobdispatcher/EndToEndAndroidTest.java