NetworkApi netApi = api.getNetworkApiForZone(zoneId);
Reference net = netApi.create("jclouds-test");
assertNotNull(net);
Network network = netApi.get(net.getId());
NetworkDetails details = netApi.getDetails(net.getId());
for(Network checkme : ImmutableList.of(network, details)) {
assertEquals(checkme.getId(), net.getId());
assertEquals(checkme.getName(), "jclouds-test");
}
assertTrue(details.getPorts().isEmpty());
assertTrue(netApi.rename(net.getId(), "jclouds-live-test"));
// Grab the updated metadata
network = netApi.get(net.getId());
details = netApi.getDetails(net.getId());
for(Network checkme : ImmutableList.of(network, details)) {
assertEquals(checkme.getId(), net.getId());
assertEquals(checkme.getName(), "jclouds-live-test");
}
assertTrue(details.getPorts().isEmpty());
Reference net2 = netApi.create("jclouds-test2");
assertNotNull(net2);
assertTrue(netApi.delete(net.getId()));