Package org.apache.cloudstack.iam.server

Examples of org.apache.cloudstack.iam.server.IAMGroupVO


        doNothing().when(_accountMgr).checkAccess(caller, callerDomain);
    }

    @Test
    public void createIAMGroupTest() {
        IAMGroup group = new IAMGroupVO("group1", "tester group1");
        List<IAMGroup> groups = new ArrayList<IAMGroup>();
        groups.add(group);
        Pair<List<IAMGroup>, Integer> grpList = new Pair<List<IAMGroup>, Integer>(groups, 1);
        when(_iamSrv.createIAMGroup("group1", "tester group1", callerDomainPath)).thenReturn(group);
        when(_iamSrv.listIAMGroups(null, null, callerDomainPath, 0L, 20L)).thenReturn(grpList);
View Full Code Here


        assertTrue("failed to delete acl group 1", _aclSrv.deleteIAMGroup(1L));
    }

    @Test
    public void listIAMGroupTest() {
        IAMGroup group = new IAMGroupVO("group1", "tester group1");
        List<IAMGroup> groups = new ArrayList<IAMGroup>();
        groups.add(group);
        when(_iamSrv.listIAMGroups(callerId)).thenReturn(groups);
        List<IAMGroup> grps = _aclSrv.listIAMGroups(callerId);
        assertTrue(grps != null && grps.size() == 1);
View Full Code Here

        assertEquals("Error to retrieve group", "group1", grp.getName());
    }

    @Test
    public void addRemoveAccountToGroupTest() {
        IAMGroup group = new IAMGroupVO("group1", "tester group1");
        List<IAMGroup> groups = new ArrayList<IAMGroup>();
        groups.add(group);
        Long groupId = group.getId();
        List<Long> acctIds = new ArrayList<Long>();
        AccountVO acct1 = new AccountVO(100L);
        acct1.setAccountName("account1");
        AccountVO acct2 = new AccountVO(200L);
        acct2.setAccountName("account2");
View Full Code Here

        assertEquals("Error to retrieve group", "policy1", p.getName());
    }

    @Test
    public void addRemovePolicyToGroupTest() {
        IAMGroup group = new IAMGroupVO("group1", "tester group1");
        List<IAMGroup> groups = new ArrayList<IAMGroup>();
        groups.add(group);
        Long groupId = group.getId();
        List<Long> policyIds = new ArrayList<Long>();
        policyIds.add(100L);
        policyIds.add(200L);
        IAMPolicy policy1 = new IAMPolicyVO("policy1", "my first policy");
        IAMPolicy policy2 = new IAMPolicyVO("policy2", "my second policy");
View Full Code Here

    }

    @Before
    public void setUp() {
        ComponentContext.initComponentsLifeCycle();
        IAMGroupVO group = new IAMGroupVO("group1", "my first group");
        Mockito.when(_aclGroupDao.persist(Mockito.any(IAMGroupVO.class))).thenReturn(group);
        List<IAMGroupVO> groups = new ArrayList<IAMGroupVO>();
        groups.add(group);
        when(_aclGroupDao.search(Mockito.any(SearchCriteria.class), Mockito.any(com.cloud.utils.db.Filter.class)))
                .thenReturn(groups);
View Full Code Here

    @Test(expected = InvalidParameterValueException.class)
    public void createAclGroupTest() {
        IAMGroup group = _iamService.createIAMGroup("group1", "my first group", "/root/mydomain");
        assertNotNull("Acl group 'group1' failed to create ", group);

        IAMGroupVO group2 = new IAMGroupVO("group1", "my second group");
        when(_aclGroupDao.findByName(eq("/root/mydomain"), eq("group1"))).thenReturn(group2);

        IAMGroup group3 = _iamService.createIAMGroup("group1", "my first group", "/root/mydomain");
    }
View Full Code Here

    }

    @Test
    public void accountGroupMaptest() {
        // create group
        IAMGroupVO group = new IAMGroupVO("group1", "my first group");

        // add account to group
        List<Long> accountIds = new ArrayList<Long>();
        accountIds.add(100L);
        when(_aclGroupDao.findById(20L)).thenReturn(group);
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.iam.server.IAMGroupVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.