@Test public void testGetDefaultQuotaToDCWithoutDefaultQuotaWithNoReuse() throws Exception { String defaultQuotaName = quotaHelper.getDefaultQuotaName(storagePool.getname()); when(quotaHelper.generateDefaultQuotaName(storagePool)).thenReturn(defaultQuotaName); Quota quotaUnlimited = quotaHelper.getUnlimitedQuota(mockStoragePool(), true, false).getFirst(); assertQuotaUnlimited(quotaUnlimited); assertQuotaUnlimitedName(quotaUnlimited); }
@Test public void testGetDefaultQuotaForDCWithDefaultQuota() throws Exception { when(quotaDAO.getDefaultQuotaByStoragePoolId(storagePoolUUID)) .thenReturn(mockGeneralStorageQuota()); String defaultQuotaName = quotaHelper.getDefaultQuotaName(storagePool.getname()); when(quotaHelper.generateDefaultQuotaName(storagePool)).thenReturn(defaultQuotaName); Quota quotaUnlimited = quotaHelper.getUnlimitedQuota(mockStoragePool(), true); assertQuotaUnlimited(quotaUnlimited); assertQuotaUnlimitedName(quotaUnlimited); }
@Test public void testGetDefaultQuotaName() throws Exception { String quotaDefaultName = quotaHelper.getDefaultQuotaName(mockStoragePool()); String desiredQuotaDefaultName = "DefaultQuota-Storage pool name"; assertEquals(desiredQuotaDefaultName, quotaDefaultName); }