@Test
  public void testSetAndRemoveRegionServerQuota() throws Exception {
    Admin admin = TEST_UTIL.getAdmin();
    String regionServer = QuotaTableUtil.QUOTA_REGION_SERVER_ROW_KEY;
    QuotaFilter rsFilter = new QuotaFilter().setRegionServerFilter(regionServer);

    admin.setQuota(QuotaSettingsFactory.throttleRegionServer(regionServer,
      ThrottleType.REQUEST_NUMBER, 10, TimeUnit.MINUTES));
    assertNumResults(1, rsFilter);
    // Verify the Quota in the table
    verifyRecordPresentInQuotaTable(ThrottleType.REQUEST_NUMBER, 10, TimeUnit.MINUTES);

    admin.setQuota(QuotaSettingsFactory.throttleRegionServer(regionServer,
      ThrottleType.REQUEST_NUMBER, 20, TimeUnit.MINUTES));
    assertNumResults(1, rsFilter);
    // Verify the Quota in the table
    verifyRecordPresentInQuotaTable(ThrottleType.REQUEST_NUMBER, 20, TimeUnit.MINUTES);

    admin.setQuota(QuotaSettingsFactory.throttleRegionServer(regionServer, ThrottleType.READ_NUMBER,
      30, TimeUnit.SECONDS));
    int count = 0;
    try (QuotaRetriever scanner = new QuotaRetriever(TEST_UTIL.getConnection(), rsFilter)) {
      for (QuotaSettings settings : scanner) {
        assertTrue(settings.getQuotaType() == QuotaType.THROTTLE);
        ThrottleSettings throttleSettings = (ThrottleSettings) settings;
        assertEquals(regionServer, throttleSettings.getRegionServer());
        count++;
        if (throttleSettings.getThrottleType() == ThrottleType.REQUEST_NUMBER) {
          assertEquals(20, throttleSettings.getSoftLimit());
          assertEquals(TimeUnit.MINUTES, throttleSettings.getTimeUnit());
        } else if (throttleSettings.getThrottleType() == ThrottleType.READ_NUMBER) {
          assertEquals(30, throttleSettings.getSoftLimit());
          assertEquals(TimeUnit.SECONDS, throttleSettings.getTimeUnit());
        }
      }
    }
    assertEquals(2, count);

    admin.setQuota(QuotaSettingsFactory.unthrottleRegionServer(regionServer));
    assertNumResults(0, new QuotaFilter().setRegionServerFilter(regionServer));
  }
minicluster tests that validate that quota entries are properly set in the quota table
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java