@Test
public void testUpdateReservation() {

  ResourceManager rm = setupResourceManager();
  ClientRMService clientService = rm.getClientRMService();
  Clock clock = new UTCClock();
  long arrival = clock.getTime();
  long duration = 60000;
  long deadline = (long) (arrival + 1.05 * duration);
  ReservationSubmissionRequest sRequest =
      submitReservationTestHelper(clientService, arrival, deadline, duration);
  ReservationDefinition rDef = sRequest.getReservationDefinition();
  ReservationRequest rr =
      rDef.getReservationRequests().getReservationResources().get(0);
  ReservationId reservationID = sRequest.getReservationId();
  rr.setNumContainers(5);
  arrival = clock.getTime();
  duration = 30000;
  deadline = (long) (arrival + 1.05 * duration);
  rr.setDuration(duration);
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  ReservationUpdateRequest uRequest =
      ReservationUpdateRequest.newInstance(rDef, reservationID);
  ReservationUpdateResponse uResponse = null;
  try {
    uResponse = clientService.updateReservation(uRequest);
  } catch (Exception e) {
    Assert.fail(e.getMessage());
  }
  Assert.assertNotNull(uResponse);
  System.out.println("Update reservation response: " + uResponse);
  rm.stop();
}