Search in sources :

Example 6 with IAMPolicyVO

use of org.apache.cloudstack.iam.server.IAMPolicyVO in project cloudstack by apache.

the class IAMServiceUnitTest method createAclPolicyTest.

@Test(expected = InvalidParameterValueException.class)
public void createAclPolicyTest() {
    IAMPolicy policy = _iamService.createIAMPolicy("policy1", "my first policy", null, "/root/mydomain");
    assertNotNull("Acl policy 'policy1' failed to create ", policy);
    IAMPolicyVO rvo = new IAMPolicyVO("policy2", "second policy");
    when(_aclPolicyDao.findByName(eq("policy2"))).thenReturn(rvo);
    _iamService.createIAMPolicy("policy2", "second policy", null, "/root/mydomain");
}
Also used : IAMPolicy(org.apache.cloudstack.iam.api.IAMPolicy) IAMPolicyVO(org.apache.cloudstack.iam.server.IAMPolicyVO) Test(org.junit.Test)

Aggregations

IAMPolicyVO (org.apache.cloudstack.iam.server.IAMPolicyVO)6 ArrayList (java.util.ArrayList)5 IAMPolicy (org.apache.cloudstack.iam.api.IAMPolicy)5 Test (org.junit.Test)5 Pair (com.cloud.utils.Pair)3 List (java.util.List)3 IAMPolicyResponse (org.apache.cloudstack.api.response.iam.IAMPolicyResponse)2 IAMGroupVO (org.apache.cloudstack.iam.server.IAMGroupVO)2 SearchCriteria (com.cloud.utils.db.SearchCriteria)1 VirtualMachine (com.cloud.vm.VirtualMachine)1 ListVMsCmd (org.apache.cloudstack.api.command.user.vm.ListVMsCmd)1 IAMGroupResponse (org.apache.cloudstack.api.response.iam.IAMGroupResponse)1 IAMPermissionResponse (org.apache.cloudstack.api.response.iam.IAMPermissionResponse)1 IAMGroup (org.apache.cloudstack.iam.api.IAMGroup)1 IAMPolicyPermission (org.apache.cloudstack.iam.api.IAMPolicyPermission)1 IAMPolicyPermissionVO (org.apache.cloudstack.iam.server.IAMPolicyPermissionVO)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 Filter (org.springframework.context.annotation.ComponentScan.Filter)1 TypeFilter (org.springframework.core.type.filter.TypeFilter)1