summaryrefslogtreecommitdiffstats
path: root/controlloop
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java26
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java87
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java61
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java57
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java49
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java14
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java31
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java50
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java20
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java31
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java50
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java42
-rw-r--r--controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java14
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java (renamed from controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipItemTest.java)47
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java128
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java104
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java75
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyItemTest.java50
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java40
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataItemTest.java45
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java41
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java60
-rw-r--r--controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java78
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json14
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json123
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json82
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json78
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json4
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json25
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json4
-rw-r--r--controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json68
31 files changed, 881 insertions, 717 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
index fa608ca08..2c1b6f628 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
@@ -26,11 +26,13 @@ import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
+import java.util.List;
import java.util.UUID;
import org.onap.policy.aai.AaiGetVnfResponse;
import org.onap.policy.aai.AaiGetVserverResponse;
import org.onap.policy.aai.AaiManager;
+import org.onap.policy.aai.AaiNqVServer;
import org.onap.policy.aai.util.AaiException;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopException;
@@ -708,12 +710,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
throw new AaiException("AAI Responded with a request error (query by " + queryTypeString + ")");
}
- if (aaiResponse.getIsClosedLoopDisabled() != null) {
- String value = aaiResponse.getIsClosedLoopDisabled();
- if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)
- || "Y".equalsIgnoreCase(value)) {
- throw new AaiException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")");
- }
+ if (aaiResponse.getIsClosedLoopDisabled()) {
+ throw new AaiException("is-closed-loop-disabled is set to true (query by " + queryTypeString + ")");
}
}
@@ -724,13 +722,15 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
if (aaiResponse.getRequestError() != null) {
throw new AaiException("AAI responded with a request error (query by vserver-name)");
}
-
- if (aaiResponse.getIsClosedLoopDisabled() != null) {
- String value = aaiResponse.getIsClosedLoopDisabled();
- if ("true".equalsIgnoreCase(value) || "T".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)
- || "Y".equalsIgnoreCase(value)) {
- throw new AaiException("is-closed-loop-disabled is set to true (query by vserver-name)");
- }
+
+ List<AaiNqVServer> lst = aaiResponse.getVserver();
+ if(lst.isEmpty()) {
+ return;
+ }
+
+ AaiNqVServer svr = lst.get(0);
+ if (svr.getIsClosedLoopDisabled()) {
+ throw new AaiException("is-closed-loop-disabled is set to true (query by vserver-name)");
}
}
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
index 711848167..37558474a 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -34,18 +33,16 @@ import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.HashMap;
import java.util.UUID;
-
import org.apache.commons.io.IOUtils;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.aai.AaiGetVnfResponse;
import org.onap.policy.aai.AaiGetVserverResponse;
+import org.onap.policy.aai.AaiNqVServer;
import org.onap.policy.aai.RelatedToProperty;
-import org.onap.policy.aai.RelatedToPropertyItem;
import org.onap.policy.aai.Relationship;
import org.onap.policy.aai.RelationshipData;
-import org.onap.policy.aai.RelationshipDataItem;
import org.onap.policy.aai.RelationshipList;
import org.onap.policy.aai.util.AaiException;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
@@ -308,43 +305,39 @@ public class ControlLoopEventManagerTest {
response.setVnfType("Basa-122216-Service/VidVsamp12BaseVolume 1");
response.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
response.setOrchestrationStatus("Created");
- response.setInMaint("false");
- response.setIsClosedLoopDisabled("false");
+ response.setInMaint(false);
+ response.setIsClosedLoopDisabled(false);
response.setResourceVersion("1494001988835");
response.setModelInvariantId("f18be3cd-d446-456e-9109-121d9b62feaa");
final RelationshipList relationshipList = new RelationshipList();
final Relationship relationship = new Relationship();
- RelationshipData relationshipData = new RelationshipData();
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
+ RelationshipData relationshipDataItem = new RelationshipData();
relationshipDataItem.setRelationshipKey("customer.global-customer-id");
relationshipDataItem.setRelationshipValue("MSO_1610_ST");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-subscription.service-type");
relationshipDataItem.setRelationshipValue("MSO-dev-service-type");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-instance.service-instance-id");
relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem item = new RelatedToPropertyItem();
+ RelatedToProperty item = new RelatedToProperty();
item.setPropertyKey("service-instance.service-instance-name");
item.setPropertyValue("lll_svc_010317");
- relatedToProperty.getRelatedTo().add(item);
+ relationship.getRelatedToProperty().add(item);
relationship.setRelatedTo("service-instance");
relationship.setRelatedLink(
"/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription"
+ "/MSO-dev-service-type/service-instances/service-instance/"
+ "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationship.setRelationshipData(relationshipData);
- relationship.setRelatedToProperty(relatedToProperty);
- relationshipList.getRelationshipList().add(relationship);
+ relationshipList.getRelationships().add(relationship);
response.setRelationshipList(relationshipList);
return response;
@@ -362,43 +355,39 @@ public class ControlLoopEventManagerTest {
response.setVnfType("Basa-122216-Service/VidVsamp12BaseVolume 1");
response.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
response.setOrchestrationStatus("Created");
- response.setInMaint("false");
- response.setIsClosedLoopDisabled("false");
+ response.setInMaint(false);
+ response.setIsClosedLoopDisabled(false);
response.setResourceVersion("1494001988835");
response.setModelInvariantId("f18be3cd-d446-456e-9109-121d9b62feaa");
final RelationshipList relationshipList = new RelationshipList();
final Relationship relationship = new Relationship();
- RelationshipData relationshipData = new RelationshipData();
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
+ RelationshipData relationshipDataItem = new RelationshipData();
relationshipDataItem.setRelationshipKey("customer.global-customer-id");
relationshipDataItem.setRelationshipValue("MSO_1610_ST");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-subscription.service-type");
relationshipDataItem.setRelationshipValue("MSO-dev-service-type");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-instance.service-instance-id");
relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem item = new RelatedToPropertyItem();
+ RelatedToProperty item = new RelatedToProperty();
item.setPropertyKey("service-instance.service-instance-name");
item.setPropertyValue("lll_svc_010317");
- relatedToProperty.getRelatedTo().add(item);
+ relationship.getRelatedToProperty().add(item);
relationship.setRelatedTo("service-instance");
relationship.setRelatedLink(
"/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription"
+ "/MSO-dev-service-type/service-instances/service-instance/"
+ "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationship.setRelationshipData(relationshipData);
- relationship.setRelatedToProperty(relatedToProperty);
- relationshipList.getRelationshipList().add(relationship);
+ relationshipList.getRelationships().add(relationship);
response.setRelationshipList(relationshipList);
return response;
@@ -410,49 +399,49 @@ public class ControlLoopEventManagerTest {
public static AaiGetVserverResponse getQueryByVserverName2(String urlGet, String username, String password,
UUID requestId, String key) {
AaiGetVserverResponse response = new AaiGetVserverResponse();
+
+ AaiNqVServer svr = new AaiNqVServer();
- response.setVserverId("d0668d4f-c25e-4a1b-87c4-83845c01efd8");
- response.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0");
- response.setVserverName2("vjunos0");
- response.setVserverSelflink(
+ svr.setVserverId("d0668d4f-c25e-4a1b-87c4-83845c01efd8");
+ svr.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0");
+ svr.setVserverName2("vjunos0");
+ svr.setVserverSelflink(
"https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8");
- response.setInMaint("false");
- response.setIsClosedLoopDisabled("false");
- response.setResourceVersion("1494001931513");
+ svr.setInMaint(false);
+ svr.setIsClosedLoopDisabled(false);
+ svr.setResourceVersion("1494001931513");
final RelationshipList relationshipList = new RelationshipList();
final Relationship relationship = new Relationship();
- RelationshipData relationshipData = new RelationshipData();
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
+ RelationshipData relationshipDataItem = new RelationshipData();
relationshipDataItem.setRelationshipKey("customer.global-customer-id");
relationshipDataItem.setRelationshipValue("MSO_1610_ST");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-subscription.service-type");
relationshipDataItem.setRelationshipValue("MSO-dev-service-type");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
relationshipDataItem.setRelationshipKey("service-instance.service-instance-id");
relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationshipData.getRelationshipData().add(relationshipDataItem);
+ relationship.getRelationshipData().add(relationshipDataItem);
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem item = new RelatedToPropertyItem();
+ RelatedToProperty item = new RelatedToProperty();
item.setPropertyKey("service-instance.service-instance-name");
item.setPropertyValue("lll_svc_010317");
- relatedToProperty.getRelatedTo().add(item);
+ relationship.getRelatedToProperty().add(item);
relationship.setRelatedTo("service-instance");
relationship.setRelatedLink(
"/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription"
+ "/MSO-dev-service-type/service-instances/service-instance/"
+ "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationship.setRelationshipData(relationshipData);
- relationship.setRelatedToProperty(relatedToProperty);
- relationshipList.getRelationshipList().add(relationship);
- response.setRelationshipList(relationshipList);
+ relationshipList.getRelationships().add(relationship);
+ svr.setRelationshipList(relationshipList);
+
+ response.getVserver().add(svr);
return response;
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java
index e47d31912..e702db699 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetResponse.java
@@ -25,74 +25,15 @@ import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
public class AaiGetResponse implements Serializable {
-
- /**
- * define common fields for AAIGETVnfResponse and AAIGETVserverResponse.
- */
- private static final long serialVersionUID = 7311418432051756161L;
-
- @SerializedName("in-maint")
- private String inMaint;
-
- @SerializedName("is-closed-loop-disabled")
- private String isClosedLoopDisabled;
-
- @SerializedName("model-invariant-id")
- private String modelInvariantId;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- @SerializedName("relationship-list")
- private RelationshipList relationshipList;
+ private static final long serialVersionUID = 7311418432051756162L;
@SerializedName("requestError")
private AaiNqRequestError requestError;
- public String getInMaint() {
- return inMaint;
- }
-
- public String getIsClosedLoopDisabled() {
- return isClosedLoopDisabled;
- }
-
- public String getModelInvariantId() {
- return modelInvariantId;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public RelationshipList getRelationshipList() {
- return relationshipList;
- }
-
public AaiNqRequestError getRequestError() {
return requestError;
}
- public void setInMaint(String inMaint) {
- this.inMaint = inMaint;
- }
-
- public void setIsClosedLoopDisabled(String isClosedLoopDisabled) {
- this.isClosedLoopDisabled = isClosedLoopDisabled;
- }
-
- public void setModelInvariantId(String modelInvariantId) {
- this.modelInvariantId = modelInvariantId;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- public void setRelationshipList(RelationshipList relationshipList) {
- this.relationshipList = relationshipList;
- }
-
public void setRequestError(AaiNqRequestError requestError) {
this.requestError = requestError;
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java
index ccc0fa4c3..8db3a7619 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVnfResponse.java
@@ -26,7 +26,7 @@ import java.io.Serializable;
public class AaiGetVnfResponse extends AaiGetResponse implements Serializable {
- private static final long serialVersionUID = -6247505944905898870L;
+ private static final long serialVersionUID = -6247505944905898871L;
@SerializedName("vnf-id")
private String vnfId;
@@ -43,6 +43,21 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable {
@SerializedName("orchestration-status")
private String orchestrationStatus;
+ @SerializedName("in-maint")
+ private boolean inMaint;
+
+ @SerializedName("is-closed-loop-disabled")
+ private boolean isClosedLoopDisabled;
+
+ @SerializedName("model-invariant-id")
+ private String modelInvariantId;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ @SerializedName("relationship-list")
+ private RelationshipList relationshipList;
+
public String getVnfId() {
return vnfId;
}
@@ -63,6 +78,26 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable {
return orchestrationStatus;
}
+ public boolean getInMaint() {
+ return inMaint;
+ }
+
+ public boolean getIsClosedLoopDisabled() {
+ return isClosedLoopDisabled;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
public void setVnfId(String vnfId) {
this.vnfId = vnfId;
}
@@ -82,4 +117,24 @@ public class AaiGetVnfResponse extends AaiGetResponse implements Serializable {
public void setOrchestrationStatus(String orchestrationStatus) {
this.orchestrationStatus = orchestrationStatus;
}
+
+ public void setInMaint(boolean inMaint) {
+ this.inMaint = inMaint;
+ }
+
+ public void setIsClosedLoopDisabled(boolean isClosedLoopDisabled) {
+ this.isClosedLoopDisabled = isClosedLoopDisabled;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java
index ca258a93c..a2d4b856a 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiGetVserverResponse.java
@@ -23,52 +23,21 @@ package org.onap.policy.aai;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
public class AaiGetVserverResponse extends AaiGetResponse implements Serializable {
- private static final long serialVersionUID = -6247505944905898870L;
+ private static final long serialVersionUID = -6247505944905898871L;
- @SerializedName("vserver-id")
- private String vserverId;
+ @SerializedName("vserver")
+ private List<AaiNqVServer> vserver = new LinkedList<>();
- @SerializedName("vserver-name")
- private String vserverName;
-
- @SerializedName("vserver-name2")
- private String vserverName2;
-
- @SerializedName("vserver-selflink")
- private String vserverSelflink;
-
- public String getVserverId() {
- return vserverId;
- }
-
- public String getVserverName() {
- return vserverName;
- }
-
- public String getVserverName2() {
- return vserverName2;
- }
-
- public String getVserverSelflink() {
- return vserverSelflink;
- }
-
- public void setVserverId(String vserverId) {
- this.vserverId = vserverId;
- }
-
- public void setVserverName(String vserverName) {
- this.vserverName = vserverName;
- }
-
- public void setVserverName2(String vserverName2) {
- this.vserverName2 = vserverName2;
+ public List<AaiNqVServer> getVserver() {
+ return vserver;
}
- public void setVserverSelflink(String vserverSelflink) {
- this.vserverSelflink = vserverSelflink;
+ public void setVserver(List<AaiNqVServer> vserver) {
+ this.vserver = vserver;
}
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java
index 9ec86c12a..c624497f1 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/AaiNqVServer.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,6 +51,9 @@ public class AaiNqVServer implements Serializable {
@SerializedName("resource-version")
private String resourceVersion;
+ @SerializedName("relationship-list")
+ private RelationshipList relationshipList;
+
public String getVserverId() {
return vserverId;
}
@@ -83,6 +86,10 @@ public class AaiNqVServer implements Serializable {
return resourceVersion;
}
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
public void setVserverId(String vserverId) {
this.vserverId = vserverId;
}
@@ -115,5 +122,8 @@ public class AaiNqVServer implements Serializable {
this.resourceVersion = resourceVersion;
}
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java
index ab6d0a6ee..ca126d12c 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToProperty.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,21 +23,28 @@ package org.onap.policy.aai;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
-import java.util.LinkedList;
-import java.util.List;
public class RelatedToProperty implements Serializable {
- private static final long serialVersionUID = 2088088164920423658L;
+ private static final long serialVersionUID = 5644372985092588638L;
- @SerializedName("related-to-property")
- private List<RelatedToPropertyItem> relatedTo = new LinkedList<>();
+ @SerializedName("property-key")
+ private String propertyKey;
+ @SerializedName("property-value")
+ private String propertyValue;
- public List<RelatedToPropertyItem> getRelatedTo() {
- return relatedTo;
+ public String getPropertyKey() {
+ return propertyKey;
}
- public void setRelatedTo(List<RelatedToPropertyItem> relatedTo) {
- this.relatedTo = relatedTo;
+ public String getPropertyValue() {
+ return propertyValue;
+ }
+
+ public void setPropertyKey(String propertyKey) {
+ this.propertyKey = propertyKey;
}
-}
+ public void setPropertyValue(String propertyValue) {
+ this.propertyValue = propertyValue;
+ }
+}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java
deleted file mode 100644
index ee7d108b5..000000000
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelatedToPropertyItem.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * aai
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.aai;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-
-public class RelatedToPropertyItem implements Serializable {
- private static final long serialVersionUID = 5644372985092588637L;
-
- @SerializedName("property-key")
- private String propertyKey;
- @SerializedName("property-value")
- private String propertyValue;
-
- public String getPropertyKey() {
- return propertyKey;
- }
-
- public String getPropertyValue() {
- return propertyValue;
- }
-
- public void setPropertyKey(String propertyKey) {
- this.propertyKey = propertyKey;
- }
-
- public void setPropertyValue(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java
index 732b645be..496129825 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/Relationship.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,9 +23,11 @@ package org.onap.policy.aai;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
public class Relationship implements Serializable {
- private static final long serialVersionUID = -68508443869003054L;
+ private static final long serialVersionUID = -68508443869003055L;
@SerializedName("related-to")
private String relatedTo;
@@ -34,10 +36,10 @@ public class Relationship implements Serializable {
private String relatedLink;
@SerializedName("relationship-data")
- private RelationshipData relationshipData = new RelationshipData();
+ private List<RelationshipData> relationshipData = new LinkedList<>();
@SerializedName("related-to-property")
- private RelatedToProperty relatedToProperty = new RelatedToProperty();
+ private List<RelatedToProperty> relatedToProperty = new LinkedList<>();
public String getRelatedTo() {
return relatedTo;
@@ -47,11 +49,11 @@ public class Relationship implements Serializable {
return relatedLink;
}
- public RelationshipData getRelationshipData() {
+ public List<RelationshipData> getRelationshipData() {
return relationshipData;
}
- public RelatedToProperty getRelatedToProperty() {
+ public List<RelatedToProperty> getRelatedToProperty() {
return relatedToProperty;
}
@@ -63,11 +65,11 @@ public class Relationship implements Serializable {
this.relatedLink = relatedLink;
}
- public void setRelationshipData(RelationshipData relationshipData) {
+ public void setRelationshipData(List<RelationshipData> relationshipData) {
this.relationshipData = relationshipData;
}
- public void setRelatedToProperty(RelatedToProperty relatedToProperty) {
+ public void setRelatedToProperty(List<RelatedToProperty> relatedToProperty) {
this.relatedToProperty = relatedToProperty;
}
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java
index 454f9871a..24170803d 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipData.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,19 +23,28 @@ package org.onap.policy.aai;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
-import java.util.LinkedList;
-import java.util.List;
public class RelationshipData implements Serializable {
- private static final long serialVersionUID = 6809180843309562121L;
- @SerializedName("relationship-data")
- private List<RelationshipDataItem> relationshipDataList = new LinkedList<>();
+ private static final long serialVersionUID = 550450041634939768L;
- public List<RelationshipDataItem> getRelationshipData() {
- return relationshipDataList;
+ @SerializedName("relationship-key")
+ private String relationshipKey;
+ @SerializedName("relationship-value")
+ private String relationshipValue;
+
+ public String getRelationshipKey() {
+ return relationshipKey;
+ }
+
+ public String getRelationshipValue() {
+ return relationshipValue;
+ }
+
+ public void setRelationshipKey(String relationshipKey) {
+ this.relationshipKey = relationshipKey;
}
- public void setRelationshipData(List<RelationshipDataItem> relationshipData) {
- this.relationshipDataList = relationshipData;
+ public void setRelationshipValue(String relationshipValue) {
+ this.relationshipValue = relationshipValue;
}
}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java
deleted file mode 100644
index bab45d486..000000000
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipDataItem.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * aai
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.aai;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-
-public class RelationshipDataItem implements Serializable {
- private static final long serialVersionUID = 550450041634939767L;
-
- @SerializedName("relationship-key")
- private String relationshipKey;
- @SerializedName("relationship-value")
- private String relationshipValue;
-
- public String getRelationshipKey() {
- return relationshipKey;
- }
-
- public String getRelationshipValue() {
- return relationshipValue;
- }
-
- public void setRelationshipKey(String relationshipKey) {
- this.relationshipKey = relationshipKey;
- }
-
- public void setRelationshipValue(String relationshipValue) {
- this.relationshipValue = relationshipValue;
- }
-}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java
deleted file mode 100644
index 179785717..000000000
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipItem.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * aai
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.aai;
-
-import com.google.gson.annotations.SerializedName;
-
-import java.io.Serializable;
-import java.util.LinkedList;
-import java.util.List;
-
-public class RelationshipItem implements Serializable {
- private static final long serialVersionUID = 1543404460741069628L;
-
- @SerializedName("related-to-property")
- private List<RelatedToPropertyItem> relatedToProperty = new LinkedList<>();
-
- public List<RelatedToPropertyItem> getRelatedToProperty() {
- return relatedToProperty;
- }
-
- public void setRelatedToProperty(List<RelatedToPropertyItem> relatedToProperty) {
- this.relatedToProperty = relatedToProperty;
- }
-}
diff --git a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java
index 347676820..8db1c7a39 100644
--- a/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java
+++ b/controlloop/common/model-impl/aai/src/main/java/org/onap/policy/aai/RelationshipList.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,17 +27,17 @@ import java.util.LinkedList;
import java.util.List;
public class RelationshipList implements Serializable {
- private static final long serialVersionUID = 6115655704973981989L;
+ private static final long serialVersionUID = 6115655704973981990L;
- @SerializedName("relationship-list")
+ @SerializedName("relationship")
private List<Relationship> relationships = new LinkedList<>();
- public List<Relationship> getRelationshipList() {
+ public List<Relationship> getRelationships() {
return relationships;
}
- public void setRelationshipList(List<Relationship> relationshipList) {
- this.relationships = relationshipList;
+ public void setRelationships(List<Relationship> relationships) {
+ this.relationships = relationships;
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipItemTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java
index 98445a2de..9afa70a59 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipItemTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java
@@ -20,37 +20,42 @@
package org.onap.policy.aai;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.io.File;
+import java.nio.file.Files;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class RelationshipItemTest {
- private static final Logger logger = LoggerFactory.getLogger(RelationshipItemTest.class);
+public class AaiGetResponseTest {
+ private static final Logger logger = LoggerFactory.getLogger(AaiGetResponseTest.class);
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
+ @Test
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath()));
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
+ AaiGetResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetResponse.class);
- @Test
- public void test() {
- RelationshipItem relationshipItem = new RelationshipItem();
- RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem();
- relatedToPropertyItem.setPropertyKey("model.model-name");
- relatedToPropertyItem.setPropertyValue("service-instance");
- relationshipItem.getRelatedToProperty().add(relatedToPropertyItem);
- assertNotNull(relationshipItem);
-
- relationshipItem.setRelatedToProperty(relationshipItem.getRelatedToProperty());
- assertNotNull(relationshipItem);
-
- logger.info(Serialization.gsonPretty.toJson(relationshipItem));
+ // don't need to verify this in depth, as it has its own tests that do that
+ assertNotNull(resp.getRequestError());
+ assertNotNull(resp.getRequestError().getServiceExcept());
+ assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId());
+
+ logger.info(Serialization.gsonPretty.toJson(resp));
+
+ // verify that setXxx methods work
+ resp.setRequestError(null);
+ assertNull(resp.getRequestError());
+
+ AaiNqRequestError err = new AaiNqRequestError();
+ resp.setRequestError(err);
+ assertEquals(err, resp.getRequestError());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java
index d78952111..d56aaaece 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java
@@ -21,7 +21,11 @@
package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.List;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
@@ -31,64 +35,70 @@ public class AaiGetVnfResponseTest {
private static final Logger logger = LoggerFactory.getLogger(AaiGetVnfResponseTest.class);
@Test
- public void test() {
- AaiGetVnfResponse response = new AaiGetVnfResponse();
-
- response.setVnfId("83f674e8-7555-44d7-9a39-bdc3770b0491");
- response.setVnfName("lll_vnf_010317");
- response.setVnfType("Basa-122216-Service/VidVsamp12BaseVolume 1");
- response.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
- response.setOrchestrationStatus("Created");
- response.setInMaint("false");
- response.setIsClosedLoopDisabled("false");
- response.setResourceVersion("1494001988835");
- response.setModelInvariantId("f18be3cd-d446-456e-9109-121d9b62feaa");
- assertEquals("83f674e8-7555-44d7-9a39-bdc3770b0491", response.getVnfId());
- assertEquals("lll_vnf_010317", response.getVnfName());
- assertEquals("Basa-122216-Service/VidVsamp12BaseVolume 1", response.getVnfType());
- assertEquals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", response.getServiceId());
- assertEquals("Created", response.getOrchestrationStatus());
- assertEquals("false", response.getInMaint());
- assertEquals("false", response.getIsClosedLoopDisabled());
- assertEquals("1494001988835", response.getResourceVersion());
- assertEquals("f18be3cd-d446-456e-9109-121d9b62feaa", response.getModelInvariantId());
-
- final RelationshipList relationshipList = new RelationshipList();
- final Relationship relationship = new Relationship();
- RelationshipData relationshipData = new RelationshipData();
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
-
- relationshipDataItem.setRelationshipKey("customer.global-customer-id");
- relationshipDataItem.setRelationshipValue("MSO_1610_ST");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- relationshipDataItem.setRelationshipKey("service-subscription.service-type");
- relationshipDataItem.setRelationshipValue("MSO-dev-service-type");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- relationshipDataItem.setRelationshipKey("service-instance.service-instance-id");
- relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem item = new RelatedToPropertyItem();
- item.setPropertyKey("service-instance.service-instance-name");
- item.setPropertyValue("lll_svc_010317");
- relatedToProperty.getRelatedTo().add(item);
- assertEquals("service-instance.service-instance-name", item.getPropertyKey());
- assertEquals("lll_svc_010317", item.getPropertyValue());
-
- relationship.setRelatedTo("service-instance");
- relationship.setRelatedLink(
- "/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/"
- + "MSO-dev-service-type/service-instances/service-instance/"
- + "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationship.setRelationshipData(relationshipData);
- relationship.setRelatedToProperty(relatedToProperty);
-
- relationshipList.getRelationshipList().add(relationship);
- response.setRelationshipList(relationshipList);
-
- logger.info(Serialization.gsonPretty.toJson(response));
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json").toPath()));
+
+ AaiGetVnfResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetVnfResponse.class);
+
+ assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", resp.getVnfId());
+ assertEquals("vLoadBalancerMS-Vnf-0809-2", resp.getVnfName());
+ assertEquals("vLoadBalancerMS/vLoadBalancerMS 0", resp.getVnfType());
+ assertEquals("1533850960381", resp.getResourceVersion());
+ assertEquals(false, resp.getInMaint());
+ assertEquals(true, resp.getIsClosedLoopDisabled());
+ assertEquals("53638a85-361a-437d-8830-4b0d5329225e", resp.getModelInvariantId());
+ assertEquals("Active", resp.getOrchestrationStatus());
+ assertEquals("50e1b0be-e0c9-48e2-9f42-15279a783ee8", resp.getServiceId());
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ RelationshipList relationshipList = resp.getRelationshipList();
+ assertNotNull(relationshipList);
+
+ List<Relationship> lst = relationshipList.getRelationships();
+ assertNotNull(lst);
+
+ assertEquals(5, lst.size());
+ assertEquals("service-instance", lst.get(0).getRelatedTo());
+ assertEquals("line-of-business", lst.get(1).getRelatedTo());
+
+ logger.info(Serialization.gsonPretty.toJson(resp));
+
+ // verify that setXxx methods work
+ relationshipList = new RelationshipList();
+
+ resp.setInMaint(true);
+ resp.setIsClosedLoopDisabled(false);
+ resp.setModelInvariantId("modiv");
+ resp.setOrchestrationStatus("orch");
+ resp.setRelationshipList(relationshipList);
+ resp.setResourceVersion("vers");
+ resp.setServiceId("svc");
+ resp.setVnfId("vnfid");
+ resp.setVnfName("vnfname");
+ resp.setVnfType("vnftype");
+
+ assertEquals("vnfid", resp.getVnfId());
+ assertEquals("vnfname", resp.getVnfName());
+ assertEquals("vnftype", resp.getVnfType());
+ assertEquals("vers", resp.getResourceVersion());
+ assertEquals(true, resp.getInMaint());
+ assertEquals(false, resp.getIsClosedLoopDisabled());
+ assertEquals("modiv", resp.getModelInvariantId());
+ assertEquals("orch", resp.getOrchestrationStatus());
+ assertEquals("svc", resp.getServiceId());
+ assertEquals(relationshipList, resp.getRelationshipList());
+
+
+ // test error case
+ json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath()));
+ resp = Serialization.gsonPretty.fromJson(json, AaiGetVnfResponse.class);
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ assertNotNull(resp.getRequestError());
+ assertNotNull(resp.getRequestError().getServiceExcept());
+ assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java
index 6962b31f4..c0160e421 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* aai
* ================================================================================
@@ -21,8 +21,12 @@
package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.LinkedList;
+import java.util.List;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
@@ -32,66 +36,42 @@ public class AaiGetVserverResponseTest {
private static final Logger logger = LoggerFactory.getLogger(AaiGetVserverResponseTest.class);
@Test
- public void test() {
- AaiGetVserverResponse response = new AaiGetVserverResponse();
-
- response.setVserverId("d0668d4f-c25e-4a1b-87c4-83845c01efd8");
- response.setVserverName("USMSO1SX7NJ0103UJZZ01-vjunos0");
- response.setVserverName2("vjunos0");
- response.setVserverSelflink(
- "https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8");
- response.setInMaint("false");
- response.setIsClosedLoopDisabled("false");
- response.setResourceVersion("1494001931513");
-
- assertEquals("d0668d4f-c25e-4a1b-87c4-83845c01efd8", response.getVserverId());
- assertEquals("USMSO1SX7NJ0103UJZZ01-vjunos0", response.getVserverName());
- assertEquals("vjunos0", response.getVserverName2());
- assertEquals("https://aai-ext1.test.aaa.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/"
- + "aaa-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver"
- + "/d0668d4f-c25e-4a1b-87c4-83845c01efd8", response.getVserverSelflink());
- assertEquals("false", response.getInMaint());
- assertEquals("false", response.getIsClosedLoopDisabled());
- assertEquals("1494001931513", response.getResourceVersion());
-
- final RelationshipList relationshipList = new RelationshipList();
- final Relationship relationship = new Relationship();
- RelationshipData relationshipData = new RelationshipData();
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
-
- relationshipDataItem.setRelationshipKey("customer.global-customer-id");
- relationshipDataItem.setRelationshipValue("MSO_1610_ST");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- relationshipDataItem.setRelationshipKey("service-subscription.service-type");
- relationshipDataItem.setRelationshipValue("MSO-dev-service-type");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- relationshipDataItem.setRelationshipKey("service-instance.service-instance-id");
- relationshipDataItem.setRelationshipValue("e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationshipData.getRelationshipData().add(relationshipDataItem);
-
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem item = new RelatedToPropertyItem();
- item.setPropertyKey("service-instance.service-instance-name");
- item.setPropertyValue("lll_svc_010317");
- relatedToProperty.getRelatedTo().add(item);
-
- relationship.setRelatedTo("service-instance");
- relationship.setRelatedLink(
- "/aai/v11/business/customers/customer/MSO_1610_ST/service-subscriptions/service-subscription/"
- + "MSO-dev-service-type/service-instances/service-instance/"
- + "e1e9c97c-02c0-4919-9b4c-eb5d5ef68970");
- relationship.setRelationshipData(relationshipData);
- relationship.setRelatedToProperty(relatedToProperty);
-
- relationshipList.getRelationshipList().add(relationship);
- response.setRelationshipList(relationshipList);
- assertEquals(response.getRelationshipList(), relationshipList);
- response.setRequestError(null);
- assertNull(response.getRequestError());
-
- logger.info(Serialization.gsonPretty.toJson(response));
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json").toPath()));
+
+ AaiGetVserverResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetVserverResponse.class);
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ List<AaiNqVServer> lst = resp.getVserver();
+ assertEquals(1, lst.size());
+
+ AaiNqVServer svr = lst.get(0);
+ assertNotNull(svr);
+ assertEquals("1c94da3f-16f1-4fc7-9ed1-e018dfa62774", svr.getVserverId());
+
+ logger.info(Serialization.gsonPretty.toJson(resp));
+
+ // verify that setXxx methods work
+ lst = new LinkedList<>();
+ lst.add(new AaiNqVServer());
+ lst.add(new AaiNqVServer());
+
+ resp.setVserver(lst);
+
+ assertEquals(lst, resp.getVserver());
+
+
+ // test error case
+ json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath()));
+ resp = Serialization.gsonPretty.fromJson(json, AaiGetVserverResponse.class);
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ assertNotNull(resp.getRequestError());
+ assertNotNull(resp.getRequestError().getServiceExcept());
+ assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java
index 9f49ecfef..bdda679d5 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java
@@ -23,6 +23,9 @@ package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.List;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -41,26 +44,58 @@ public class AaiNqVServerTest {
public static void tearDownAfterClass() throws Exception {}
@Test
- public void test() {
- AaiNqVServer aaiNqVServer = new AaiNqVServer();
- aaiNqVServer.setVserverId("dhv-test-vserver");
- aaiNqVServer.setVserverName("dhv-test-vserver-name");
- aaiNqVServer.setVserverName2("dhv-test-vserver-name2");
- aaiNqVServer.setProvStatus("PREPROV");
- aaiNqVServer.setVserverSelflink("dhv-test-vserver-selflink");
- aaiNqVServer.setInMaint(false);
- aaiNqVServer.setIsClosedLoopDisabled(false);
- aaiNqVServer.setResourceVersion("1485366417");
- assertNotNull(aaiNqVServer);
- assertEquals("dhv-test-vserver", aaiNqVServer.getVserverId());
- assertEquals("dhv-test-vserver-name", aaiNqVServer.getVserverName());
- assertEquals("dhv-test-vserver-name2", aaiNqVServer.getVserverName2());
- assertEquals("PREPROV", aaiNqVServer.getProvStatus());
- assertEquals("dhv-test-vserver-selflink", aaiNqVServer.getVserverSelflink());
- assertEquals(false, aaiNqVServer.getInMaint());
- assertEquals(false, aaiNqVServer.getIsClosedLoopDisabled());
- assertEquals("1485366417", aaiNqVServer.getResourceVersion());
- logger.info(Serialization.gsonPretty.toJson(aaiNqVServer));
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files
+ .readAllBytes(new File("src/test/resources/org/onap/policy/aai/AaiNqVServer.json").toPath()));
+
+ AaiNqVServer resp = Serialization.gsonPretty.fromJson(json, AaiNqVServer.class);
+
+ assertEquals(false, resp.getInMaint());
+ assertEquals(true, resp.getIsClosedLoopDisabled());
+ assertEquals("ACTIVE", resp.getProvStatus());
+ assertEquals("1533850964910", resp.getResourceVersion());
+ assertEquals("1c94da3f-16f1-4fc7-9ed1-e018dfa62774", resp.getVserverId());
+ assertEquals("vlb-ms-0809-1", resp.getVserverName());
+ assertEquals("vlb-ms-0809-7", resp.getVserverName2());
+ assertEquals("http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774",
+ resp.getVserverSelflink());
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ RelationshipList relationshipList = resp.getRelationshipList();
+ assertNotNull(relationshipList);
+
+ List<Relationship> lst = relationshipList.getRelationships();
+ assertNotNull(lst);
+
+ assertEquals(3, lst.size());
+ assertEquals("generic-vnf", lst.get(0).getRelatedTo());
+ assertEquals("image", lst.get(1).getRelatedTo());
+
+ logger.info(Serialization.gsonPretty.toJson(resp));
+
+ // verify that setXxx methods work
+ relationshipList = new RelationshipList();
+
+ resp.setInMaint(true);
+ resp.setIsClosedLoopDisabled(false);
+ resp.setProvStatus("inactive");
+ resp.setRelationshipList(relationshipList);
+ resp.setResourceVersion("vers");
+ resp.setVserverId("vid");
+ resp.setVserverName("vname");
+ resp.setVserverName2("vname2");
+ resp.setVserverSelflink("link");
+
+ assertEquals(true, resp.getInMaint());
+ assertEquals(false, resp.getIsClosedLoopDisabled());
+ assertEquals("inactive", resp.getProvStatus());
+ assertEquals("vers", resp.getResourceVersion());
+ assertEquals("vid", resp.getVserverId());
+ assertEquals("vname", resp.getVserverName());
+ assertEquals("vname2", resp.getVserverName2());
+ assertEquals("link", resp.getVserverSelflink());
+ assertEquals(relationshipList, resp.getRelationshipList());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyItemTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyItemTest.java
deleted file mode 100644
index 57f6c7605..000000000
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyItemTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * aai
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
-*/
-
-package org.onap.policy.aai;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.onap.policy.aai.util.Serialization;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RelatedToPropertyItemTest {
- private static final Logger logger = LoggerFactory.getLogger(RelatedToPropertyItemTest.class);
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
-
- @Test
- public void test() {
- RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem();
- relatedToPropertyItem.setPropertyKey("model.model-name");
- relatedToPropertyItem.setPropertyValue("service-instance");
- assertNotNull(relatedToPropertyItem);
- logger.info(Serialization.gsonPretty.toJson(relatedToPropertyItem));
- }
-
-}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java
index 439c11dd2..832d59f89 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java
@@ -20,10 +20,10 @@
package org.onap.policy.aai;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.io.File;
+import java.nio.file.Files;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
@@ -32,29 +32,25 @@ import org.slf4j.LoggerFactory;
public class RelatedToPropertyTest {
private static final Logger logger = LoggerFactory.getLogger(RelatedToPropertyTest.class);
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
+ @Test
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/RelatedToProperty.json").toPath()));
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
+ RelatedToProperty relatedToProperty = Serialization.gsonPretty.fromJson(json, RelatedToProperty.class);
- @Test
- public void test() {
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem();
- relatedToPropertyItem.setPropertyKey("model.model-name");
- relatedToPropertyItem.setPropertyValue("service-instance");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem);
- RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem();
- relatedToPropertyItem2.setPropertyKey("model.model-name2");
- relatedToPropertyItem2.setPropertyValue("service-instance2");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem2);
- assertNotNull(relatedToProperty);
-
- relatedToProperty.setRelatedTo(relatedToProperty.getRelatedTo());
- assertNotNull(relatedToProperty);
+ assertEquals("generic-vnf.vnf-name", relatedToProperty.getPropertyKey());
+ assertEquals("vLoadBalancerMS-Vnf-0809-1", relatedToProperty.getPropertyValue());
logger.info(Serialization.gsonPretty.toJson(relatedToProperty));
+
+ // verify that setXxx methods work
+ relatedToProperty.setPropertyKey("a key");
+ relatedToProperty.setPropertyValue("a value");
+
+ assertEquals("a key", relatedToProperty.getPropertyKey());
+ assertEquals("a value", relatedToProperty.getPropertyValue());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataItemTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataItemTest.java
deleted file mode 100644
index 5ad99f9a7..000000000
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataItemTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * aai
- * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
-*/
-
-package org.onap.policy.aai;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class RelationshipDataItemTest {
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
-
- @Test
- public void test() {
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
- relationshipDataItem.setRelationshipKey("relationship-key");
- relationshipDataItem.setRelationshipValue("relationship-value");
- assertNotNull(relationshipDataItem);
- }
-
-}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java
index 57543711d..93b1d32c4 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java
@@ -21,10 +21,9 @@
package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.io.File;
+import java.nio.file.Files;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
@@ -33,33 +32,25 @@ import org.slf4j.LoggerFactory;
public class RelationshipDataTest {
private static final Logger logger = LoggerFactory.getLogger(RelationshipDataTest.class);
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
-
@Test
- public void test() {
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
- relationshipDataItem.setRelationshipKey("relationship-key");
- relationshipDataItem.setRelationshipValue("relationship-value");
- assertNotNull(relationshipDataItem);
- assertEquals("relationship-key", relationshipDataItem.getRelationshipKey());
- assertEquals("relationship-value", relationshipDataItem.getRelationshipValue());
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/RelationshipData.json").toPath()));
- RelationshipData relationshipData = new RelationshipData();
- relationshipData.getRelationshipData().add(relationshipDataItem);
- RelationshipDataItem relationshipDataItem2 = new RelationshipDataItem();
- relationshipDataItem2.setRelationshipKey("relationship-key2");
- relationshipDataItem2.setRelationshipValue("relationship-value2");
- relationshipData.getRelationshipData().add(relationshipDataItem2);
- assertNotNull(relationshipData);
+ RelationshipData relationshipData = Serialization.gsonPretty.fromJson(json, RelationshipData.class);
- relationshipData.setRelationshipData(relationshipData.getRelationshipData());
- assertNotNull(relationshipData);
+ assertEquals("generic-vnf.vnf-id", relationshipData.getRelationshipKey());
+ assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", relationshipData.getRelationshipValue());
logger.info(Serialization.gsonPretty.toJson(relationshipData));
+
+ // verify that setXxx methods work
+ relationshipData.setRelationshipKey("a key");
+ relationshipData.setRelationshipValue("a value");
+
+ assertEquals("a key", relationshipData.getRelationshipKey());
+ assertEquals("a value", relationshipData.getRelationshipValue());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java
index e7f207e6b..d67f2bb8b 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java
@@ -23,8 +23,10 @@ package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.LinkedList;
+import java.util.List;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
@@ -33,46 +35,32 @@ import org.slf4j.LoggerFactory;
public class RelationshipListTest {
private static final Logger logger = LoggerFactory.getLogger(RelationshipListTest.class);
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
-
@Test
- public void test() {
- Relationship relationship = new Relationship();
- relationship.setRelatedLink("related-link");
- relationship.setRelatedTo("related-to");
- assertEquals("related-link", relationship.getRelatedLink());
- assertEquals("related-to", relationship.getRelatedTo());
-
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem();
- relatedToPropertyItem.setPropertyKey("model.model-name");
- relatedToPropertyItem.setPropertyValue("service-instance");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem);
- RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem();
- relatedToPropertyItem2.setPropertyKey("model.model-name2");
- relatedToPropertyItem2.setPropertyValue("service-instance2");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem2);
- relationship.setRelatedToProperty(relatedToProperty);
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
- relationshipDataItem.setRelationshipKey("relationship-key");
- relationshipDataItem.setRelationshipValue("relationship-value");
- RelationshipData relationshipData = new RelationshipData();
- relationshipData.getRelationshipData().add(relationshipDataItem);
- relationship.setRelationshipData(relationshipData);
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files.readAllBytes(
+ new File("src/test/resources/org/onap/policy/aai/RelationshipList.json").toPath()));
- RelationshipList relationshipList = new RelationshipList();
- relationshipList.getRelationshipList().add(relationship);
+ RelationshipList relationshipList = Serialization.gsonPretty.fromJson(json, RelationshipList.class);
- assertNotNull(relationshipList);
+ List<Relationship> lst = relationshipList.getRelationships();
+ assertNotNull(lst);
+ assertEquals(3, lst.size());
- relationshipList.setRelationshipList(relationshipList.getRelationshipList());
- assertNotNull(relationshipList);
+ // don't need to verify this in depth, as it has its own tests that do that
+ assertEquals("generic-vnf", lst.get(0).getRelatedTo());
+ assertEquals("image", lst.get(1).getRelatedTo());
+ assertEquals("flavor", lst.get(2).getRelatedTo());
logger.info(Serialization.gsonPretty.toJson(relationshipList));
+
+ // verify that setXxx methods work
+ lst = new LinkedList<>();
+ lst.add(new Relationship());
+ lst.add(new Relationship());
+
+ relationshipList.setRelationships(lst);
+ assertEquals(lst, relationshipList.getRelationships());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java
index 526ff8a1f..f229a091a 100644
--- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java
+++ b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java
@@ -23,50 +23,66 @@ package org.onap.policy.aai;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import java.io.File;
+import java.nio.file.Files;
+import java.util.LinkedList;
+import java.util.List;
import org.junit.Test;
import org.onap.policy.aai.util.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RelationshipTest {
- private static final Logger logger = LoggerFactory.getLogger(AaiNqResponseWrapperTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(RelationshipTest.class);
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
+ @Test
+ public void test() throws Exception {
+ // deserialize json and verify fields are populated properly
+ String json = new String(Files
+ .readAllBytes(new File("src/test/resources/org/onap/policy/aai/Relationship.json").toPath()));
- @AfterClass
- public static void tearDownAfterClass() throws Exception {}
+ Relationship relationship = Serialization.gsonPretty.fromJson(json, Relationship.class);
+
+ assertEquals("/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d",
+ relationship.getRelatedLink());
+ assertEquals("generic-vnf", relationship.getRelatedTo());
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ List<RelatedToProperty> relatedToProperty = relationship.getRelatedToProperty();
+ assertNotNull(relatedToProperty);
+ assertEquals(2, relatedToProperty.size());
+ assertEquals("vLoadBalancerMS-Vnf-0809-1", relatedToProperty.get(0).getPropertyValue());
+ assertEquals("vLoadBalancerMS-Vnf-0809-2", relatedToProperty.get(1).getPropertyValue());
+
+ // don't need to verify this in depth, as it has its own tests that do that
+ List<RelationshipData> relationshipData = relationship.getRelationshipData();
+ assertNotNull(relationshipData);
+ assertEquals(2, relationshipData.size());
+ assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", relationshipData.get(0).getRelationshipValue());
+ assertEquals("907a3f02-f878-436b-870c-f0e91e81570e", relationshipData.get(1).getRelationshipValue());
+
+ logger.info(Serialization.gsonPretty.toJson(relationship));
+
+ // verify that setXxx methods work
+ relatedToProperty = new LinkedList<>();
+ relatedToProperty.add(new RelatedToProperty());
+ relatedToProperty.add(new RelatedToProperty());
+ relatedToProperty.add(new RelatedToProperty());
+
+ relationshipData = new LinkedList<>();
+ relationshipData.add(new RelationshipData());
+ relationshipData.add(new RelationshipData());
+ relationshipData.add(new RelationshipData());
- @Test
- public void test() {
- Relationship relationship = new Relationship();
relationship.setRelatedLink("related-link");
relationship.setRelatedTo("related-to");
- assertEquals("related-link", relationship.getRelatedLink());
- assertEquals("related-to", relationship.getRelatedTo());
-
- RelatedToProperty relatedToProperty = new RelatedToProperty();
- RelatedToPropertyItem relatedToPropertyItem = new RelatedToPropertyItem();
- relatedToPropertyItem.setPropertyKey("model.model-name");
- relatedToPropertyItem.setPropertyValue("service-instance");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem);
- RelatedToPropertyItem relatedToPropertyItem2 = new RelatedToPropertyItem();
- relatedToPropertyItem2.setPropertyKey("model.model-name2");
- relatedToPropertyItem2.setPropertyValue("service-instance2");
- relatedToProperty.getRelatedTo().add(relatedToPropertyItem2);
relationship.setRelatedToProperty(relatedToProperty);
- assertEquals(relationship.getRelatedToProperty(), relatedToProperty);
- RelationshipDataItem relationshipDataItem = new RelationshipDataItem();
- relationshipDataItem.setRelationshipKey("relationship-key");
- relationshipDataItem.setRelationshipValue("relationship-value");
- RelationshipData relationshipData = new RelationshipData();
- relationshipData.getRelationshipData().add(relationshipDataItem);
relationship.setRelationshipData(relationshipData);
- assertEquals(relationship.getRelationshipData(), relationshipData);
- assertNotNull(relationship);
- logger.info(Serialization.gsonPretty.toJson(relationship));
+
+ assertEquals("related-link", relationship.getRelatedLink());
+ assertEquals("related-to", relationship.getRelatedTo());
+ assertEquals(relatedToProperty, relationship.getRelatedToProperty());
+ assertEquals(relationshipData, relationship.getRelationshipData());
}
}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json
new file mode 100644
index 000000000..6751fef5c
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json
@@ -0,0 +1,14 @@
+{
+ "requestError": {
+ "serviceException": {
+ "messageId": "SVC3001",
+ "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)",
+ "variables": [
+ "GET",
+ "network/generic-vnfs/generic-vnf/3f02-f878-436b-870c-f0e91e81570d",
+ "Node Not Found:No Node of type generic-vnf found at: network/generic-vnfs/generic-vnf/3f02-f878-436b-870c-f0e91e81570d",
+ "ERR.5.4.6114"
+ ]
+ }
+ }
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json
new file mode 100644
index 000000000..faa0e0e1b
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json
@@ -0,0 +1,123 @@
+{
+ "in-maint": false,
+ "ipv4-oam-address": "10.0.150.1",
+ "is-closed-loop-disabled": true,
+ "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671",
+ "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e",
+ "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c",
+ "nf-function": "",
+ "nf-naming-code": "",
+ "nf-role": "vLB",
+ "nf-type": "",
+ "orchestration-status": "Active",
+ "prov-status": "PROV",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-link": "/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vLB/service-instances/service-instance/b66d24cc-feca-4fdc-8090-2e9539a8bbac",
+ "related-to": "service-instance",
+ "related-to-property": [
+ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "vLoadBalancerMS-Service-0809-1"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "Demonstration"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "vLB"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "b66d24cc-feca-4fdc-8090-2e9539a8bbac"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/business/lines-of-business/line-of-business/Test-Business",
+ "related-to": "line-of-business",
+ "relationship-data": [
+ {
+ "relationship-key": "line-of-business.line-of-business-name",
+ "relationship-value": "Test-Business"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/business/platforms/platform/Test-Platform",
+ "related-to": "platform",
+ "relationship-data": [
+ {
+ "relationship-key": "platform.platform-name",
+ "relationship-value": "Test-Platform"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/4086f396c5e04caf9502c5fdeca575c4/vservers/vserver/191729bd-cb1d-485d-aa06-b20c888272a8",
+ "related-to": "vserver",
+ "related-to-property": [
+ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "vdns-ms01-0809-1"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "4086f396c5e04caf9502c5fdeca575c4"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "191729bd-cb1d-485d-aa06-b20c888272a8"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/4086f396c5e04caf9502c5fdeca575c4/vservers/vserver/1c94da3f-16f1-4fc7-9ed1-e018dfa62774",
+ "related-to": "vserver",
+ "related-to-property": [
+ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "vlb-ms-0809-1"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "4086f396c5e04caf9502c5fdeca575c4"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774"
+ }
+ ]
+ }
+ ]
+ },
+ "resource-version": "1533850960381",
+ "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8",
+ "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d",
+ "vnf-name": "vLoadBalancerMS-Vnf-0809-2",
+ "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0"
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json
new file mode 100644
index 000000000..19885942e
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json
@@ -0,0 +1,82 @@
+{
+ "vserver": [
+ {
+ "in-maint": false,
+ "is-closed-loop-disabled": true,
+ "prov-status": "ACTIVE",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d",
+ "related-to": "generic-vnf",
+ "related-to-property": [
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-2"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12",
+ "related-to": "image",
+ "related-to-property": [
+ {
+ "property-key": "image.image-name",
+ "property-value": "unknown"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "image.image-id",
+ "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
+ "related-to": "flavor",
+ "related-to-property": [
+ {
+ "property-key": "flavor.flavor-name",
+ "property-value": "m1.medium"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "flavor.flavor-id",
+ "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39"
+ }
+ ]
+ }
+ ]
+ },
+ "resource-version": "1533850964910",
+ "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774",
+ "vserver-name": "vlb-ms-0809-1",
+ "vserver-name2": "vlb-ms-0809-7",
+ "vserver-selflink": "http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774"
+ }
+ ]
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json
new file mode 100644
index 000000000..0a59d8a87
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json
@@ -0,0 +1,78 @@
+{
+ "in-maint": false,
+ "is-closed-loop-disabled": true,
+ "prov-status": "ACTIVE",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d",
+ "related-to": "generic-vnf",
+ "related-to-property": [
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-2"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12",
+ "related-to": "image",
+ "related-to-property": [
+ {
+ "property-key": "image.image-name",
+ "property-value": "unknown"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "image.image-id",
+ "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
+ "related-to": "flavor",
+ "related-to-property": [
+ {
+ "property-key": "flavor.flavor-name",
+ "property-value": "m1.medium"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "flavor.flavor-id",
+ "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39"
+ }
+ ]
+ }
+ ]
+ },
+ "resource-version": "1533850964910",
+ "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774",
+ "vserver-name": "vlb-ms-0809-1",
+ "vserver-name2": "vlb-ms-0809-7",
+ "vserver-selflink": "http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774"
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json
new file mode 100644
index 000000000..2211b3725
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json
@@ -0,0 +1,4 @@
+{
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-1"
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json
new file mode 100644
index 000000000..39d9ce1b6
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json
@@ -0,0 +1,25 @@
+
+{
+ "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d",
+ "related-to": "generic-vnf",
+ "related-to-property": [
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-1"
+ },
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-2"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d"
+ },
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "907a3f02-f878-436b-870c-f0e91e81570e"
+ }
+ ]
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json
new file mode 100644
index 000000000..4bbb39e8f
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json
@@ -0,0 +1,4 @@
+{
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d"
+}
diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json
new file mode 100644
index 000000000..ae180f056
--- /dev/null
+++ b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json
@@ -0,0 +1,68 @@
+{
+ "relationship": [
+ {
+ "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d",
+ "related-to": "generic-vnf",
+ "related-to-property": [
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "vLoadBalancerMS-Vnf-0809-2"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12",
+ "related-to": "image",
+ "related-to-property": [
+ {
+ "property-key": "image.image-name",
+ "property-value": "unknown"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "image.image-id",
+ "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12"
+ }
+ ]
+ },
+ {
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
+ "related-to": "flavor",
+ "related-to-property": [
+ {
+ "property-key": "flavor.flavor-name",
+ "property-value": "m1.medium"
+ }
+ ],
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "flavor.flavor-id",
+ "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39"
+ }
+ ]
+ }
+ ]
+}