private static VerifiableProperties buildFrontendVPropsForQuota(File trustStoreFile, boolean isRequestQuotaEnabled,
      QuotaMode quotaMode, Account account, boolean throttleRequest) throws IOException, GeneralSecurityException {
    Properties properties = buildFrontendVProps(trustStoreFile, true, PLAINTEXT_SERVER_PORT, SSL_SERVER_PORT);
    // By default the usage and limit of quota will be 0 in the default JsonCUQuotaSource, and hence the default
    // JsonCUQuotaEnforcer will reject requests. So for cases where we don't want requests to be rejected, we set a
    // non 0 limit for quota.
    JSONObject cuResourceQuotaJson = new JSONObject();
    JSONObject quotaJson = new JSONObject();
    quotaJson.put("rcu", throttleRequest ? 0 : 10737418240L);
    quotaJson.put("wcu", throttleRequest ? 0 : 10737418240L);
    cuResourceQuotaJson.put(Integer.toString(account.getId()), quotaJson);
    properties.setProperty(QuotaConfig.RESOURCE_CU_QUOTA_IN_JSON, cuResourceQuotaJson.toString());
    properties.setProperty(QuotaConfig.THROTTLING_MODE, quotaMode.name());
    properties.setProperty(QuotaConfig.REQUEST_THROTTLING_ENABLED, String.valueOf(isRequestQuotaEnabled));
    properties.setProperty(QuotaConfig.FRONTEND_CU_CAPACITY_IN_JSON,
        "{\n" + "  \"rcu\": 1024,\n" + "  \"wcu\": 1024\n" + "}");
    long quotaValue = throttleRequest ? DEFAULT_REJECT_QUOTA : DEFAULT_ACCEPT_QUOTA;
    properties.setProperty(QuotaConfig.RESOURCE_CU_QUOTA_IN_JSON,
        String.format("{\n" + "  \"%s\": {\n" + "    \"rcu\": %d,\n" + "    \"wcu\": %d\n" + "  }\n" + "}",
            account.getId(), quotaValue, quotaValue));
    return new VerifiableProperties(properties);
  }
Builds properties required to start a {@link RestServer} as an Ambry frontend server.
@param trustStoreFile the trust store file to add certificates to for SSL testing.
@param isRequestQuotaEnabled flag to specify if request quota is enabled.
@param quotaMode {@link QuotaMode} object.
@param account {@link Account} for which quota needs to be specified.
@param throttleRequest flag to indicate if the {@link com.github.ambry.quota.QuotaManager} should throttle request.
@return a {@link VerifiableProperties} with the parameters for an Ambry frontend server.
ambry-frontend/src/integration-test/java/com/github/ambry/frontend/FrontendQuotaIntegrationTest.java