Make AclApiServiceTest pass without changing ApiServerService signature.

This commit is contained in:
Min Chen 2014-01-06 10:43:01 -08:00
parent 28b81e423e
commit e02e19a6f1
2 changed files with 3 additions and 2 deletions

View File

@ -36,5 +36,5 @@ public interface ApiServerService {
public String handleRequest(Map params, String responseType, StringBuffer auditTrailSb) throws ServerApiException;
public Class getCmdClass(String cmdName);
public Class<?> getCmdClass(String cmdName);
}

View File

@ -268,7 +268,8 @@ public class AclApiServiceTest {
policies.add(policy);
Long policyId = policy.getId();
Long resId = 200L;
when(_apiServer.getCmdClass("listVirtualMachines")).thenReturn(ListVMsCmd.class);
Class clz = ListVMsCmd.class;
when(_apiServer.getCmdClass("listVirtualMachines")).thenReturn(clz);
when(
_iamSrv.addAclPermissionToAclPolicy(policyId, AclEntityType.VirtualMachine.toString(), PermissionScope.RESOURCE.toString(), resId, "listVirtualMachines",
AccessType.ListEntry.toString(), Permission.Allow)).thenReturn(policy);