@Test
public void testGetCompletedRequests() throws AmbariException {

  List<Long> requestIds = new ArrayList<Long>();
  requestIds.add(requestId);
  requestIds.add(requestId + 1);
  // populate with a completed request
  populateActionDBWithCompletedRequest(db, hostName, requestId, stageId);
  // only 1 should come back
  List<Long> requestIdsResult = db.getRequestsByStatus(RequestStatus.COMPLETED,
      BaseRequest.DEFAULT_PAGE_SIZE, false);
  assertEquals(1, requestIdsResult.size());
  assertTrue(requestIdsResult.contains(requestId));
  // populate with a partially completed request
  populateActionDBWithPartiallyCompletedRequest(db, hostName, requestId + 1, stageId);
  // the new request should not come back
  requestIdsResult = db.getRequestsByStatus(RequestStatus.COMPLETED,
      BaseRequest.DEFAULT_PAGE_SIZE, false);
  assertEquals(1, requestIdsResult.size());
  assertTrue(requestIdsResult.contains(requestId));
}