Search in sources :

Example 6 with ResourceService

use of com.cloud.resource.ResourceService in project cloudstack by apache.

the class AddClusterCmdTest method testExecuteForEmptyResult.

@Test
public void testExecuteForEmptyResult() {
    ResourceService resourceService = Mockito.mock(ResourceService.class);
    addClusterCmd._resourceService = resourceService;
    try {
        addClusterCmd.execute();
    } catch (ServerApiException exception) {
        Assert.assertEquals("Failed to add cluster", exception.getDescription());
    }
}
Also used : ServerApiException(org.apache.cloudstack.api.ServerApiException) ResourceService(com.cloud.resource.ResourceService) Test(org.junit.Test)

Aggregations

ResourceService (com.cloud.resource.ResourceService)6 Test (org.junit.Test)4 ResponseGenerator (org.apache.cloudstack.api.ResponseGenerator)3 ServerApiException (org.apache.cloudstack.api.ServerApiException)3 DiscoveryException (com.cloud.exception.DiscoveryException)2 Before (org.junit.Before)2 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 ResourceInUseException (com.cloud.exception.ResourceInUseException)1 Cluster (com.cloud.org.Cluster)1 ManagementService (com.cloud.server.ManagementService)1 AddHostCmd (org.apache.cloudstack.api.command.admin.host.AddHostCmd)1 UpdateHostPasswordCmd (org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd)1