.setOwner(ROLE_IDENTITY)
.setEnvironment(JobKeys.TO_ENVIRONMENT.apply(JOB_KEY));
JobConfiguration ownedCronJob = makeJob()
.setCronSchedule(CRON_SCHEDULE)
.setTaskConfig(ownedCronJobTask);
IScheduledTask ownedCronJobScheduledTask = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(ownedCronJobTask))
.setStatus(ScheduleStatus.ASSIGNED));
Identity otherOwner = new Identity("other", "other");
JobConfiguration unownedCronJob = makeJob()
.setOwner(otherOwner)
.setCronSchedule(CRON_SCHEDULE)
.setKey(JOB_KEY.newBuilder().setRole("other"))
.setTaskConfig(ownedCronJobTask.deepCopy().setOwner(otherOwner));
TaskConfig ownedImmediateTaskInfo = defaultTask(false)
.setJobName("immediate")
.setOwner(ROLE_IDENTITY);
Set<JobConfiguration> ownedCronJobOnly = ImmutableSet.of(ownedCronJob);
Set<JobSummary> ownedCronJobSummaryOnly = ImmutableSet.of(
new JobSummary()
.setJob(ownedCronJob)
.setStats(new JobStats())
.setNextCronRunMs(nextCronRunMs));
Set<JobSummary> ownedCronJobSummaryWithRunningTask = ImmutableSet.of(
new JobSummary()
.setJob(ownedCronJob)
.setStats(new JobStats().setActiveTaskCount(1))
.setNextCronRunMs(nextCronRunMs));
Set<JobConfiguration> unownedCronJobOnly = ImmutableSet.of(unownedCronJob);
Set<JobConfiguration> bothCronJobs = ImmutableSet.of(ownedCronJob, unownedCronJob);
IScheduledTask ownedImmediateTask = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(ownedImmediateTaskInfo))
.setStatus(ScheduleStatus.ASSIGNED));
JobConfiguration ownedImmediateJob = new JobConfiguration()
.setKey(JOB_KEY.newBuilder().setName("immediate"))
.setOwner(ROLE_IDENTITY)