private RestRequest getUrlSignRequest(RestMethod restMethod, long urlTtlSecs, String randomHeaderVal,
      Long maxUploadSize, boolean chunkUpload) throws Exception {
    RestRequest request = getRequestFromUrl(RestMethod.GET, "signedUrl");
    if (restMethod != null) {
      request.setArg(RestUtils.Headers.URL_TYPE, restMethod.name());
    }
    if (urlTtlSecs != Utils.Infinite_Time) {
      request.setArg(RestUtils.Headers.URL_TTL, Long.toString(urlTtlSecs));
    }
    if (randomHeaderVal != null) {
      request.setArg(RANDOM_AMBRY_HEADER, randomHeaderVal);
    }
    if (RestMethod.POST.equals(restMethod) && maxUploadSize != null) {
      request.setArg(RestUtils.Headers.MAX_UPLOAD_SIZE, Long.toString(maxUploadSize));
    }
    if (chunkUpload) {
      request.setArg(RestUtils.Headers.CHUNK_UPLOAD, "true");
    }
    request.setArg(RestUtils.InternalKeys.TARGET_ACCOUNT_KEY, InMemAccountService.UNKNOWN_ACCOUNT);
    request.setArg(RestUtils.InternalKeys.TARGET_CONTAINER_KEY,
        InMemAccountService.UNKNOWN_ACCOUNT.getContainerById(Container.UNKNOWN_CONTAINER_ID));
    return request;
  }
Gets a {@link RestRequest} that is a request to get a signed URL.
@param restMethod the {@link RestMethod} of signed URL required. Not added to request if {@code null}.
@param urlTtlSecs the ttl of the signed URL in secs. Ignored if == {@link Utils#Infinite_Time}.
@param randomHeaderVal the value of {@link #RANDOM_AMBRY_HEADER}.
@param maxUploadSize if {@code restMethod} is {@link RestMethod#POST}, the value of max upload size. Ignored if
                     {@code null}.
@param chunkUpload
@return a {@link RestRequest} that is a request to sign a URL.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/AmbryUrlSigningServiceTest.java