use of org.apache.cloudstack.api.command.admin.template.CopyTemplateCmdByAdmin in project cloudstack by apache.
the class CopyTemplateCmdByAdminTest method testDestZoneidAndDestZoneIdListBothPresent.
@Test
public void testDestZoneidAndDestZoneIdListBothPresent() throws ResourceAllocationException {
try {
copyTemplateCmdByAdmin = new CopyTemplateCmdByAdmin();
copyTemplateCmdByAdmin.destZoneId = -1L;
copyTemplateCmdByAdmin.destZoneIds = new ArrayList<>();
copyTemplateCmdByAdmin.destZoneIds.add(-1L);
copyTemplateCmdByAdmin.execute();
} catch (ServerApiException e) {
if (e.getErrorCode() != ApiErrorCode.PARAM_ERROR) {
Assert.fail("Api should fail when both destzoneid and destzoneids are passed");
}
}
}
use of org.apache.cloudstack.api.command.admin.template.CopyTemplateCmdByAdmin in project cloudstack by apache.
the class CopyTemplateCmdByAdminTest method testZoneidAndZoneIdListEmpty.
@Test
public void testZoneidAndZoneIdListEmpty() throws ResourceAllocationException {
try {
copyTemplateCmdByAdmin = new CopyTemplateCmdByAdmin();
copyTemplateCmdByAdmin.execute();
} catch (ServerApiException e) {
if (e.getErrorCode() != ApiErrorCode.PARAM_ERROR) {
Assert.fail("API should fail when no parameters are passed.");
}
}
}
Aggregations