This commit is contained in:
Andrew Donald Kennedy 2012-02-10 13:28:35 +00:00
parent 3f8bf7e746
commit 28b7309b03
14 changed files with 74 additions and 76 deletions

View File

@ -30,8 +30,6 @@ import javax.xml.bind.annotation.XmlElement;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
/** /**

View File

@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import java.util.Set; import java.util.Set;
@ -36,7 +36,7 @@ import com.google.common.collect.Sets;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "IpAddresses") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpAddresses")
public class IpAddresses { public class IpAddresses {
public static Builder builder() { public static Builder builder() {
@ -83,7 +83,7 @@ public class IpAddresses {
this.ipAddresses = ImmutableSet.copyOf(orgs); this.ipAddresses = ImmutableSet.copyOf(orgs);
} }
@XmlElement(namespace = NS, name = "IpAddress") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IpAddress")
private Set<String> ipAddresses = Sets.newLinkedHashSet(); private Set<String> ipAddresses = Sets.newLinkedHashSet();
public Set<String> getIpAddresses() { public Set<String> getIpAddresses() {

View File

@ -16,10 +16,10 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@ -31,7 +31,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "IpRange") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpRange")
public class IpRange { public class IpRange {
public static Builder builder() { public static Builder builder() {
@ -82,9 +82,9 @@ public class IpRange {
} }
@XmlElement(namespace = NS, name = "StartAddress") @XmlElement(namespace = VCLOUD_1_5_NS, name = "StartAddress")
private String startAddress; private String startAddress;
@XmlElement(namespace = NS, name = "EndAddress") @XmlElement(namespace = VCLOUD_1_5_NS, name = "EndAddress")
private String endAddress; private String endAddress;
/** /**

View File

@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import java.util.Set; import java.util.Set;
@ -36,7 +36,7 @@ import com.google.common.collect.Sets;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "IpRanges") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpRanges")
public class IpRanges { public class IpRanges {
public static Builder builder() { public static Builder builder() {
@ -83,7 +83,7 @@ public class IpRanges {
this.ipRanges = ImmutableSet.copyOf(ipRanges); this.ipRanges = ImmutableSet.copyOf(ipRanges);
} }
@XmlElement(namespace = NS, name = "IpRange") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IpRange")
private Set<IpRange> ipRanges = Sets.newLinkedHashSet(); private Set<IpRange> ipRanges = Sets.newLinkedHashSet();
public Set<IpRange> getIpRanges() { public Set<IpRange> getIpRanges() {

View File

@ -19,7 +19,7 @@
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -33,7 +33,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "IpScope") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpScope")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class IpScope { public class IpScope {
@ -151,21 +151,21 @@ public class IpScope {
this.isInherited = isInherited; this.isInherited = isInherited;
} }
@XmlElement(namespace = NS, name = "IsInherited") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IsInherited")
private boolean isInherited; private boolean isInherited;
@XmlElement(namespace = NS, name = "Gateway") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Gateway")
private String gateway; private String gateway;
@XmlElement(namespace = NS, name = "Netmask") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Netmask")
private String netmask; private String netmask;
@XmlElement(namespace = NS, name = "Dns1") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Dns1")
private String dns1; private String dns1;
@XmlElement(namespace = NS, name = "Dns2") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Dns2")
private String dns2; private String dns2;
@XmlElement(namespace = NS, name = "DnsSuffix") @XmlElement(namespace = VCLOUD_1_5_NS, name = "DnsSuffix")
private String dnsSuffix; private String dnsSuffix;
@XmlElement(namespace = NS, name = "IpRanges") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IpRanges")
private IpRanges ipRanges; private IpRanges ipRanges;
@XmlElement(namespace = NS, name = "AllocatedIpAddresses") @XmlElement(namespace = VCLOUD_1_5_NS, name = "AllocatedIpAddresses")
private IpAddresses allocatedIpAddresses; private IpAddresses allocatedIpAddresses;
/** /**

View File

@ -19,7 +19,7 @@
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -33,7 +33,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "NetworkConfiguration") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "NetworkConfiguration")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class NetworkConfiguration{ public class NetworkConfiguration{
@ -138,19 +138,19 @@ public class NetworkConfiguration{
this.fenceMode = fenceMode; this.fenceMode = fenceMode;
} }
@XmlElement(namespace = NS, name = "IpScope") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IpScope")
private IpScope ipScope; private IpScope ipScope;
@XmlElement(namespace = NS, name = "ParentNetwork") @XmlElement(namespace = VCLOUD_1_5_NS, name = "ParentNetwork")
private ReferenceType<?> parentNetwork; private ReferenceType<?> parentNetwork;
@XmlElement(namespace = NS, name = "FenceMode") @XmlElement(namespace = VCLOUD_1_5_NS, name = "FenceMode")
private String fenceMode; private String fenceMode;
@XmlElement(namespace = NS, name = "RetainNetInfoAcrossDeployments") @XmlElement(namespace = VCLOUD_1_5_NS, name = "RetainNetInfoAcrossDeployments")
private boolean retainNetInfoAcrossDeployments = false; private boolean retainNetInfoAcrossDeployments = false;
@XmlElement(namespace = NS, name = "Features") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Features")
private NetworkFeatures features; private NetworkFeatures features;
@XmlElement(namespace = NS, name = "SyslogServerSettings") @XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerSettings")
private SyslogServerSettings syslogServerSettings; private SyslogServerSettings syslogServerSettings;
@XmlElement(namespace = NS, name = "RouterInfo") @XmlElement(namespace = VCLOUD_1_5_NS, name = "RouterInfo")
private RouterInfo routerInfo; private RouterInfo routerInfo;
/** /**

View File

@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import java.util.Set; import java.util.Set;
@ -36,7 +36,7 @@ import com.google.common.collect.Sets;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "Features") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Features")
public class NetworkFeatures { public class NetworkFeatures {
public static Builder builder() { public static Builder builder() {
@ -82,7 +82,7 @@ public class NetworkFeatures {
// For JAXB and builder use // For JAXB and builder use
} }
@XmlElement(namespace = NS, name = "NetworkService") @XmlElement(namespace = VCLOUD_1_5_NS, name = "NetworkService")
private Set<NetworkService> services = Sets.newLinkedHashSet(); private Set<NetworkService> services = Sets.newLinkedHashSet();
/** /**

View File

@ -19,7 +19,7 @@
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@ -31,7 +31,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "NetworkService") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "NetworkService")
public class NetworkService { public class NetworkService {
public static Builder builder() { public static Builder builder() {
@ -69,7 +69,7 @@ public class NetworkService {
// For JAXB and builder use // For JAXB and builder use
} }
@XmlElement(namespace = NS, name = "IsEnabled") @XmlElement(namespace = VCLOUD_1_5_NS, name = "IsEnabled")
private boolean isEnabled; private boolean isEnabled;
/** /**

View File

@ -18,9 +18,9 @@
*/ */
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.*;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.*;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
@ -28,13 +28,11 @@ import java.util.Set;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.ovf.Network;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@XmlRootElement(namespace = NS, name = "OrgNetwork") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "OrgNetwork")
public class OrgNetwork extends EntityType<OrgNetwork> { public class OrgNetwork extends EntityType<OrgNetwork> {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -54,7 +52,7 @@ public class OrgNetwork extends EntityType<OrgNetwork> {
private IpAddresses allowedExternalIpAddresses; private IpAddresses allowedExternalIpAddresses;
/** /**
* @see Network#getConfiguration() * @see OrgNetwork#getConfiguration()
*/ */
public Builder configuration(NetworkConfiguration networkConfiguration) { public Builder configuration(NetworkConfiguration networkConfiguration) {
this.networkConfiguration = networkConfiguration; this.networkConfiguration = networkConfiguration;
@ -62,7 +60,7 @@ public class OrgNetwork extends EntityType<OrgNetwork> {
} }
/** /**
* @see Network#getNetworkPool() * @see OrgNetwork#getNetworkPool()
*/ */
public Builder networkPool(ReferenceType<?> networkPool) { public Builder networkPool(ReferenceType<?> networkPool) {
this.networkPool = networkPool; this.networkPool = networkPool;
@ -70,7 +68,7 @@ public class OrgNetwork extends EntityType<OrgNetwork> {
} }
/** /**
* @see Network#getAllowedExternalIpAddresses() * @see OrgNetwork#getAllowedExternalIpAddresses()
*/ */
public Builder allowedExternalIpAddresses(IpAddresses allowedExternalIpAddresses) { public Builder allowedExternalIpAddresses(IpAddresses allowedExternalIpAddresses) {
this.allowedExternalIpAddresses = allowedExternalIpAddresses; this.allowedExternalIpAddresses = allowedExternalIpAddresses;
@ -183,11 +181,11 @@ public class OrgNetwork extends EntityType<OrgNetwork> {
super(href, name); super(href, name);
} }
@XmlElement(namespace = NS, name = "Configuration") @XmlElement(namespace = VCLOUD_1_5_NS, name = "Configuration")
private NetworkConfiguration networkConfiguration; private NetworkConfiguration networkConfiguration;
@XmlElement(namespace = NS, name = "NetworkPool") @XmlElement(namespace = VCLOUD_1_5_NS, name = "NetworkPool")
private ReferenceType<?> networkPool; private ReferenceType<?> networkPool;
@XmlElement(namespace = NS, name = "AllowedExternalIpAddresses") @XmlElement(namespace = VCLOUD_1_5_NS, name = "AllowedExternalIpAddresses")
private IpAddresses allowedExternalIpAddresses; private IpAddresses allowedExternalIpAddresses;
/** /**

View File

@ -28,9 +28,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlAttribute;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Iterables;
/** /**
* A reference to a resource. * A reference to a resource.

View File

@ -31,7 +31,6 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;

View File

@ -19,7 +19,7 @@
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@ -31,7 +31,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "RouterInfo") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "RouterInfo")
public class RouterInfo { public class RouterInfo {
public static Builder builder() { public static Builder builder() {
return new Builder(); return new Builder();
@ -71,7 +71,7 @@ public class RouterInfo {
} }
@XmlElement(namespace = NS, name = "ExternalIp") @XmlElement(namespace = VCLOUD_1_5_NS, name = "ExternalIp")
private String externalIp; private String externalIp;
/** /**

View File

@ -19,7 +19,7 @@
package org.jclouds.vcloud.director.v1_5.domain; package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -34,7 +34,7 @@ import com.google.common.base.Objects;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(namespace = NS, name = "SyslogServerSettings") @XmlRootElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerSettings")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class SyslogServerSettings { public class SyslogServerSettings {
@ -83,9 +83,9 @@ public class SyslogServerSettings {
// For JAXB and builder use // For JAXB and builder use
} }
@XmlElement(namespace = NS, name = "SyslogServerIp1") @XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerIp1")
private String syslogServerIp1; private String syslogServerIp1;
@XmlElement(namespace = NS, name = "SyslogServerIp2") @XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerIp2")
private String syslogServerIp2; private String syslogServerIp2;
/** /**

View File

@ -18,7 +18,7 @@
*/ */
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.*;
import java.net.URI; import java.net.URI;
@ -33,6 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry; import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
import org.jclouds.vcloud.director.v1_5.domain.NetworkConfiguration; import org.jclouds.vcloud.director.v1_5.domain.NetworkConfiguration;
import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork; import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.SyslogServerSettings; import org.jclouds.vcloud.director.v1_5.domain.SyslogServerSettings;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest; import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -51,13 +52,13 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
getStandardRequest("GET", networkRef), getStandardRequest("GET", networkRef),
getStandardPayloadResponse("/network/network.xml", VCloudDirectorMediaType.ORG_NETWORK_XML)); getStandardPayloadResponse("/network/network.xml", VCloudDirectorMediaType.ORG_NETWORK));
OrgNetwork expected = OrgNetwork OrgNetwork expected = OrgNetwork
.builder() .builder()
.name("internet01-Jclouds") .name("internet01-Jclouds")
.id("urn:vcloud:network:55a677cf-ab3f-48ae-b880-fab90421980c") .id("urn:vcloud:network:55a677cf-ab3f-48ae-b880-fab90421980c")
.type(VCloudDirectorMediaType.ORG_NETWORK_XML) .type(VCloudDirectorMediaType.ORG_NETWORK)
.href(URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c")) .href(URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c"))
.link(Link.builder() .link(Link.builder()
.rel("up") .rel("up")
@ -96,12 +97,12 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
@Test @Test
public void testWhenResponseIs2xxLoginReturnsValidMetadata() { public void testWhenResponseIs2xxLoginReturnsValidMetadata() {
URI orgRef = URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c"); URI orgUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
URI metaRef = URI.create(orgRef.toASCIIString()+"/metadata/"); URI metaUri = URI.create(orgUri.toASCIIString() + "/metadata/");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
getStandardRequest("GET", metaRef), getStandardRequest("GET", metaUri),
getStandardPayloadResponse("/network/metadata.xml", VCloudDirectorMediaType.METADATA_XML)); getStandardPayloadResponse("/network/metadata.xml", VCloudDirectorMediaType.METADATA));
Metadata expected = Metadata.builder() Metadata expected = Metadata.builder()
.type("application/vnd.vmware.vcloud.metadata+xml") .type("application/vnd.vmware.vcloud.metadata+xml")
@ -113,21 +114,25 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
.build()) .build())
.build(); .build();
assertEquals(client.getOrgClient().getMetadata(orgRef), expected); // TODO change network client to use ReferenceType<?> params
Reference orgRef = Reference.builder().href(orgUri).build();
assertEquals(client.getNetworkClient().getMetadata(orgUri), expected);
} }
@Test(enabled=false) // No metadata in exemplar xml... @Test(enabled=false) // No metadata in exemplar xml...
public void testWhenResponseIs2xxLoginReturnsValidMetadataEntry() { public void testWhenResponseIs2xxLoginReturnsValidMetadataEntry() {
URI metadataRef = URI.create( URI metadataUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY");
"https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
getStandardRequest("GET", metadataRef), getStandardRequest("GET", metadataUri),
getStandardPayloadResponse("/network/metadata.xml", VCloudDirectorMediaType.METADATAENTRY_XML)); getStandardPayloadResponse("/network/metadata.xml", VCloudDirectorMediaType.METADATA_ENTRY));
MetadataEntry expected = MetadataEntry.builder() MetadataEntry expected = MetadataEntry.builder().build();
.build();
assertEquals(client.getOrgClient().getMetadataEntry(metadataRef), expected); // TODO change network client to use ReferenceType<?> params
Reference orgRef = Reference.builder().href(metadataUri).build();
assertEquals(client.getNetworkClient().getMetadataEntry(metadataUri), expected);
} }
} }