public void testGetQuotasForCurrentTenant() { if (apiOption.isPresent()) { Quota quota = apiOption.get().getByTenant(tenant); assertQuotasIsValid(quota); } }
public void testGetDefaultQuotasForCurrentTenant() { if (apiOption.isPresent()) { Quota quota = apiOption.get().getDefaultsForTenant(tenant); assertQuotasIsValid(quota); } }
public void testGetQuotasForCurrentTenant() { if (apiOption.isPresent()) { Quota quota = apiOption.get().getByTenant(tenant); assertQuotasIsValid(quota); } }
public void testGetDefaultQuotasForCurrentTenant() { if (apiOption.isPresent()) { Quota quota = apiOption.get().getDefaultsForTenant(tenant); assertQuotasIsValid(quota); } }
public void testUpdateQuotasOfCurrentTenantThenReset() { if (apiOption.isPresent()) { QuotaApi api = apiOption.get(); Quota before = api.getByTenant(tenant); assertQuotasIsValid(before); Quota modified = before.toBuilder() .cores(before.getCores() - 1) .instances(before.getInstances() - 1) .metadataItems(before.getMetadatas() - 1) .ram(before.getRam() - 1) .volumes(before.getVolumes() - 1) .build(); assertTrue(api.updateQuotaOfTenant(modified, tenant)); assertEquals(api.getByTenant(tenant), modified); assertTrue(api.updateQuotaOfTenant(before, tenant)); assertEquals(api.getByTenant(tenant), before); } }
public void testUpdateQuotasOfCurrentTenantThenReset() { if (apiOption.isPresent()) { QuotaApi api = apiOption.get(); Quota before = api.getByTenant(tenant); assertQuotasIsValid(before); Quota modified = before.toBuilder() .cores(before.getCores() - 1) .instances(before.getInstances() - 1) .metadataItems(before.getMetadatas() - 1) .ram(before.getRam() - 1) .volumes(before.getVolumes() - 1) .build(); assertTrue(api.updateQuotaOfTenant(modified, tenant)); assertEquals(api.getByTenant(tenant), modified); assertTrue(api.updateQuotaOfTenant(before, tenant)); assertEquals(api.getByTenant(tenant), before); } }