Source:
<code><START> public void testAddFromConfiguration() throws Exception { <END> setUriInfo(setUpGetMatrixConstraintsExpectations(BackendHostResource.REGENERATE_CONSTRAINT, false, "false", setUpBasicUriExpectations(), false)); setUpGetPayloadExpectations(1, 2); setUpGetBallooningExpectations(1, 2); setUpGetCertuficateExpectations(1, 2); setUpGetConsoleExpectations(new int[]{2}); setUpGetVirtioScsiExpectations(new int[]{2}); VM model = createModel(null); org.ovirt.engine.core.common.businessentities.VM returnedVM = getEntity(2); model.setInitialization(new Initialization()); model.getInitialization().setConfiguration(new Configuration()); model.getInitialization().getConfiguration().setData("asdasdasd"); model.getInitialization().getConfiguration().setType("ovf"); setUpGetEntityExpectations(VdcQueryType.GetVmFromConfiguration, GetVmFromConfigurationQueryParameters.class, new String[] { "VmConfiguration", "ConfigurationType" }, new Object[] { model.getInitialization().getConfiguration().getData(), ConfigurationType.OVF}, returnedVM); setUpCreationExpectations(VdcActionType.ImportVmFromConfiguration, ImportVmParameters.class, new String[] { "Vm", "VdsGroupId", "ImportAsNewEntity"}, new Object[] { returnedVM, Guid.createGuidFromString(model.getCluster().getId()), false}, true, true, GUIDS[2], VdcQueryType.GetVmByVmId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[2] }, returnedVM); Response response = collection.add(model); assertEquals(201, response.getStatus()); assertTrue(response.getEntity() instanceof VM); verifyModel((VM) response.getEntity(), 2); }</code><technical_language>i right check for matrix param in request of create ovf</technical_language>

Target:
public void testAddFromConfiguration() throws Exception { setUriInfo(setUpBasicUriExpectations()); setUpGetPayloadExpectations(1, 2); setUpGetBallooningExpectations(1, 2); setUpGetCertuficateExpectations(1, 2); setUpGetConsoleExpectations(new int[]{2}); setUpGetVmOvfExpectations(new int[]{2}); setUpGetVirtioScsiExpectations(new int[]{2}); VM model = createModel(null); org.ovirt.engine.core.common.businessentities.VM returnedVM = getEntity(2); model.setInitialization(new Initialization()); model.getInitialization().setConfiguration(new Configuration()); model.getInitialization().getConfiguration().setData("asdasdasd"); model.getInitialization().getConfiguration().setType("ovf"); setUpGetEntityExpectations(VdcQueryType.GetVmFromConfiguration, GetVmFromConfigurationQueryParameters.class, new String[] { "VmConfiguration", "ConfigurationType" }, new Object[] { model.getInitialization().getConfiguration().getData(), ConfigurationType.OVF}, returnedVM); setUpCreationExpectations(VdcActionType.ImportVmFromConfiguration, ImportVmParameters.class, new String[] { "Vm", "VdsGroupId", "ImportAsNewEntity"}, new Object[] { returnedVM, Guid.createGuidFromString(model.getCluster().getId()), false}, true, true, GUIDS[2], VdcQueryType.GetVmByVmId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[2] }, returnedVM); Response response = collection.add(model); assertEquals(201, response.getStatus()); assertTrue(response.getEntity() instanceof VM); verifyModel((VM) response.getEntity(), 2); }