aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
authorKalkere Ramesh, Sharan <sk720x@att.com>2020-12-08 10:44:28 -0500
committerKalkere Ramesh, Sharan <sk720x@att.com>2020-12-08 11:28:14 -0500
commit2e64a06e43d2ce6670f811728b941dd5f7a9f27e (patch)
tree03c1d35a71c34df2794625aa9ffb6356290f2bcb /adapters/mso-openstack-adapters
parent47305be351dd5c229c0ebc009dc007009c98a8ab (diff)
added relationship from vserver to vnf
Issue-ID: SO-3414 Change-Id: I51caf2dfc182c3c03767ae35e0ada20af9cab47b Signed-off-by: Kalkere Ramesh, Sharan <sk720x@att.com>
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java7
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java6
2 files changed, 10 insertions, 3 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
index a8fa6535c3..1f6c0df90f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java
@@ -108,6 +108,13 @@ public class AaiHelper {
* if (!StringUtils.isEmpty(server.getName())) {
* relationships.add(createVnfRelationshiptoVserver(server.getName(), genericVnfId, vfModuleId)); }
*/
+
+ // vserver to generic-vnf relationship
+ Relationship genericVnfRelationship = buildRelationship(
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId)));
+ relationships.add(genericVnfRelationship);
+
+
// vserver to vf-module relationship
Relationship vfModuleRelationship = buildRelationship(AAIUriFactory
.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId)));
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
index a18904f8f4..fab7df5345 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java
@@ -371,15 +371,15 @@ public class HeatBridgeImplTest {
org.onap.aai.domain.yang.RelationshipList relList = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID,
"test-genericVnf-id", "test-vfModule-id", server1);
- assertEquals(2, relList.getRelationship().size());
+ assertEquals(3, relList.getRelationship().size());
org.onap.aai.domain.yang.RelationshipList relList2 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER,
REGION_ID, "test-genericVnf-id", "test-vfModule-id", server2);
- assertEquals(1, relList2.getRelationship().size());
+ assertEquals(2, relList2.getRelationship().size());
org.onap.aai.domain.yang.RelationshipList relList3 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER,
REGION_ID, "test-genericVnf-id", "test-vfModule-id", server3);
- assertEquals(1, relList3.getRelationship().size());
+ assertEquals(2, relList3.getRelationship().size());
}