private void assertRPCQuota(ThrottleType type, long limit, TimeUnit tu, QuotaScope scope,
    Cell cell) throws Exception {
    Quotas q = QuotaTableUtil.quotasFromData(cell.getValueArray(), cell.getValueOffset(),
      cell.getValueLength());
    assertTrue("Quota should have rpc quota defined", q.hasThrottle());

    QuotaProtos.Throttle rpcQuota = q.getThrottle();
    QuotaProtos.TimedQuota t = null;

    switch (type) {
      case REQUEST_SIZE:
        assertTrue(rpcQuota.hasReqSize());
        t = rpcQuota.getReqSize();
        break;
      case READ_NUMBER:
        assertTrue(rpcQuota.hasReadNum());
        t = rpcQuota.getReadNum();
        break;
      case READ_SIZE:
        assertTrue(rpcQuota.hasReadSize());
        t = rpcQuota.getReadSize();
        break;
      case REQUEST_NUMBER:
        assertTrue(rpcQuota.hasReqNum());
        t = rpcQuota.getReqNum();
        break;
      case WRITE_NUMBER:
        assertTrue(rpcQuota.hasWriteNum());
        t = rpcQuota.getWriteNum();
        break;
      case WRITE_SIZE:
        assertTrue(rpcQuota.hasWriteSize());
        t = rpcQuota.getWriteSize();
        break;
      case REQUEST_CAPACITY_UNIT:
        assertTrue(rpcQuota.hasReqCapacityUnit());
        t = rpcQuota.getReqCapacityUnit();
        break;
      case READ_CAPACITY_UNIT:
        assertTrue(rpcQuota.hasReadCapacityUnit());
        t = rpcQuota.getReadCapacityUnit();
        break;
      case WRITE_CAPACITY_UNIT:
        assertTrue(rpcQuota.hasWriteCapacityUnit());
        t = rpcQuota.getWriteCapacityUnit();
        break;
      case ATOMIC_READ_SIZE:
        assertTrue(rpcQuota.hasAtomicReadSize());
        t = rpcQuota.getAtomicReadSize();
        break;
      case ATOMIC_REQUEST_NUMBER:
        assertTrue(rpcQuota.hasAtomicReqNum());
        t = rpcQuota.getAtomicReqNum();
        break;
      default:
    }

    assertEquals(scope, ProtobufUtil.toQuotaScope(t.getScope()));
    assertEquals(t.getSoftLimit(), limit);
    assertEquals(t.getTimeUnit(), ProtobufUtil.toProtoTimeUnit(tu));
  }
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