@Before
  public void setup() throws IOException, AccountServiceException {
    Properties properties = new Properties();
    properties.setProperty(QuotaConfig.RESOURCE_CU_QUOTA_IN_JSON, DEFAULT_CU_QUOTA_IN_JSON);
    properties.setProperty(QuotaConfig.FRONTEND_CU_CAPACITY_IN_JSON, DEFAULT_FRONTEND_CAPACITY_JSON);
    quotaConfig = new QuotaConfig(new VerifiableProperties(properties));
    inMemAccountService = new InMemAccountService(false, true);
    ObjectMapper objectMapper = new ObjectMapper();
    testQuotas = objectMapper.readValue(quotaConfig.resourceCUQuotaInJson,
        new TypeReference<Map<String, JsonCUQuotaDataProviderUtil.MapOrQuota>>() {
        });
    for (String s : testQuotas.keySet()) {
      inMemAccountService.updateAccounts(Collections.singletonList(createAccountForQuota(testQuotas.get(s), s)));
    }
    routerConfig = QuotaTestUtils.getDefaultRouterConfig();
    ambryCUQuotaSource = (AmbryCUQuotaSource) new AmbryCUQuotaSourceFactory(quotaConfig, inMemAccountService,
        new QuotaMetrics(new MetricRegistry()), routerConfig).getQuotaSource();
    ambryCUQuotaSource.init();
  }
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