예제 #1
0
  @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());
  }
예제 #2
0
  @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());
  }