### Question:
FrameworkScheduler extends Scheduler { @Override public void onFinished(SchedulerConstraint constraint, boolean reschedule) { JqLog.d("[FW Scheduler] on finished job %s. reschedule:%s", constraint, reschedule); JobService service = this.jobService; if (service == null) { JqLog.e("[FW Scheduler] scheduler onFinished is called but i don't have a job service"); return; } Object data = constraint.getData(); if (data instanceof JobParameters) { JobParameters params = (JobParameters) data; service.jobFinished(params, reschedule); } else { JqLog.e("[FW Scheduler] cannot obtain the job parameters"); } } FrameworkScheduler(Class<? extends FrameworkJobSchedulerService> serviceImpl); @SuppressLint("SwitchIntDef") @Override void request(SchedulerConstraint constraint); @Override void onFinished(SchedulerConstraint constraint, boolean reschedule); @Override void cancelAll();  }### Answer:
@Test public void onFinished() { SchedulerConstraint constraint = mock(SchedulerConstraint.class); when(constraint.getNetworkStatus()).thenReturn(NetworkUtil.METERED); when(constraint.getUuid()).thenReturn("abc"); when(constraint.getDelayInMs()).thenReturn(22L); when(constraint.getOverrideDeadlineInMs()).thenReturn(null); JobParameters[] outParams = new JobParameters[1]; SchedulerConstraint received = triggerOnStart(constraint, outParams); fwScheduler.onFinished(received, false); }