Resource resource = newResource;
ResourceGroup group = newGroup;
Calendar calendar = new GregorianCalendar();
calendar.add(Calendar.SECOND, 2);
Subject overlord = overlord();
GroupOperationSchedule schedule = operationManager.scheduleGroupOperationUsingCron(overlord, newGroup.getId(),
new int[] { resource.getId() }, true, PREFIX + "testOp", null, calendar.get(Calendar.SECOND) + " "
+ calendar.get(Calendar.MINUTE) + " * * * ?", 20, PREFIX + "desc");
assert schedule != null;
assert schedule.getDescription().equals(PREFIX + "desc");
assert schedule.getOperationName().equals(PREFIX + "testOp");
assert schedule.getParameters() != null;
assert schedule.getGroup().getId() == group.getId();
List<GroupOperationSchedule> results;
results = operationManager.findScheduledGroupOperations(overlord, group.getId());
assert results != null;
assert results.size() == 1;
GroupOperationSchedule returnedSchedule = results.get(0);
assert returnedSchedule.getId() > 0 : returnedSchedule;
assert returnedSchedule.getJobId() != null : returnedSchedule;
assert returnedSchedule.getJobName() != null : returnedSchedule;
assert returnedSchedule.getJobGroup() != null : returnedSchedule;
assert returnedSchedule.getDescription().equals(PREFIX + "desc");
assert returnedSchedule.getOperationName().equals(PREFIX + "testOp");
assert returnedSchedule.getParameters() != null;
assert returnedSchedule.getGroup().getId() == group.getId();
System.out.println("WAITING FOR 4.5s FOR THE SCHEDULED OPERATION TO FINISH");
Thread.sleep(4500L);
PageList<ResourceOperationHistory> resultsHist;