From bb819501be5eab896e5274dfab0149487ccc25b7 Mon Sep 17 00:00:00 2001 From: marcinrzepeckiwroc Date: Wed, 4 Nov 2020 10:10:52 +0100 Subject: Remove unnecessary vserver--generic-vnf relation from SO-OpenStack-Adapter implementation Issue-ID: SO-3363 Signed-off-by: marcinrzepeckiwroc Change-Id: I662eba1cafab6778247d491e8f4f45aefe800627 --- .../src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java | 5 ----- .../src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java | 8 +++++--- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'adapters') 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 32d8f1204c..fef7b5e6cb 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 @@ -103,11 +103,6 @@ public class AaiHelper { relationships.add(pserverRelationship); } - // vserver to generic-vnf relationship - Relationship genericVnfRelationship = buildRelationship( - AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId))); - relationships.add(genericVnfRelationship); - // vserver to vnfc relationship if (!StringUtils.isEmpty(server.getName())) { relationships.add(createVnfRelationshiptoVserver(server.getName(), genericVnfId, 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 93a7992338..1026284470 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 @@ -172,6 +172,8 @@ public class HeatBridgeImplTest { when(resourcesClient.beginSingleTransaction()).thenReturn(transaction); } + + @Test public void testExtractStackResourceIdsByResourceType() throws HeatBridgeException { // Arrange @@ -369,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(4, 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(3, 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(3, relList3.getRelationship().size()); + assertEquals(2, relList3.getRelationship().size()); } -- cgit 1.2.3-korg