aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLeigh, Phillip (pl876u) <phillip.leigh@amdocs.com>2019-01-30 18:21:27 -0500
committerLeigh, Phillip (pl876u) <phillip.leigh@amdocs.com>2019-02-01 18:39:26 -0500
commit09e3af8778d9a84ecea2f2085708f22554bd04b8 (patch)
treeefcb6b746919658a723c06d030e9d0463dbf1043 /src/test
parentef2ccf9b828b4cd09cdb35d8056dc3aa74cf7e8a (diff)
Handle l3Network in AaiCtxBuilder
Issue-ID: LOG-763 Change-Id: I7c1d24727824eb43603b096f63201e4e7195f35b Signed-off-by: Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java125
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VfModuleTest.java13
-rw-r--r--src/test/resources/junit/aai-service-instance_set3.json43
-rw-r--r--src/test/resources/junit/aai-vserver-set2.json78
-rw-r--r--src/test/resources/junit/aai-vserver.json6
-rw-r--r--src/test/resources/junit/genericVnfInput.json36
-rw-r--r--src/test/resources/junit/genericVnfInput_set2.json36
-rw-r--r--src/test/resources/junit/genericVnfInput_set3.json100
-rw-r--r--src/test/resources/junit/genericVnfInput_set4.json120
-rw-r--r--src/test/resources/junit/l3-network-1.json93
-rw-r--r--src/test/resources/junit/l3-network-2.json93
-rw-r--r--src/test/resources/junit/queryNodeData-nullResourceLink.json2
12 files changed, 665 insertions, 80 deletions
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
index f808ebe..5ded51f 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
@@ -47,6 +47,7 @@ import org.onap.pomba.common.datatypes.ModelContext;
import org.onap.pomba.common.datatypes.VNF;
import org.onap.pomba.common.datatypes.VFModule;
import org.onap.pomba.common.datatypes.VM;
+import org.onap.pomba.common.datatypes.Network;
@RunWith(SpringJUnit4ClassRunner.class)
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class })
@@ -282,4 +283,128 @@ public class RestUtilTest {
assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getName(), "bdc3cc2a-c73e-414f-7ddb-367de92801cb"); //interface-name
}
+ ///Verify the relationship serviceInstanceId -> l3network
+ @Test
+ public void testretrieveAAIModelDataFromAAI_L3_network_in_service_level () throws Exception {
+
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set3.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of l3-network
+ // note: match to network-id to the path of "l3network" in (2: aai-service-instance_set3)
+ addResponse(
+ "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1" + DEPTH,
+ "junit/l3-network-1.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-2" + DEPTH,
+ "junit/l3-network-2.json", aaiEnricherRule);
+
+
+ ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
+
+ // verify results
+ List<Network> networkList = modelCtx.getNetworkList();
+ assertEquals(networkList.size(), 2);
+ assertEquals(networkList.get(0).getUuid(), "01e8d84a-l3-network-1");
+ assertEquals(networkList.get(1).getUuid(), "01e8d84a-l3-network-2");
+ }
+
+ ///Verify the relationship serviceInstanceId -> vnf -> l3network
+ @Test
+ public void testretrieveAAIModelDataFromAAI_L3_network_in_VNF_level() throws Exception {
+
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set2.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF (with 1 vserver)
+ // note: match vnf_id in (2)
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput_set3.json", aaiEnricherRule);
+
+ // 4. simulate the rsp of vserer
+ // note: match to vserver-id to the path of "vserver" in (3)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "junit/aai-vserver-set2.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of l3-network
+ // note: match to network-id to the path of "l3network" in (3: genericVnfInput_set3)
+ addResponse(
+ "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1" + DEPTH,
+ "junit/l3-network-1.json", aaiEnricherRule);
+
+ ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
+
+ // verify results
+ List<VNF> vnfList = modelCtx.getVnfs();
+ assertEquals(vnfList.size(), 1);
+ List<Network> networkList = vnfList.get(0).getNetworks();
+ assertEquals(networkList.size(), 1);
+ assertEquals(networkList.get(0).getUuid(), "01e8d84a-l3-network-1");
+ }
+
+ @Test
+ public void testretrieveAAIModelDataFromAAI_L3_network_in_vModule_level() throws Exception {
+
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set2.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF (with 1 vserver)
+ // note: match vnf_id in (2)
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput_set4.json", aaiEnricherRule);
+
+ // 4. simulate the rsp of vserer
+ // note: match to vserver-id to the path of "vserver" in (3)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "junit/aai-vserver-set2.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of l3-network
+ // note: match to network-id to the path of "l3network" in (3: genericVnfInput_set4)
+ addResponse(
+ "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1" + DEPTH,
+ "junit/l3-network-1.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-2" + DEPTH,
+ "junit/l3-network-2.json", aaiEnricherRule);
+
+
+ ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
+
+ // verify results
+ List<VNF> vnfList = modelCtx.getVnfs();
+ assertEquals(vnfList.size(), 1);
+ List<VFModule> vfModuleList = vnfList.get(0).getVfModules();
+ assertEquals(vfModuleList.size(), 1);
+
+ List<Network> networkList = vfModuleList.get(0).getNetworks();
+ assertEquals(networkList.size(), 2);
+ assertEquals(networkList.get(0).getUuid(), "01e8d84a-l3-network-1");
+ assertEquals(networkList.get(1).getUuid(), "01e8d84a-l3-network-2");
+ }
+
}
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VfModuleTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VfModuleTest.java
index b79f8ca..77da591 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VfModuleTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VfModuleTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
+import org.onap.pomba.contextbuilder.aai.datatype.L3networkInstance;
import org.onap.pomba.contextbuilder.aai.datatype.RelatedToProperty;
import org.onap.pomba.contextbuilder.aai.datatype.Relationship;
import org.onap.pomba.contextbuilder.aai.datatype.RelationshipDatum;
@@ -53,7 +54,7 @@ public class VfModuleTest {
vfModule.setRelationshipList(relationshipList);
assertEquals("vfModuleId", vfModule.getVfModuleId());
- assertEquals("vfModuleName", vfModule.getVfMduleName());
+ assertEquals("vfModuleName", vfModule.getVfModuleName());
assertEquals("heatStackId", vfModule.getHeatStackId());
assertEquals("orchestrationStatus", vfModule.getOrchestrationStatus());
assertTrue(vfModule.getIsBaseVfModule());
@@ -67,10 +68,10 @@ public class VfModuleTest {
@Test
public void testVfModuleWithParameters() {
- VfModule vfModule = new VfModule("vfModuleId", "vfModuleName", "heatStackId", "orchestrationStatus", true, "resourceVersion", "modelInvariantId", "modelVersionId", "modelCustomizationId", 1, new RelationshipList() );
+ VfModule vfModule = new VfModule("vfModuleId", "vfModuleName", "heatStackId", "orchestrationStatus", true, "resourceVersion", "modelInvariantId", "modelVersionId", "modelCustomizationId", 1, new RelationshipList() , new ArrayList<L3networkInstance>());
assertEquals("vfModuleId", vfModule.getVfModuleId());
- assertEquals("vfModuleName", vfModule.getVfMduleName());
+ assertEquals("vfModuleName", vfModule.getVfModuleName());
assertEquals("heatStackId", vfModule.getHeatStackId());
assertEquals("orchestrationStatus", vfModule.getOrchestrationStatus());
assertTrue(vfModule.getIsBaseVfModule());
@@ -87,9 +88,9 @@ public class VfModuleTest {
@Test
public void testVfModuleEquals() {
- VfModule vfModule1 = new VfModule("vfModuleId1", "vfModuleName1", "heatStackId1", "orchestrationStatus1", true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", 1, new RelationshipList() );
- VfModule vfModule2 = new VfModule("vfModuleId2", "vfModuleName2", "heatStackId2", "orchestrationStatus2", true, "resourceVersion2", "modelInvariantId2", "modelVersionId2", "modelCustomizationId2", 1, new RelationshipList() );
- VfModule vfModule3 = new VfModule("vfModuleId1", "vfModuleName1", "heatStackId1", "orchestrationStatus1", true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", 1, new RelationshipList() );
+ VfModule vfModule1 = new VfModule("vfModuleId1", "vfModuleName1", "heatStackId1", "orchestrationStatus1", true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", 1, new RelationshipList() , new ArrayList<L3networkInstance>());
+ VfModule vfModule2 = new VfModule("vfModuleId2", "vfModuleName2", "heatStackId2", "orchestrationStatus2", true, "resourceVersion2", "modelInvariantId2", "modelVersionId2", "modelCustomizationId2", 1, new RelationshipList() , new ArrayList<L3networkInstance>());
+ VfModule vfModule3 = new VfModule("vfModuleId1", "vfModuleName1", "heatStackId1", "orchestrationStatus1", true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", 1, new RelationshipList() , new ArrayList<L3networkInstance>());
assertTrue(vfModule1.equals(vfModule1));
assertTrue(!vfModule1.equals(vfModule2));
diff --git a/src/test/resources/junit/aai-service-instance_set3.json b/src/test/resources/junit/aai-service-instance_set3.json
new file mode 100644
index 0000000..7700adf
--- /dev/null
+++ b/src/test/resources/junit/aai-service-instance_set3.json
@@ -0,0 +1,43 @@
+{
+ "service-instance-id": "adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "service-instance-name": "Firewall1",
+ "model-invariant-id": "0c5a20de-87ad-442c-9190-f38ab0a6bb7f",
+ "model-version-id": "d3d6cf83-d03a-43cc-99ff-206d40bb9a72",
+ "resource-version": "1527637758480",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "l3-network",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "01e8d84a-l3-network-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "NET_1106"
+ }
+ ]
+ },
+ {
+ "related-to": "l3-network",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-2",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "01e8d84a-l3-network-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "NET_1108"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/aai-vserver-set2.json b/src/test/resources/junit/aai-vserver-set2.json
new file mode 100644
index 0000000..aff20f1
--- /dev/null
+++ b/src/test/resources/junit/aai-vserver-set2.json
@@ -0,0 +1,78 @@
+{
+ "vserver-id": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "vserver-name": "Firewall-0",
+ "vserver-name2": "Firewall-0",
+ "prov-status": "ACTIVE",
+ "vserver-selflink": "http://10.12.25.2:8774/v2.1/b49b830686654191bb1e952a74b014ad/servers/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1528481820321",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "generic-vnf",
+ "related-link": "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39",
+ "relationship-data": [
+ {
+ "relationship-key": "generic-vnf.vnf-id",
+ "relationship-value": "8a9ddb25-2e79-449c-a40d-5011bac0da39"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "generic-vnf.vnf-name",
+ "property-value": "Firewall-1"
+ }
+ ]
+ },
+ {
+ "related-to": "flavor",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
+ "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"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "flavor.flavor-name",
+ "property-value": "m1.medium"
+ }
+ ]
+ },
+ {
+ "related-to": "image",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/42fd42f8-cf81-4f4c-a552-d4b124f83b0b",
+ "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": "42fd42f8-cf81-4f4c-a552-d4b124f83b0b"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "image.image-name",
+ "property-value": "unknown"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/aai-vserver.json b/src/test/resources/junit/aai-vserver.json
index 66f7639..c1bb18e 100644
--- a/src/test/resources/junit/aai-vserver.json
+++ b/src/test/resources/junit/aai-vserver.json
@@ -27,7 +27,7 @@
},
{
"related-to": "generic-vnf",
- "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39",
+ "related-link": "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39",
"relationship-data": [
{
"relationship-key": "generic-vnf.vnf-id",
@@ -43,7 +43,7 @@
},
{
"related-to": "flavor",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
@@ -67,7 +67,7 @@
},
{
"related-to": "image",
- "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/42fd42f8-cf81-4f4c-a552-d4b124f83b0b",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/42fd42f8-cf81-4f4c-a552-d4b124f83b0b",
"relationship-data": [
{
"relationship-key": "cloud-region.cloud-owner",
diff --git a/src/test/resources/junit/genericVnfInput.json b/src/test/resources/junit/genericVnfInput.json
index aac8bd6..6cbad88 100644
--- a/src/test/resources/junit/genericVnfInput.json
+++ b/src/test/resources/junit/genericVnfInput.json
@@ -19,7 +19,7 @@
"relationship": [
{
"related-to": "service-instance",
- "related-link": "/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "related-link": "/aai/v13/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
"relationship-data": [
{
"relationship-key": "customer.global-customer-id",
@@ -40,40 +40,6 @@
"property-value": "Firewall1"
}
]
- },
- {
- "related-to": "l3-network",
- "relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/network/l3-networks/l3-network/HNP1d77c-1094-41ec-b7f3-94bb30951870",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-id",
- "relationship-value": "HNP1d77c-1094-41ec-b7f3-94bb30951870"
- }
- ],
- "related-to-property": [
- {
- "property-key": "l3-network.network-name",
- "property-value": "HNPORTALOAM.OAM"
- }
- ]
- },
- {
- "related-to": "l3-network",
- "relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/network/l3-networks/l3-network/HNP1d77c-1094-41ec-b7f3-94bb30951872",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-id",
- "relationship-value": "HNP1d77c-1094-41ec-b7f3-94bb30951872"
- }
- ],
- "related-to-property": [
- {
- "property-key": "l3-network.network-name",
- "property-value": "HNPORTAL_SRIOV_2"
- }
- ]
}
]
},
diff --git a/src/test/resources/junit/genericVnfInput_set2.json b/src/test/resources/junit/genericVnfInput_set2.json
index dfdc0cc..0f511f8 100644
--- a/src/test/resources/junit/genericVnfInput_set2.json
+++ b/src/test/resources/junit/genericVnfInput_set2.json
@@ -41,7 +41,7 @@
},
{
"related-to": "service-instance",
- "related-link": "/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "related-link": "/aai/v13/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
"relationship-data": [
{
"relationship-key": "customer.global-customer-id",
@@ -62,40 +62,6 @@
"property-value": "Firewall1"
}
]
- },
- {
- "related-to": "l3-network",
- "relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/network/l3-networks/l3-network/HNP1d77c-1094-41ec-b7f3-94bb30951870",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-id",
- "relationship-value": "HNP1d77c-1094-41ec-b7f3-94bb30951870"
- }
- ],
- "related-to-property": [
- {
- "property-key": "l3-network.network-name",
- "property-value": "HNPORTALOAM.OAM"
- }
- ]
- },
- {
- "related-to": "l3-network",
- "relationship-label": "org.onap.relationships.inventory.Uses",
- "related-link": "/aai/v13/network/l3-networks/l3-network/HNP1d77c-1094-41ec-b7f3-94bb30951872",
- "relationship-data": [
- {
- "relationship-key": "l3-network.network-id",
- "relationship-value": "HNP1d77c-1094-41ec-b7f3-94bb30951872"
- }
- ],
- "related-to-property": [
- {
- "property-key": "l3-network.network-name",
- "property-value": "HNPORTAL_SRIOV_2"
- }
- ]
}
]
},
diff --git a/src/test/resources/junit/genericVnfInput_set3.json b/src/test/resources/junit/genericVnfInput_set3.json
new file mode 100644
index 0000000..45a5d83
--- /dev/null
+++ b/src/test/resources/junit/genericVnfInput_set3.json
@@ -0,0 +1,100 @@
+{
+ "vnf-id": "8a9ddb25-2e79-449c-a40d-5011bac0da39",
+ "vnf-name": "Firewall-1",
+ "vnf-type": "vFW-vSINK-service/vFWvSINK 0",
+ "service-id": "8ea56b0d-459d-4668-b363-c9567432d8b7",
+ "prov-status": "PREPROV",
+ "orchestration-status": "Created",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1527637940029",
+ "model-invariant-id": "59dd4d63-8f21-406c-98c0-3b057bb86820",
+ "model-version-id": "e2d52f32-a952-46f5-800c-c250903625d6",
+ "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc",
+ "nf-type": "",
+ "nf-function": "",
+ "nf-role": "",
+ "nf-naming-code": "",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "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": "b49b830686654191bb1e952a74b014ad"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"
+ }
+ ]
+ },
+ {
+ "related-to": "service-instance",
+ "related-link": "/aai/v13/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "Demonstration"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "vFWCL"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "Firewall1"
+ }
+ ]
+ },
+ {
+ "related-to": "l3-network",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "01e8d84a-l3-network-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "NET_1106"
+ }
+ ]
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "1563b649-9e05-4288-b7d9-e3639a54ace6",
+ "vf-module-name": "vFW_SINC_Module-2",
+ "heat-stack-id": "vFW_SINC_Module-2/41c4533a-748d-4cf4-a8d3-eccdd0aeb0d4",
+ "orchestration-status": "active",
+ "is-base-vf-module": true,
+ "resource-version": "1527638439198",
+ "model-invariant-id": "74bc1518-282d-4148-860f-8892b6369456",
+ "model-version-id": "4e3d28cf-d654-41af-a47b-04b4bd0ac58e",
+ "model-customization-id": "cc51ab7d-9b03-4bd6-9104-09df0c7c7907",
+ "module-index": 0
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/genericVnfInput_set4.json b/src/test/resources/junit/genericVnfInput_set4.json
new file mode 100644
index 0000000..3d41e42
--- /dev/null
+++ b/src/test/resources/junit/genericVnfInput_set4.json
@@ -0,0 +1,120 @@
+{
+ "vnf-id": "8a9ddb25-2e79-449c-a40d-5011bac0da39",
+ "vnf-name": "Firewall-1",
+ "vnf-type": "vFW-vSINK-service/vFWvSINK 0",
+ "service-id": "8ea56b0d-459d-4668-b363-c9567432d8b7",
+ "prov-status": "PREPROV",
+ "orchestration-status": "Created",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1527637940029",
+ "model-invariant-id": "59dd4d63-8f21-406c-98c0-3b057bb86820",
+ "model-version-id": "e2d52f32-a952-46f5-800c-c250903625d6",
+ "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc",
+ "nf-type": "",
+ "nf-function": "",
+ "nf-role": "",
+ "nf-naming-code": "",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "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": "b49b830686654191bb1e952a74b014ad"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"
+ }
+ ]
+ },
+ {
+ "related-to": "service-instance",
+ "related-link": "/aai/v13/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "Demonstration"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "vFWCL"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "Firewall1"
+ }
+ ]
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "1563b649-9e05-4288-b7d9-e3639a54ace6",
+ "vf-module-name": "vFW_SINC_Module-2",
+ "heat-stack-id": "vFW_SINC_Module-2/41c4533a-748d-4cf4-a8d3-eccdd0aeb0d4",
+ "orchestration-status": "active",
+ "is-base-vf-module": true,
+ "resource-version": "1527638439198",
+ "model-invariant-id": "74bc1518-282d-4148-860f-8892b6369456",
+ "model-version-id": "4e3d28cf-d654-41af-a47b-04b4bd0ac58e",
+ "model-customization-id": "cc51ab7d-9b03-4bd6-9104-09df0c7c7907",
+ "module-index": 0,
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "l3-network",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-1",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "01e8d84a-l3-network-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "NET_1106"
+ }
+ ]
+ },
+ {
+ "related-to": "l3-network",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/01e8d84a-l3-network-2",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "01e8d84a-l3-network-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "NET_1108"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/l3-network-1.json b/src/test/resources/junit/l3-network-1.json
new file mode 100644
index 0000000..2a1630c
--- /dev/null
+++ b/src/test/resources/junit/l3-network-1.json
@@ -0,0 +1,93 @@
+{
+ "network-id" : "01e8d84a-l3-network-1",
+ "network-name" : "NET_1106",
+ "network-type" : "Network_Type_1",
+ "network-role" : "Network_Role_1",
+ "network-technology" : "Network_Technology_1",
+ "physical-network-name" : "physical-network-name-1",
+ "resource-version" : "1547484061986-1",
+ "model-invariant-id" : "pomba-model-invariant-001",
+ "model-version-id" : "pomba-model-version-001",
+ "model-customization-id" : "3b822416-475d-4e1c-aac3-2544b0a0fdfc",
+ "is-provider-network" : false,
+ "is-shared-network" : true,
+ "is-external-network" : false,
+ "relationship-list" : {
+ "relationship" : [ {
+ "related-to" : "service-instance",
+ "related-link" : "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "relationship-data" : [ {
+ "relationship-key" : "service-instance.service-instance-id",
+ "relationship-value" : "adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "service-instance.service-instance-name",
+ "property-value" : "Firewall1"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_001-VNF-id-001-2",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_001-VNF-id-001-2"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-2"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-1"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002-2",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-2"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-2"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_001-VNF-id-001",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_001-VNF-id-001"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-1"
+ } ]
+ }, {
+ "related-to" : "vf-module",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002-2/vf-modules/vf-module/PombaDemoCust_002-VNF-id-002-VfModule002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-2"
+ }, {
+ "relationship-key" : "vf-module.vf-module-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-VfModule002"
+ } ]
+ }, {
+ "related-to" : "vf-module",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002/vf-modules/vf-module/PombaDemoCust_002-VNF-id-002-VfModule002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002"
+ }, {
+ "relationship-key" : "vf-module.vf-module-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-VfModule002"
+ } ]
+ } ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/l3-network-2.json b/src/test/resources/junit/l3-network-2.json
new file mode 100644
index 0000000..bb4e634
--- /dev/null
+++ b/src/test/resources/junit/l3-network-2.json
@@ -0,0 +1,93 @@
+{
+ "network-id" : "01e8d84a-l3-network-2",
+ "network-name" : "NET_1108",
+ "network-type" : "Network_Type_2",
+ "network-role" : "Network_Role_2",
+ "network-technology" : "Network_Technology_2",
+ "physical-network-name" : "physical-network-name-2",
+ "resource-version" : "1547484061986-2",
+ "model-invariant-id" : "pomba-model-invariant-002",
+ "model-version-id" : "pomba-model-version-002",
+ "model-customization-id" : "3b822416-475d-4e1c-aac3-2544b0a0fdfc",
+ "is-provider-network" : false,
+ "is-shared-network" : true,
+ "is-external-network" : false,
+ "relationship-list" : {
+ "relationship" : [ {
+ "related-to" : "service-instance",
+ "related-link" : "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "relationship-data" : [ {
+ "relationship-key" : "service-instance.service-instance-id",
+ "relationship-value" : "adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "service-instance.service-instance-name",
+ "property-value" : "Firewall1"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_001-VNF-id-001-2",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_001-VNF-id-001-2"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-2"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-1"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002-2",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-2"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-2"
+ } ]
+ }, {
+ "related-to" : "generic-vnf",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_001-VNF-id-001",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_001-VNF-id-001"
+ } ],
+ "related-to-property" : [ {
+ "property-key" : "generic-vnf.vnf-name",
+ "property-value" : "Firewall-1"
+ } ]
+ }, {
+ "related-to" : "vf-module",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002-2/vf-modules/vf-module/PombaDemoCust_002-VNF-id-002-VfModule002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-2"
+ }, {
+ "relationship-key" : "vf-module.vf-module-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-VfModule002"
+ } ]
+ }, {
+ "related-to" : "vf-module",
+ "related-link" : "/aai/v13/network/generic-vnfs/generic-vnf/PombaDemoCust_002-VNF-id-002/vf-modules/vf-module/PombaDemoCust_002-VNF-id-002-VfModule002",
+ "relationship-data" : [ {
+ "relationship-key" : "generic-vnf.vnf-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002"
+ }, {
+ "relationship-key" : "vf-module.vf-module-id",
+ "relationship-value" : "PombaDemoCust_002-VNF-id-002-VfModule002"
+ } ]
+ } ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/queryNodeData-nullResourceLink.json b/src/test/resources/junit/queryNodeData-nullResourceLink.json
index 36eb667..5b7a272 100644
--- a/src/test/resources/junit/queryNodeData-nullResourceLink.json
+++ b/src/test/resources/junit/queryNodeData-nullResourceLink.json
@@ -2,7 +2,7 @@
"result-data": [
{
"resource-type": "service-instance",
- "related-link": "/aai/v11/network/vnfcs/vnfc/zrdm5aepdg01vmg003"
+ "related-link": "/aai/v13/network/vnfcs/vnfc/zrdm5aepdg01vmg003"
}
]
}