aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@orange.com>2020-05-26 16:57:47 +0200
committerLukasz Rajewski <lukasz.rajewski@orange.com>2020-05-26 19:11:12 +0200
commita06fb5e6ecc13c0b9742819c710f762fed2b79ac (patch)
tree2375b38f0241fd40ca770d6a47de032d2f19cc69
parent7c35f6dd4fd4b227f063036280a7f24728a198d8 (diff)
Add missing relationship in heatbridge
Added missing relationship creation between v-server and generic-vnf Issue-ID: SO-2956 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Change-Id: I8c74f078d7073041492b8c03ce6adb26823dec51
-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, 9 insertions, 4 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 f18279d5d3..90f55dcbb5 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
@@ -62,7 +62,7 @@ import org.openstack4j.model.network.Port;
public class AaiHelper {
/**
- * Build vserver relationship object to entities: pserver, vf-module, image, flavor
+ * Build vserver relationship object to entities: pserver, vf-module, generic-vnf, image, flavor
*
* @param cloudOwner AAI cloudOwner value
* @param cloudRegionId AAI cloud-region identifier
@@ -88,6 +88,11 @@ public class AaiHelper {
.put(HeatBridgeConstants.AAI_VF_MODULE_ID, vfModuleId).build());
relationships.add(vfModuleRelationship);
+ // vserver to generic-vnf relationship
+ Relationship genericVnfRelationship = buildRelationship(HeatBridgeConstants.AAI_GENERIC_VNF, ImmutableMap
+ .<String, String>builder().put(HeatBridgeConstants.AAI_GENERIC_VNF_ID, genericVnfId).build());
+ relationships.add(genericVnfRelationship);
+
// vserver to image relationship
if (server.getImage() != null) {
Relationship imageRel = buildRelationship(HeatBridgeConstants.AAI_IMAGE,
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 988e78b9a3..302af268d3 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
@@ -320,15 +320,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());
}
@Test