summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java131
-rw-r--r--src/test/resources/junit/aai-service-instance_set2.json27
-rw-r--r--src/test/resources/junit/aai-vserver.json94
-rw-r--r--src/test/resources/junit/genericVnfInput_set2.json118
-rw-r--r--src/test/resources/junit/pnfInput_w_pInterface.json86
-rw-r--r--src/test/resources/junit/pserverInput_set2.json46
-rw-r--r--src/test/resources/junit/pserverInput_with_pInterface.json65
-rw-r--r--src/test/resources/junit/queryNodeData-1.json2
8 files changed, 564 insertions, 5 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 3753ea6..f808ebe 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
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.util.List;
import java.util.UUID;
import org.junit.Rule;
import org.junit.Test;
@@ -43,6 +44,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
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;
@RunWith(SpringJUnit4ClassRunner.class)
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class })
@@ -59,6 +63,8 @@ public class RestUtilTest {
@Autowired
private String aaiBasicAuthorization;
+ private static final String DEPTH = "?depth=2";
+
@Rule
public WireMockRule aaiEnricherRule = new WireMockRule(wireMockConfig().port(9808));
@@ -132,7 +138,7 @@ public class RestUtilTest {
////
@Test
- public void testretrieveAAIModelDataFromAAI() throws Exception {
+ public void testretrieveAAIModelDataFromAAI_PNF() throws Exception {
String transactionId = UUID.randomUUID().toString();
String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
@@ -140,16 +146,16 @@ public class RestUtilTest {
// 1. simulate the response to obtainResourceLink based on ServiceInstanceId
addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
// 2. simulate the response of AAI (1 vnf and 1 pnf)
- addResponse( "/aai/v11/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ 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.json", aaiEnricherRule);
// 3. simulate the rsp of VNF
- addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39?depth=2",
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
"junit/genericVnfInput.json", aaiEnricherRule);
// 4. simulate the response of PNF based on the resourceLink in (2)
//note: match pnf_id in junit/aai-service-instance.json
- addResponse( "/aai/v13/network/pnfs/pnf/amdocsPnfName",
+ addResponse( "/aai/v13/network/pnfs/pnf/amdocsPnfName" + DEPTH,
"junit/pnfSampleInput.json", aaiEnricherRule);
ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
@@ -158,5 +164,122 @@ public class RestUtilTest {
assertEquals(modelCtx.getPnfs().size(), 1);
}
+ ///Verify the relationship serviceInstanceId -> vnf -> vserver
+ @Test
+ public void testretrieveAAIModelDataFromAAI_VSERVER_PSERVER() 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_set2.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.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of pserver
+ // note: match pserver hostname to the path of "pserver" in (4)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/pservers/pserver/mtn96compute.cci.att.com" + DEPTH,
+ "junit/pserverInput_set2.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<VM> vmList = vfModuleList.get(0).getVms();
+ assertEquals(vmList.size(), 1);
+ assertEquals(vmList.get(0).getUuid(), "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"); //vserver-id
+ assertEquals(vmList.get(0).getPServer().getName(), "mtn96compute.cci.att.com"); //pserver-name
+ }
+
+ ////
+ @Test
+ public void testretrieveAAIModelDataFromAAI_PInterface_with_PNF() 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 and 1 pnf)
+ 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.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput.json", aaiEnricherRule);
+
+ // 4. simulate the response of PNF based on the resourceLink in (2)
+ //note: match pnf_id in junit/aai-service-instance.json
+ addResponse( "/aai/v13/network/pnfs/pnf/amdocsPnfName" + DEPTH,
+ "junit/pnfInput_w_pInterface.json", aaiEnricherRule);
+
+ ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
+
+ assertEquals(modelCtx.getVnfs().size(), 1);
+ assertEquals(modelCtx.getPnfs().size(), 1);
+
+ }
+
+ @Test
+ public void testretrieveAAIModelDataFromAAI_P_Interface_with_PSERVER() 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_set2.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.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of pserver
+ // note: match pserver hostname to the path of "pserver" in (4)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/pservers/pserver/mtn96compute.cci.att.com" + DEPTH,
+ "junit/pserverInput_with_pInterface.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<VM> vmList = vfModuleList.get(0).getVms();
+ assertEquals(vmList.size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getName(), "bdc3cc2a-c73e-414f-7ddb-367de92801cb"); //interface-name
+ }
}
diff --git a/src/test/resources/junit/aai-service-instance_set2.json b/src/test/resources/junit/aai-service-instance_set2.json
new file mode 100644
index 0000000..8491eb7
--- /dev/null
+++ b/src/test/resources/junit/aai-service-instance_set2.json
@@ -0,0 +1,27 @@
+{
+ "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": "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"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/aai-vserver.json b/src/test/resources/junit/aai-vserver.json
new file mode 100644
index 0000000..66f7639
--- /dev/null
+++ b/src/test/resources/junit/aai-vserver.json
@@ -0,0 +1,94 @@
+{
+ "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": "pserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v13/cloud-infrastructure/pservers/pserver/mtn96compute.cci.att.com",
+ "relationship-data": [
+ {
+ "relationship-key": "pserver.hostname",
+ "relationship-value": "mtn96compute.cci.att.com"
+ }
+ ],
+ "related-to-property": [
+ { "property-key": "pserver.fqdn",
+ "property-value": "mtn96compute.cci.att.com"
+ }
+ ]
+ },
+ {
+ "related-to": "generic-vnf",
+ "related-link": "/aai/v11/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/v11/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/v11/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/genericVnfInput_set2.json b/src/test/resources/junit/genericVnfInput_set2.json
new file mode 100644
index 0000000..dfdc0cc
--- /dev/null
+++ b/src/test/resources/junit/genericVnfInput_set2.json
@@ -0,0 +1,118 @@
+{
+ "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/v11/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",
+ "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"
+ }
+ ]
+ }
+ ]
+ },
+ "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/pnfInput_w_pInterface.json b/src/test/resources/junit/pnfInput_w_pInterface.json
new file mode 100644
index 0000000..c534dfc
--- /dev/null
+++ b/src/test/resources/junit/pnfInput_w_pInterface.json
@@ -0,0 +1,86 @@
+{
+ "pnf-name": "amdocsPnfName",
+ "pnf-name2": "amdocsPnfName2",
+ "pnf-name2-source": "pombaName2Source",
+ "pnf-id": "11112222pnf88889999",
+ "equip-type": "software",
+ "equip-vendor": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "equip-model": "123134236",
+ "management-option": "TBD",
+ "sw-version": "2",
+ "in-maint": "true",
+ "frame-id": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "nf-function": "nf-Function-123",
+ "nf-role": "22222",
+ "model-invariant-id": "12345",
+ "model-version-id": "2123",
+ "admin_state_up": true,
+ "resource-version": "28",
+ "tenant_id": "c44b872f6830498b88c4989d67b2a6b7",
+ "created_at": "2018-03-20T16:49:01Z",
+ "provider:network_type": "vlan",
+ "p-interfaces":{
+ "p-interface": [
+ {
+ "interface-name": "bdc3cc2a-c73e-414f-7ddb-367de92801cb",
+ "speed-value": "1225",
+ "speed-units": "mbs",
+ "port-description": "port-used-for-junit",
+ "equipment-identifier": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "interface-role": "123134236",
+ "interface-type": "Software",
+ "prov-status": "2",
+ "in-maint": "true",
+ "resource-version": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "inv-status": "TBD"
+ }
+ ]
+ },
+ "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": "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"
+ }
+ ]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/pserverInput_set2.json b/src/test/resources/junit/pserverInput_set2.json
new file mode 100644
index 0000000..e2b632a
--- /dev/null
+++ b/src/test/resources/junit/pserverInput_set2.json
@@ -0,0 +1,46 @@
+{
+ "hostname": "mtn96compute.cci.att.com",
+ "fqdn": "mtn96compute.cci.att.com",
+ "pserver-id": "auto-generated-skeleton",
+ "pserver-name2": "pserverName2-hello",
+ "ptnii-equip-name": "ptnii-equip-name-hello",
+ "equip-type": "Firewall",
+ "equip-vendor": "equip-vendor-hello",
+ "equip-model": "equip-model-hello",
+ "internet-topology": "internet-topology-hello",
+ "purpose": "purpose-something-for-fun",
+ "serial-number": "1223128888",
+ "in-maint": false,
+ "resource-version": "1544034123458",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "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-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "Firewall-0"
+ }]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/pserverInput_with_pInterface.json b/src/test/resources/junit/pserverInput_with_pInterface.json
new file mode 100644
index 0000000..e33026b
--- /dev/null
+++ b/src/test/resources/junit/pserverInput_with_pInterface.json
@@ -0,0 +1,65 @@
+{
+ "hostname": "mtn96compute.cci.att.com",
+ "fqdn": "mtn96compute.cci.att.com",
+ "pserver-id": "auto-generated-skeleton",
+ "pserver-name2": "pserverName2-hello",
+ "ptnii-equip-name": "ptnii-equip-name-hello",
+ "equip-type": "Firewall",
+ "equip-vendor": "equip-vendor-hello",
+ "equip-model": "equip-model-hello",
+ "internet-topology": "internet-topology-hello",
+ "purpose": "purpose-something-for-fun",
+ "serial-number": "1223128888",
+ "in-maint": false,
+ "resource-version": "1544034123458",
+ "p-interfaces":{
+ "p-interface": [
+ {
+ "interface-name": "bdc3cc2a-c73e-414f-7ddb-367de92801cb",
+ "speed-value": "1225",
+ "speed-units": "mbs",
+ "port-description": "port-used-for-junit",
+ "equipment-identifier": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "interface-role": "123134236",
+ "interface-type": "Software",
+ "prov-status": "2",
+ "in-maint": "true",
+ "resource-version": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "inv-status": "TBD"
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "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-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "Firewall-0"
+ }]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/queryNodeData-1.json b/src/test/resources/junit/queryNodeData-1.json
index 501830b..ea4bd89 100644
--- a/src/test/resources/junit/queryNodeData-1.json
+++ b/src/test/resources/junit/queryNodeData-1.json
@@ -2,7 +2,7 @@
"result-data": [
{
"resource-type": "service-instance",
- "resource-link": "/aai/v11/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ "resource-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"
}
]
}