HaloToolboxApi { @Api(2.0) public void schedule(@NonNull Job job) { AssertionUtils.notNull(job, "job"); mJobScheduler.schedule(job); } protected  HaloToolboxApi(@NonNull HaloFramework framework, @NonNull HaloThreadManager syncQueue, @NonNull EventBus eventHub, @NonNull HaloJobScheduler jobScheduler); @Api(1.3) @NonNull static HaloToolboxApi newSyncApi(@NonNull HaloFramework framework, @NonNull HaloConfig configuration); @Api(1.1) @NonNull HaloThreadManager queue(); @Api(1.3) @NonNull EventBus eventHub(); @Api(2.0) void schedule(@NonNull Job job); @Api(2.0) void schedule(@NonNull Job... jobs); @Api(1.3) @NonNull HaloFramework framework();  }
@Test public void thatScheduleAJob(){ Job job = givenAJob(); mToolbox.schedule(job); assertThat(job.conditionsOk().isEmpty()).isFalse(); assertThat(job.canBePersisted()).isFalse(); assertThat(job.info()).isNotNull(); }
@Test public void thatScheduleAListOfJobs(){ Job[] jobList = new Job[]{givenAJob(),givenAJob()}; mToolbox.schedule(jobList); assertThat(jobList[0].conditionsOk().isEmpty()).isFalse(); assertThat(jobList[0].info()).isNotNull(); assertThat(jobList[1].conditionsOk().isEmpty()).isFalse(); assertThat(jobList[0].info()).isNotNull(); }