PageList<ResourceOperationHistory> results;
results = operationManager.findCompletedResourceOperationHistories(overlord(), resource.getId(), null, null,
PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 2 : "Should have had multiple results: " + results;
ResourceOperationHistory history0 = results.get(0);
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;
ResourceOperationHistory history1 = results.get(1);
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.getJobName().equals(history1.getJobId().getJobName()) : history1;
assert history1.getJobId().getJobName().equals(history0.getJobId().getJobName()) : history1;
assert history1.getJobGroup() != null : history1;
assert history1.getJobGroup().equals(history1.getJobId().getJobGroup()) : history1;
assert history1.getJobGroup().equals(history0.getJobGroup()) : history1;
assert history1.getJobId().getJobGroup().equals(history0.getJobId().getJobGroup()) : history1;
assert history1.getErrorMessage() == null : history1;
assert history1.getStatus() == OperationRequestStatus.SUCCESS : history1;
assert history1.getSubjectName().equals(overlord().getName()) : history1;
operationManager.deleteOperationHistory(overlord(), history0.getId(), false);
operationManager.deleteOperationHistory(overlord(), history1.getId(), false);
results = operationManager.findCompletedResourceOperationHistories(overlord(), resource.getId(), null, null,
PageControl.getUnlimitedInstance());
assert results != null;
assert results.size() == 0;
}