Github user agneya2001 commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1350#discussion_r51006727
  
    --- Diff: 
framework/quota/test/org/apache/cloudstack/quota/QuotaManagerImplTest.java ---
    @@ -197,4 +197,58 @@ public void testProcessQuotaBalanceForAccount() {
             Mockito.verify(quotaAcc, 
Mockito.times(1)).persistQuotaAccount(Mockito.any(QuotaAccountVO.class));
         }
     
    +    @Test
    +    public void testAdminLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(2L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_ADMIN);
    +        assertFalse(quotaManager.isLockable(accountVO));
    +    }
    +
    +    @Test
    +    public void testNormalLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(3L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_NORMAL);
    +        assertTrue(quotaManager.isLockable(accountVO));
    +    }
    +
    +    @Test
    +    public void tesDomainAdmingLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(5L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_DOMAIN_ADMIN);
    +        assertTrue(quotaManager.isLockable(accountVO));
    +    }
    +
    +    @Test
    +    public void testReadOnlyAdminLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(6L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_READ_ONLY_ADMIN);
    +        assertFalse(quotaManager.isLockable(accountVO));
    +    }
    +
    +    @Test
    +    public void testResourceDomainAdminLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(7L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN);
    +        assertFalse(quotaManager.isLockable(accountVO));
    +    }
    +
    +    @Test
    +    public void testProjectLockableAccount() {
    +        AccountVO accountVO = new AccountVO();
    +        accountVO.setId(7L);
    +        accountVO.setDomainId(1L);
    +        accountVO.setType(Account.ACCOUNT_TYPE_PROJECT);
    +        assertFalse(quotaManager.isLockable(accountVO));
    --- End diff --
    
    @bhaisaab I don't agree with the change as it impacts simplicity and 
quality. All the three lines that you are asking me have a data element that 
will become a function parameter, I am not sure how it will simplify or result 
in enhanced quality.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to