@Test
  public void stop_withCallback_retry() throws Exception {
    StoppableJobService service = spy(new StoppableJobService(/* shouldReschedule= */ false));

    JobInvocation job =
        new Builder()
            .setTag("Tag")
            .setTrigger(Trigger.NOW)
            .setService(StoppableJobService.class.getName())
            .build();

    Bundle jobSpecData = getJobCoder().encode(job, new Bundle());
    FutureSettingJobCallback callback = new FutureSettingJobCallback();

    // start the service
    IRemoteJobService.Stub.asInterface(service.onBind(null)).start(jobSpecData, callback);
    IRemoteJobService.Stub.asInterface(service.onBind(null)).stop(jobSpecData, true);

    flush(service);

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