use of org.apache.cloudstack.api.command.admin.vm.ListUnmanagedInstancesCmd in project cloudstack by apache.
the class UnmanagedVMsManagerImplTest method listUnmanagedInstancesInvalidHypervisorTest.
@Test(expected = InvalidParameterValueException.class)
public void listUnmanagedInstancesInvalidHypervisorTest() {
ListUnmanagedInstancesCmd cmd = Mockito.mock(ListUnmanagedInstancesCmd.class);
ClusterVO cluster = new ClusterVO(1, 1, "Cluster");
cluster.setHypervisorType(Hypervisor.HypervisorType.KVM.toString());
when(clusterDao.findById(Mockito.anyLong())).thenReturn(cluster);
unmanagedVMsManager.listUnmanagedInstances(cmd);
}
use of org.apache.cloudstack.api.command.admin.vm.ListUnmanagedInstancesCmd in project cloudstack by apache.
the class UnmanagedVMsManagerImplTest method listUnmanagedInstancesInvalidCallerTest.
@Test(expected = PermissionDeniedException.class)
public void listUnmanagedInstancesInvalidCallerTest() {
CallContext.unregister();
AccountVO account = new AccountVO("user", 1L, "", Account.ACCOUNT_TYPE_NORMAL, "uuid");
UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString(), User.Source.UNKNOWN);
CallContext.register(user, account);
ListUnmanagedInstancesCmd cmd = Mockito.mock(ListUnmanagedInstancesCmd.class);
unmanagedVMsManager.listUnmanagedInstances(cmd);
}
use of org.apache.cloudstack.api.command.admin.vm.ListUnmanagedInstancesCmd in project cloudstack by apache.
the class UnmanagedVMsManagerImplTest method listUnmanagedInstancesTest.
@Test
public void listUnmanagedInstancesTest() {
ListUnmanagedInstancesCmd cmd = Mockito.mock(ListUnmanagedInstancesCmd.class);
unmanagedVMsManager.listUnmanagedInstances(cmd);
}
Aggregations