use of org.apache.cloudstack.iam.server.IAMGroupVO in project cloudstack by apache.
the class IAMApiServiceTest method listIAMGroupTest.
@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);
IAMGroup grp = grps.get(0);
assertEquals("Error to retrieve group", "group1", grp.getName());
}
use of org.apache.cloudstack.iam.server.IAMGroupVO in project cloudstack by apache.
the class IAMServiceUnitTest method accountGroupMaptest.
@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);
_iamService.addAccountsToGroup(accountIds, 20L);
_iamService.removeAccountsFromGroup(accountIds, 20L);
}
Aggregations