@Test public void testVmIdsReplacement() { AffinityGroup model = new AffinityGroup(); Vm vm = new Vm(); final Guid vmGuid = Guid.newGuid(); vm.setId(vmGuid.toString()); model.setVms(new Vms()); model.getVms().getVms().add(vm); org.ovirt.engine.core.common.scheduling.AffinityGroup entity = new org.ovirt.engine.core.common.scheduling.AffinityGroup(); entity.getVdsIds().add(Guid.newGuid()); AffinityGroupMapper.map(model, entity); assertEquals(vmGuid, entity.getVmIds().get(0)); assertEquals(1, entity.getVmIds().size()); }
if (vms == null) { vms = new Vms(); model.setVms(vms);
@Test public void testVmIds() { AffinityGroup model = new AffinityGroup(); Vm vm = new Vm(); final Guid vmGuid = Guid.newGuid(); vm.setId(vmGuid.toString()); model.setVms(new Vms()); model.getVms().getVms().add(vm); org.ovirt.engine.core.common.scheduling.AffinityGroup entity = new org.ovirt.engine.core.common.scheduling.AffinityGroup(); AffinityGroupMapper.map(model, entity); assertEquals(vmGuid, entity.getVmIds().get(0)); }