@Test
public void testRetry() throws Exception {

  RequestStatus status = testCreateResources();
  Set<Resource> createdResources = status.getAssociatedResources();
  assertEquals(1, createdResources.size());
  Resource res = createdResources.iterator().next();
  Long id = (Long) res.getPropertyValue("Upgrade/request_id");
  assertNotNull(id);
  assertEquals(Long.valueOf(1), id);
  Map<String, Object> requestProps = new HashMap<>();
  requestProps.put(UpgradeResourceProvider.UPGRADE_REQUEST_ID, id.toString());
  requestProps.put(UpgradeResourceProvider.UPGRADE_CLUSTER_NAME, "c1");
  requestProps.put(UpgradeResourceProvider.UPGRADE_REQUEST_STATUS, "ABORTED");
  requestProps.put(UpgradeResourceProvider.UPGRADE_SUSPENDED, "true");
  UpgradeResourceProvider urp = createProvider(amc);
  // !!! make sure we can.  actual abort is tested elsewhere
  Request req = PropertyHelper.getUpdateRequest(requestProps, null);
  urp.updateResources(req, null);
  ActionManager am = injector.getInstance(ActionManager.class);
  List<HostRoleCommand> commands = am.getRequestTasks(id);
  boolean foundOne = false;
  for (HostRoleCommand hrc : commands) {
    if (hrc.getRole().equals(Role.AMBARI_SERVER_ACTION)) {
      assertEquals(-1L, hrc.getHostId());
      assertNull(hrc.getHostName());
      foundOne = true;
    }
  }
  assertTrue("Expected at least one server-side action", foundOne);
  HostRoleCommand cmd = commands.get(commands.size()-1);
  HostRoleCommandDAO dao = injector.getInstance(HostRoleCommandDAO.class);
  HostRoleCommandEntity entity = dao.findByPK(cmd.getTaskId());
  entity.setStatus(HostRoleStatus.ABORTED);
  dao.merge(entity);
  requestProps = new HashMap<>();
  requestProps.put(UpgradeResourceProvider.UPGRADE_REQUEST_ID, id.toString());
  requestProps.put(UpgradeResourceProvider.UPGRADE_REQUEST_STATUS, "PENDING");
  requestProps.put(UpgradeResourceProvider.UPGRADE_CLUSTER_NAME, "c1");
  requestProps.put(UpgradeResourceProvider.UPGRADE_SUSPENDED, "false");
  // !!! make sure we can.  actual reset is tested elsewhere
  req = PropertyHelper.getUpdateRequest(requestProps, null);
  urp.updateResources(req, null);
}