private void verifyBlobPropertiesConstructionFailure(JSONObject headers, RestServiceErrorCode expectedCode)
      throws JSONException, UnsupportedEncodingException, URISyntaxException {
    RestRequest restRequest = createRestRequest(RestMethod.POST, "/", headers);
    try {
      RestUtils.buildBlobProperties(restRequest.getArgs());
      fail("An exception was expected but none were thrown");
    } catch (RestServiceException e) {
      assertEquals("Unexpected RestServiceErrorCode", expectedCode, e.getErrorCode());
    }
  }
Verifies that {@link RestUtils#buildBlobProperties(Map<String,Object>)} fails if given a request with bad
arguments.
@param headers the headers that were provided to the request.
@param expectedCode the expected {@link RestServiceErrorCode} because of the failure.
@throws JSONException
@throws UnsupportedEncodingException
@throws URISyntaxException
ambry-api/src/test/java/com/github/ambry/rest/RestUtilsTest.java