diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java index 6888a58268..bad677580c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgEmailSettings.java @@ -73,13 +73,11 @@ import com.google.common.collect.ImmutableList; "fromEmailAddress", "defaultSubjectPrefix", "isAlertEmailToAllAdmins", - "alertEmailsTo", + "alertEmailTo", "smtpServerSettings" }) public class OrgEmailSettings extends ResourceType { - // FIXME Should it be getAlertEmailsTo or getAlertEmailTo - public static Builder builder() { return new ConcreteBuilder(); } @@ -144,8 +142,8 @@ public class OrgEmailSettings extends ResourceType { /** * @see OrgEmailSettings#getAlertEmailTo() */ - public B alertEmailsTo(List alertEmailsTo) { - this.alertEmailTo = alertEmailsTo == null ? null : ImmutableList.copyOf(alertEmailsTo); + public B alertEmailTo(List alertEmailTo) { + this.alertEmailTo = alertEmailTo == null ? null : ImmutableList.copyOf(alertEmailTo); return self(); } @@ -176,7 +174,7 @@ public class OrgEmailSettings extends ResourceType { .fromEmailAddress(in.getFromEmailAddress()) .defaultSubjectPrefix(in.getDefaultSubjectPrefix()) .isAlertEmailToAllAdmins(in.isAlertEmailToAllAdmins()) - .alertEmailsTo(in.getAlertEmailsTo()) + .alertEmailTo(in.getAlertEmailTo()) .smtpServerSettings(in.getSmtpServerSettings()); } } @@ -281,7 +279,7 @@ public class OrgEmailSettings extends ResourceType { * * */ - public List getAlertEmailsTo() { + public List getAlertEmailTo() { return this.alertEmailTo; } @@ -334,7 +332,7 @@ public class OrgEmailSettings extends ResourceType { .add("fromEmailAddress", fromEmailAddress) .add("defaultSubjectPrefix", defaultSubjectPrefix) .add("isAlertEmailToAllAdmins", isAlertEmailToAllAdmins) - .add("alertEmailsTo", alertEmailTo) + .add("alertEmailTo", alertEmailTo) .add("smtpServerSettings", smtpServerSettings); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Reference.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Reference.java index 4b0a3e42b6..33e6fb920a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Reference.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Reference.java @@ -23,9 +23,8 @@ import static com.google.common.base.Objects.equal; import java.net.URI; import java.util.Map; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; import org.jclouds.logging.Logger; @@ -43,7 +42,10 @@ import com.google.common.base.Objects.ToStringHelper; * * @author grkvlt@apache.org */ -@XmlAccessorType(XmlAccessType.FIELD) +@XmlSeeAlso({ + CatalogReference.class +}) +//@XmlAccessorType(XmlAccessType.FIELD) public class Reference { @javax.annotation.Resource diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java index 7675c1447b..2a69243b80 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java @@ -132,7 +132,18 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx .xmlFilePayload("/catalog/admin/owner.xml", VCloudDirectorMediaType.OWNER) .httpResponseBuilder().build()); - Owner expected = owner(); + Owner expected = owner().toBuilder() + .link(Link.builder() + .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")) + .type("application/vnd.vmware.vcloud.catalog+xml") + .rel("up") + .build()) + .link(Link.builder() + .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/owner")) + .type("application/vnd.vmware.vcloud.owner+xml") + .rel("edit") + .build()) + .build(); assertEquals(client.getAdminCatalogClient().getOwner(catalogRef.getHref()), expected); } @@ -345,7 +356,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx .isPublished(false) .build(); } - + private static Owner owner() { return Owner.builder() .type("application/vnd.vmware.vcloud.owner+xml") diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientExpectTest.java index 07d253ce55..5df76ae595 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MediaClientExpectTest.java @@ -358,7 +358,13 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes .xmlFilePayload("/media/owner.xml", VCloudDirectorMediaType.OWNER) .httpResponseBuilder().build()); - Owner expected = owner(); + Owner expected = owner().toBuilder() + .link(Link.builder() + .rel("up") + .type("application/vnd.vmware.vcloud.media+xml") + .href(URI.create("https://mycloud.greenhousedata.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1")) + .build()) + .build(); assertEquals(client.getMediaClient().getOwner(mediaUri), expected); } diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java index 641012a02c..e1ee390566 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java @@ -67,7 +67,7 @@ import com.google.common.collect.Multimaps; @Test(groups = { "unit", "user", "vapp" }, singleThreaded = true, testName = "VAppClientExpectTest") public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest { - private String vAppId = ""; + private String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be"; private URI vAppURI = URI.create(endpoint + vAppId); @BeforeClass @@ -79,7 +79,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest VCloudDirectorClient client = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer() .apiCommand("GET", vAppId) - .acceptAnyMedia() + .acceptMedia(VCloudDirectorMediaType.VAPP) .httpRequestBuilder().build(), new VcloudHttpResponsePrimer() .xmlFilePayload("/vApp/vApp.xml", VCloudDirectorMediaType.VAPP) @@ -1084,9 +1084,26 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest } public static VApp getVApp() { + // FIXME Does not match XML VApp vApp = VApp.builder() + .href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be")) +// .link(Link.builder() +// .href(URI.create()) +// .build()) .build(); +// +// +// +// +// +// +// +// +// +// +// + return vApp; } @@ -1496,4 +1513,4 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest return task; } -} \ No newline at end of file +}