PageControl.getUnlimitedInstance());
// the group job executed twice
assert results != null;
assert results.size() == 2 : results;
GroupOperationHistory history0 = results.get(0);
GroupOperationHistory history1 = results.get(1);
assert history0.getId() > 0 : history0;
assert history0.getJobId() != null : history0;
assert history0.getJobName() != null : history0;
assert history0.getJobGroup() != null : history0;
assert history0.getErrorMessage() == null : history0;
assert history0.getStatus() == OperationRequestStatus.SUCCESS : history0;
assert history0.getSubjectName().equals(overlord().getName()) : history0;
assert history1.getId() > 0 : history1;
assert history1.getId() != history0.getId() : history1;
assert history1.getJobId() != null : history1;
assert !history1.getJobId().equals(history0.getJobId()) : history1;
assert history1.getJobName() != null : history1;
assert history1.getJobGroup() != null : history1;
assert history1.getErrorMessage() == null : history1;
assert history1.getStatus() == OperationRequestStatus.SUCCESS : history1;
assert history1.getSubjectName().equals(overlord().getName()) : history1;
// get the one resource's two history items from the group (resource executed once per group trigger)
PageList<ResourceOperationHistory> results2;
results2 = operationManager.findCompletedResourceOperationHistories(overlord(), newResource.getId(), null,
null, PageControl.getUnlimitedInstance());
assert results2.size() == 2 : "Should have had 2 results since it was triggered twice: " + results2;
ResourceOperationHistory rHistory0 = results2.get(0);
assert rHistory0.getId() > 0 : rHistory0;
assert rHistory0.getJobId() != null : rHistory0;
assert rHistory0.getJobName() != null : rHistory0;
assert rHistory0.getJobGroup() != null : rHistory0;
assert rHistory0.getErrorMessage() == null : rHistory0;
assert rHistory0.getStatus() == OperationRequestStatus.SUCCESS : rHistory0;
assert rHistory0.getSubjectName().equals(overlord().getName()) : rHistory0;
ResourceOperationHistory rHistory1 = results2.get(1);
assert rHistory1.getId() > 0 : rHistory1;
assert rHistory1.getId() != rHistory0.getId() : rHistory1;
assert rHistory1.getJobId() != null : rHistory1;
assert !rHistory1.getJobId().equals(rHistory0.getJobId()) : rHistory1;
assert rHistory1.getJobId().getJobGroup().equals(rHistory1.getJobGroup()) : rHistory1;
assert rHistory1.getJobId().getJobName().equals(rHistory1.getJobName()) : rHistory1;
assert rHistory1.getJobName() != null : rHistory1;
assert rHistory1.getJobGroup() != null : rHistory1;
assert rHistory1.getJobGroup().equals(rHistory0.getJobGroup()) : rHistory1;
assert rHistory1.getErrorMessage() == null : rHistory1;
assert rHistory1.getStatus() == OperationRequestStatus.SUCCESS : rHistory1;
assert rHistory1.getSubjectName().equals(overlord().getName()) : rHistory1;
operationManager.deleteOperationHistory(overlord(), history0.getId(), false);
operationManager.deleteOperationHistory(overlord(), history1.getId(), false);
results = operationManager.findCompletedGroupOperationHistories(overlord(), newGroup.getId(),
PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0 : results; // none left, we purged the two group histories