@Test
  public void testGetQuotaMode() throws ReflectiveOperationException {
    // test that quota mode is initialized based on config.
    AmbryQuotaManager ambryQuotaManager = buildAmbryQuotaManager();
    QuotaMode quotaMode = quotaConfig.throttlingMode;
    Assert.assertEquals(quotaMode, ambryQuotaManager.getQuotaMode());

    // test that quota mode is set correctly.
    ambryQuotaManager.setQuotaMode(QuotaMode.THROTTLING);
    Assert.assertEquals(QuotaMode.THROTTLING, ambryQuotaManager.getQuotaMode());

    ambryQuotaManager.setQuotaMode(QuotaMode.TRACKING);
    Assert.assertEquals(QuotaMode.TRACKING, ambryQuotaManager.getQuotaMode());
  }
Test {@link QuotaManager#chargeAndRecommend} when quota exceed check is set to true and force charge is set to true.
@throws Exception in case of any exception.
ambry-quota/src/test/java/com/github/ambry/quota/AmbryQuotaManagerTest.java