@Test
  public void onStartJob_jobFinishedNotReschedule() throws Exception {
    // Verify that a termination request from within onStartJob will cause the result to be sent
    // to the bouncer service's handler, regardless of what value is ultimately returned from
    // onStartJob.
    JobService reschedulingService =
        new JobService() {
          @Override
          public boolean onStartJob(@NonNull JobParameters job) {
            jobFinished(job, false /* don't retry this job */);
            return false;
          }

          @Override
          public boolean onStopJob(@NonNull JobParameters job) {
            return false;
          }
        };

    Job jobSpec =
        TestUtil.getBuilderWithNoopValidator()
            .setTag("tag")
            .setService(reschedulingService.getClass())
            .setTrigger(Trigger.NOW)
            .build();

    FutureSettingJobCallback callback = new FutureSettingJobCallback();
    IRemoteJobService.Stub.asInterface(reschedulingService.onBind(null))
        .start(getJobCoder().encode(jobSpec, new Bundle()), callback);

    flush(reschedulingService);

    callback.verifyCalledWithJobAndResult(jobSpec, JobService.RESULT_SUCCESS);
  }
Tests for the {@link JobService} class.
jobdispatcher/src/test/java/com/firebase/jobdispatcher/JobServiceTest.java