@Test
  public void testCreation() throws QuotaException {
    Assert.assertEquals(4, ambryCUQuotaSource.getAllQuota().size());
    Assert.assertEquals(1024000000,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("101_1", QuotaResourceType.CONTAINER),
            QuotaName.READ_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(1024000000,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("101_1", QuotaResourceType.CONTAINER),
            QuotaName.WRITE_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(258438456,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("101_2", QuotaResourceType.CONTAINER),
            QuotaName.READ_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(258438456,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("101_2", QuotaResourceType.CONTAINER),
            QuotaName.WRITE_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(1024000000,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("102_1", QuotaResourceType.CONTAINER),
            QuotaName.READ_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(1024000000,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("102_1", QuotaResourceType.CONTAINER),
            QuotaName.WRITE_CAPACITY_UNIT).getQuotaValue());
    try {
      ambryCUQuotaSource.getQuota(new QuotaResource("101", QuotaResourceType.ACCOUNT), QuotaName.WRITE_CAPACITY_UNIT);
      Assert.fail("If quota is not present, it should throw an exception");
    } catch (QuotaException quotaException) {
    }
    try {
      ambryCUQuotaSource.getQuota(new QuotaResource("102", QuotaResourceType.ACCOUNT), QuotaName.WRITE_CAPACITY_UNIT);
      Assert.fail("If quota is not present, it should throw an exception");
    } catch (QuotaException quotaException) {
    }
    Assert.assertEquals(10737418240L,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("103", QuotaResourceType.ACCOUNT),
            QuotaName.READ_CAPACITY_UNIT).getQuotaValue());
    Assert.assertEquals(10737418240L,
        (long) ambryCUQuotaSource.getQuota(new QuotaResource("103", QuotaResourceType.ACCOUNT),
            QuotaName.WRITE_CAPACITY_UNIT).getQuotaValue());

    Assert.assertEquals(0, ambryCUQuotaSource.getSystemResourceUsage(QuotaName.READ_CAPACITY_UNIT), 0.01);
    Assert.assertEquals(0, ambryCUQuotaSource.getSystemResourceUsage(QuotaName.READ_CAPACITY_UNIT), 0.01);

    Assert.assertEquals(4, ambryCUQuotaSource.getAllQuotaUsage().size());
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("101_1", QuotaResourceType.CONTAINER),
        QuotaName.READ_CAPACITY_UNIT));
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("101_1", QuotaResourceType.CONTAINER),
        QuotaName.WRITE_CAPACITY_UNIT));
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("101_2", QuotaResourceType.CONTAINER),
        QuotaName.READ_CAPACITY_UNIT));
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("101_2", QuotaResourceType.CONTAINER),
        QuotaName.WRITE_CAPACITY_UNIT));
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("102_1", QuotaResourceType.CONTAINER),
        QuotaName.READ_CAPACITY_UNIT));
    Assert.assertEquals(0, (long) ambryCUQuotaSource.getUsage(new QuotaResource("102_1", QuotaResourceType.CONTAINER),
        QuotaName.WRITE_CAPACITY_UNIT));
  }
Create test setup by creating the {@link AmbryCUQuotaSource} object and updating account service.
@throws IOException
@throws AccountServiceException
ambry-quota/src/test/java/com/github/ambry/quota/capacityunit/AmbryCUQuotaSourceTest.java