@Test
  public void testSerDeViolationPolicies() throws Exception {
    final TableName tn1 = getUniqueTableName();
    final SpaceQuotaSnapshot snapshot1 =
      new SpaceQuotaSnapshot(new SpaceQuotaStatus(SpaceViolationPolicy.DISABLE), 512L, 1024L);
    final TableName tn2 = getUniqueTableName();
    final SpaceQuotaSnapshot snapshot2 =
      new SpaceQuotaSnapshot(new SpaceQuotaStatus(SpaceViolationPolicy.NO_INSERTS), 512L, 1024L);
    final TableName tn3 = getUniqueTableName();
    final SpaceQuotaSnapshot snapshot3 =
      new SpaceQuotaSnapshot(new SpaceQuotaStatus(SpaceViolationPolicy.NO_WRITES), 512L, 1024L);
    List<Put> puts = new ArrayList<>();
    puts.add(QuotaTableUtil.createPutForSpaceSnapshot(tn1, snapshot1));
    puts.add(QuotaTableUtil.createPutForSpaceSnapshot(tn2, snapshot2));
    puts.add(QuotaTableUtil.createPutForSpaceSnapshot(tn3, snapshot3));
    final Map<TableName, SpaceQuotaSnapshot> expectedPolicies = new HashMap<>();
    expectedPolicies.put(tn1, snapshot1);
    expectedPolicies.put(tn2, snapshot2);
    expectedPolicies.put(tn3, snapshot3);

    final Map<TableName, SpaceQuotaSnapshot> actualPolicies = new HashMap<>();
    try (Table quotaTable = connection.getTable(QuotaUtil.QUOTA_TABLE_NAME)) {
      quotaTable.put(puts);
      ResultScanner scanner = quotaTable.getScanner(QuotaTableUtil.makeQuotaSnapshotScan());
      for (Result r : scanner) {
        QuotaTableUtil.extractQuotaSnapshot(r, actualPolicies);
      }
      scanner.close();
    }

    assertEquals(expectedPolicies, actualPolicies);
  }
Test the quota table helpers (e.g. CRUD operations)
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaTableUtil.java