Search in sources :

Example 6 with RegisterTemplateCmdByAdmin

use of org.apache.cloudstack.api.command.admin.template.RegisterTemplateCmdByAdmin in project cloudstack by apache.

the class RegisterTemplateCmdByAdminTest method testZoneidAndZoneIdListEmpty.

@Test
public void testZoneidAndZoneIdListEmpty() throws ResourceAllocationException {
    try {
        registerTemplateCmdByAdmin = new RegisterTemplateCmdByAdmin();
        registerTemplateCmdByAdmin.execute();
    } catch (ServerApiException e) {
        if (e.getErrorCode() != ApiErrorCode.PARAM_ERROR) {
            Assert.fail("Api should fail when both zoneid and zoneids aren't passed");
        }
    }
}
Also used : ServerApiException(org.apache.cloudstack.api.ServerApiException) RegisterTemplateCmdByAdmin(org.apache.cloudstack.api.command.admin.template.RegisterTemplateCmdByAdmin) Test(org.junit.Test)

Aggregations

RegisterTemplateCmdByAdmin (org.apache.cloudstack.api.command.admin.template.RegisterTemplateCmdByAdmin)6 Test (org.junit.Test)6 ServerApiException (org.apache.cloudstack.api.ServerApiException)3