SmsJobService extends JobService { @Override public boolean onStartJob(JobParameters jobParameters) { final Bundle extras = jobParameters.getExtras(); if (LOCAL_LOGV) { Log.v(TAG, "onStartJob(" + jobParameters + ", extras=" + extras + ")"); } if (wasTriggeredByContentUri(jobParameters)) { if (LOCAL_LOGV) { Log.v(TAG, "scheduling follow-up job for content triggered job "+jobParameters); } getBackupJobs().scheduleIncoming(); return false; } else if (shouldRun(jobParameters)) { SmsBackupService service = new SmsBackupService(); service.attachBaseContext(this); service.handleIntent(new Intent(jobParameters.getTag()).putExtras(extras)); jobs.put(jobParameters.getTag(), jobParameters); return true; } else { Log.d(TAG, "skipping run"); return false; } }  @Override void onCreate(); @Override void onDestroy(); @Override boolean onStartJob(JobParameters jobParameters); @Override boolean onStopJob(JobParameters jobParameters); @Subscribe void backupStateChanged(BackupState state);  }
@Test public void testOnStartJob() { final JobParameters jobParameters = mock(JobParameters.class); when(jobParameters.getTag()).thenReturn(BackupJobs.CONTENT_TRIGGER_TAG); boolean moreWork = smsJobService.onStartJob(jobParameters); assertThat(moreWork).isFalse(); }