private PostResults prepareAndPostBlob(int contentLength, String serviceId, long ttl, String contentType,
      String ownerId, Account account, Container container, Map<String, String> userMetadata) throws Exception {
    ByteBuffer content = ByteBuffer.wrap(TestUtils.getRandomBytes(contentLength));
    JSONObject headers = new JSONObject();
    setAmbryHeadersForPut(headers, ttl, !container.isCacheable(), serviceId, contentType, ownerId, account.getName(),
        container.getName(), null);
    RestUtilsTest.setUserMetadataHeaders(headers, userMetadata);
    String blobId = postBlobAndVerify(headers, content, account, container);
    headers.put(RestUtils.Headers.BLOB_SIZE, (long) contentLength);
    return new PostResults(blobId, headers, content);
  }
Prepares random content, sets headers and POSTs a blob with the required parameters
@param contentLength the length of the content to be POSTed.
@param serviceId service ID for the blob
@param ttl TTL for the blob
@param contentType content type for the blob
@param ownerId owner id for the blob
@param account account that the blobs should belong to
@param container container that the blobs should belong to
@param userMetadata user metadata to associate with the blob. Can be {@code null}
@return
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceTest.java