@Override protected MapSqlParameterSource createFullParametersMapper(DiskProfile obj) { MapSqlParameterSource map = super.createFullParametersMapper(obj); map.addValue("storage_domain_id", obj.getStorageDomainId()); return map; }
@Override protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("storageDomainId", getStorageDomainId()); } }
static org.ovirt.engine.core.common.businessentities.profiles.DiskProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getStorageDomainId()).thenReturn(GUIDS[index]); return entity; } }
static org.ovirt.engine.core.common.businessentities.profiles.DiskProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getStorageDomainId()).thenReturn(GUIDS[index]); return entity; } }
static org.ovirt.engine.core.common.businessentities.profiles.DiskProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getStorageDomainId()).thenReturn(GUIDS[index]); return entity; } }
private void checkResults(List<DiskProfile> result) { assertNotNull(result); assertEquals(2, result.size()); for (DiskProfile diskProfile : result) { assertEquals(FixturesTool.STORAGE_DOMAIN_SCALE_SD5, diskProfile.getStorageDomainId()); } }
@Mapping(from = org.ovirt.engine.core.common.businessentities.profiles.DiskProfile.class, to = DiskProfile.class) public static DiskProfile map(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity, DiskProfile template) { DiskProfile model = template != null ? template : new DiskProfile(); if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getDescription() != null) { model.setDescription(entity.getDescription()); } if (entity.getStorageDomainId() != null) { model.setStorageDomain(new StorageDomain()); model.getStorageDomain().setId(entity.getStorageDomainId().toString()); } if (entity.getQosId() != null) { model.setQos(new Qos()); model.getQos().setId(entity.getQosId().toString()); } return model; } }