@Test public void testAttachedStorageDomainLinks() throws Exception { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(STORAGE_DOMAIN_ID); storageDomain.setDataCenter(new DataCenter()); storageDomain.getDataCenter().setId(DATA_CENTER_ID); LinkHelper.addLinks(storageDomain); assertEquals(ATTACHED_STORAGE_DOMAIN_HREF, storageDomain.getHref()); }
@Test public void testStorageDomainLinks() throws Exception { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(STORAGE_DOMAIN_ID); storageDomain.setStorage(new HostStorage()); storageDomain.getStorage().setPath("foo"); LinkHelper.addLinks(storageDomain); assertEquals(STORAGE_DOMAIN_HREF, storageDomain.getHref()); assertNull(storageDomain.getStorage().getHref()); }