Set<JobConfiguration> crons = ImmutableSet.of(cronJobOne, cronJobTwo, cronJobThree);
TaskConfig immediateTaskConfig = defaultTask(false)
.setJobName("immediate")
.setOwner(ROLE_IDENTITY);
IScheduledTask task1 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfig)));
IScheduledTask task2 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfig.setNumCpus(2))));
TaskConfig immediateTaskConfigTwo = defaultTask(false)
.setJobName("immediateTwo")
.setOwner(BAZ_ROLE_IDENTITY);
IScheduledTask task3 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfigTwo)));
TaskConfig immediateTaskConfigThree = defaultTask(false)
.setJobName("immediateThree")
.setOwner(BAZ_ROLE_IDENTITY);
IScheduledTask task4 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfigThree)));
storageUtil.expectTaskFetch(Query.unscoped(), task1, task2, task3, task4);
expect(cronJobManager.getJobs()).andReturn(IJobConfiguration.setFromBuilders(crons));