mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8592: test fixes
This commit is contained in:
parent
8f816e70f0
commit
fa2c3024e3
|
|
@ -116,7 +116,7 @@ public class QuotaAlertManagerImplTest extends TestCase {
|
|||
acc.setLastStatementDate(null);
|
||||
List<QuotaAccountVO> accounts = new ArrayList<>();
|
||||
accounts.add(acc);
|
||||
Mockito.when(quotaAcc.listAll()).thenReturn(accounts);
|
||||
Mockito.when(quotaAcc.listAllQuotaAccount()).thenReturn(accounts);
|
||||
|
||||
Mockito.when(quotaUsage.findTotalQuotaUsage(Mockito.anyLong(), Mockito.anyLong(), Mockito.anyInt(),
|
||||
Mockito.any(Date.class), Mockito.any(Date.class))).thenReturn(new BigDecimal(100));
|
||||
|
|
@ -153,7 +153,7 @@ public class QuotaAlertManagerImplTest extends TestCase {
|
|||
acc.setQuotaEnforce(0);
|
||||
List<QuotaAccountVO> accounts = new ArrayList<>();
|
||||
accounts.add(acc);
|
||||
Mockito.when(quotaAcc.listAll()).thenReturn(accounts);
|
||||
Mockito.when(quotaAcc.listAllQuotaAccount()).thenReturn(accounts);
|
||||
|
||||
// Don't test sendQuotaAlert yet
|
||||
Mockito.doNothing().when(quotaAlertManager).sendQuotaAlert(Mockito.any(QuotaAlertManagerImpl.DeferredQuotaEmail.class));
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ public class QuotaManagerImplTest extends TestCase {
|
|||
quotaListForAccount.add(quotaUsageVO);
|
||||
|
||||
quotaManager.processQuotaBalanceForAccount(accountVO, quotaListForAccount);
|
||||
Mockito.verify(quotaAcc, Mockito.times(1)).persist(Mockito.any(QuotaAccountVO.class));
|
||||
Mockito.verify(quotaAcc, Mockito.times(1)).persistQuotaAccount(Mockito.any(QuotaAccountVO.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -197,7 +197,7 @@ public class QuotaManagerImplTest extends TestCase {
|
|||
quotaManager.updateQuotaDiskUsage(usageVO, new BigDecimal(0.5), UsageTypes.VOLUME);
|
||||
quotaManager.updateQuotaRaw(usageVO, new BigDecimal(0.5), UsageTypes.VPN_USERS);
|
||||
|
||||
Mockito.verify(quotaUsageDao, Mockito.times(4)).persist(Mockito.any(QuotaUsageVO.class));
|
||||
Mockito.verify(usageDao, Mockito.times(4)).persist(Mockito.any(UsageVO.class));
|
||||
Mockito.verify(quotaUsageDao, Mockito.times(4)).persistQuotaUsage(Mockito.any(QuotaUsageVO.class));
|
||||
Mockito.verify(usageDao, Mockito.times(4)).persistUsage(Mockito.any(UsageVO.class));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue