private RestRequest createRestRequest(RestMethod restMethod) throws Exception {
    JSONObject requestData = new JSONObject();
    requestData.put(MockRestRequest.REST_METHOD_KEY, restMethod.name());
    requestData.put(MockRestRequest.URI_KEY, "/");
    JSONObject headers = new JSONObject();
    headers.put(RestUtils.InternalKeys.REQUEST_PATH,
        RequestPath.parse("/", Collections.emptyMap(), Collections.emptyList(), "ambry-test"));
    headers.put(RestUtils.InternalKeys.TARGET_ACCOUNT_KEY, account);
    headers.put(RestUtils.InternalKeys.TARGET_CONTAINER_KEY, account.getAllContainers().iterator().next());
    requestData.put(MockRestRequest.HEADERS_KEY, headers);
    return new MockRestRequest(requestData, null);
  }
Helper method to test {@link PreProcessQuotaChargeCallback#checkAndCharge} for all possible parameters.
@param testWithChunkSize {@code true} if checkAndCharge is called with chunkSize param. {@code false} otherwise.
@throws Exception In case of any error
ambry-quota/src/test/java/com/github/ambry/quota/PreProcessQuotaChargeCallbackTest.java