public static void validateAdd(DataCenter dataCenter) { if (dataCenter == null) { throw new ValidationException("Parameter 'data_center' is mandatory but was not provided."); } if (dataCenter.isLocal()==null) { throw new ValidationException("Parameter 'data_center.local' is mandatory but was not provided."); } if (dataCenter.getName()==null) { throw new ValidationException("Parameter 'data_center.name' is mandatory but was not provided."); } }
static void verifyModelSpecific(DataCenter model, int index) { assertEquals(false, model.isLocal()); assertFalse(model.getLinks().isEmpty()); Link link = getLinkByName(model, "permissions"); assertNotNull(link); assertEquals(BASE_PATH + "/datacenters/" + GUIDS[index] + "/permissions", link.getHref()); assertTrue(model.isSetSupportedVersions()); assertEquals(1, model.getSupportedVersions().getVersions().size()); assertEquals(2, model.getSupportedVersions().getVersions().get(0).getMajor().intValue()); assertEquals(3, model.getSupportedVersions().getVersions().get(0).getMinor().intValue()); } }
@Override protected void verify(DataCenter model, DataCenter transform) { assertNotNull(transform); assertEquals(model.getName(), transform.getName()); assertEquals(model.getId(), transform.getId()); assertEquals(model.getDescription(), transform.getDescription()); assertEquals(model.getComment(), transform.getComment()); assertEquals(model.isLocal(), transform.isLocal()); assertEquals(model.getStorageFormat(), transform.getStorageFormat()); assertEquals(model.getMacPool().getId(), transform.getMacPool().getId()); assertEquals(model.getQuotaMode(), transform.getQuotaMode()); }
to.setLocal(from.isLocal());
entity.setIsLocal(model.isLocal());