@Test @SmallTest public void testConvert_initialDelay() { long givenInitialDelayDuration = 50000L; WorkSpec workSpec = new WorkSpec("id", FirebaseTestWorker.class.getName()); workSpec.initialDelay = givenInitialDelayDuration; Job job = mConverter.convert(workSpec); assertThat(job.getTrigger(), is(instanceOf(JobTrigger.ImmediateTrigger.class))); }
Job convert(WorkSpec workSpec) { Job.Builder builder = mDispatcher.newJobBuilder() .setService(FirebaseJobService.class) .setTag(workSpec.id) .setLifetime(Lifetime.FOREVER) .setReplaceCurrent(true) .setRetryStrategy(createRetryStrategy(workSpec)) .setConstraints(getConstraints(workSpec)); setExecutionTrigger(builder, workSpec); return builder.build(); }
FirebaseJobConverter { Job convert(WorkSpec workSpec) { Job.Builder builder = mDispatcher.newJobBuilder() .setService(FirebaseJobService.class) .setTag(workSpec.id) .setLifetime(Lifetime.FOREVER) .setReplaceCurrent(true) .setRetryStrategy(createRetryStrategy(workSpec)) .setConstraints(getConstraints(workSpec)); setExecutionTrigger(builder, workSpec); return builder.build(); } }
FirebaseJobConverter { Job convert(WorkSpec workSpec) { Job.Builder builder = mDispatcher.newJobBuilder() .setService(FirebaseJobService.class) .setTag(workSpec.id) .setLifetime(Lifetime.FOREVER) .setReplaceCurrent(true) .setRetryStrategy(createRetryStrategy(workSpec)) .setConstraints(getConstraints(workSpec)); setExecutionTrigger(builder, workSpec); return builder.build(); } FirebaseJobConverter(FirebaseJobDispatcher dispatcher); }
FirebaseJobConverter { Job convert(WorkSpec workSpec) { Job.Builder builder = mDispatcher.newJobBuilder() .setService(FirebaseJobService.class) .setTag(workSpec.id) .setLifetime(Lifetime.FOREVER) .setReplaceCurrent(true) .setRetryStrategy(createRetryStrategy(workSpec)) .setConstraints(getConstraints(workSpec)); setExecutionTrigger(builder, workSpec); return builder.build(); } FirebaseJobConverter(FirebaseJobDispatcher dispatcher);  }
FirebaseJobConverter { Job convert(WorkSpec workSpec) { Job.Builder builder = mDispatcher.newJobBuilder() .setService(FirebaseJobService.class) .setTag(workSpec.id) .setLifetime(Lifetime.FOREVER) .setReplaceCurrent(true) .setRetryStrategy(createRetryStrategy(workSpec)) .setConstraints(getConstraints(workSpec)); setExecutionTrigger(builder, workSpec); return builder.build(); } FirebaseJobConverter(FirebaseJobDispatcher dispatcher);   }