use of com.github.ambry.quota.QuotaSource in project ambry by linkedin.
the class AmbryCUQuotaSourceTest method testInit.
public void testInit() throws Exception {
QuotaSource quotaSource = new AmbryCUQuotaSourceFactory(new QuotaConfig(new VerifiableProperties(new Properties())), inMemAccountService).getQuotaSource();
Assert.assertFalse(quotaSource.isReady());
quotaSource.init();
Assert.assertTrue(quotaSource.isReady());
quotaSource.shutdown();
Assert.assertFalse(quotaSource.isReady());
}
use of com.github.ambry.quota.QuotaSource in project ambry by linkedin.
the class AmbryCUQuotaEnforcerFactoryTest method testGetRequestQuotaEnforcer.
@Test
public void testGetRequestQuotaEnforcer() throws IOException {
QuotaConfig quotaConfig = new QuotaConfig(new VerifiableProperties(new Properties()));
QuotaSource quotaSource = new AmbryCUQuotaSource(quotaConfig, Mockito.mock(AccountService.class));
AccountStatsStore mockAccountStatsStore = Mockito.mock(AccountStatsStore.class);
AmbryCUQuotaEnforcerFactory ambryCUQuotaEnforcerFactory = new AmbryCUQuotaEnforcerFactory(quotaConfig, quotaSource, mockAccountStatsStore);
Assert.assertEquals(AmbryCUQuotaEnforcer.class, ambryCUQuotaEnforcerFactory.getQuotaEnforcer().getClass());
}
Aggregations