From 8661255afca19d7ef0750288c1a905e0bf89599a Mon Sep 17 00:00:00 2001 From: aosull01 Date: Fri, 1 Feb 2019 17:33:45 +0000 Subject: node query for service instance query Change-Id: I7147f76b65a02e61f804ff5fd1304e47a983e092 Issue-ID: EXTAPI-194 Signed-off-by: aosull01 --- .../features/01--ServiceInventory.feature | 14 ++---- .../karatetest/features/02--ServiceOrder.feature | 4 +- .../aai_get_6490_service-subscriptions.json | 4 +- .../resources/mappings/aai_get_customer_6490.json | 4 +- .../mappings/aai_get_customer_generic.json | 4 +- .../aai_get_generic_service-subscriptions.json | 4 +- ...i_get_service-subscription-Ansible-service.json | 4 +- .../mappings/aai_get_service-subscription.json | 55 ---------------------- .../aai_get_service-subscriptionWithoutList.json | 19 -------- .../mappings/aai_get_service-subscriptionsVFW.json | 4 +- ...service-subscriptionsvFW-service-2VF-based.json | 4 +- src/test/resources/mappings/aai_get_service_3.json | 19 ++++++++ .../mappings/aai_get_service_instance.json | 52 ++++++++++++++++++++ .../mappings/aai_get_service_instance_2.json | 55 ++++++++++++++++++++++ src/test/resources/mappings/aai_get_tenants.json | 4 +- src/test/resources/mappings/aai_put_customer.json | 4 +- .../mappings/aai_put_customer_service.json | 4 +- 17 files changed, 152 insertions(+), 106 deletions(-) delete mode 100644 src/test/resources/mappings/aai_get_service-subscription.json delete mode 100644 src/test/resources/mappings/aai_get_service-subscriptionWithoutList.json create mode 100644 src/test/resources/mappings/aai_get_service_3.json create mode 100644 src/test/resources/mappings/aai_get_service_instance.json create mode 100644 src/test/resources/mappings/aai_get_service_instance_2.json (limited to 'src/test') diff --git a/src/test/resources/karatetest/features/01--ServiceInventory.feature b/src/test/resources/karatetest/features/01--ServiceInventory.feature index 2065f8c..6dbef15 100644 --- a/src/test/resources/karatetest/features/01--ServiceInventory.feature +++ b/src/test/resources/karatetest/features/01--ServiceInventory.feature @@ -11,38 +11,32 @@ Background: Scenario: testServiceResourceGetInventory Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' -And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490'} When method get Then status 200 -And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } -And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', type : 'service-instance', @type : 'serviceONAP' } And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } And match $.supportingResource == '#[2]' Scenario: testServiceResourceGetInventoryWithStatus -Given url 'http://localhost:8080/nbi/api/v3/service/405c8c00-44b9-4303-9f27-6797d22ca096?serviceSpecification.name=AnsibleService&relatedParty.id=6490' +Given url 'http://localhost:8080/nbi/api/v3/service/405c8c00-44b9-4303-9f27-6797d22ca096' When method get Then status 200 And match $.state == 'Active' Scenario: testServiceResourceGetInventoryWithoutRelationShipList Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList' -And params {serviceSpecification.name:'vFW',relatedParty.id:'6490'} When method get Then status 200 -And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' , hasStarted : 'yes' , type : 'service-instance' , @type : 'serviceONAP' } -And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' , type : 'service-instance' , @type : 'serviceONAP' } And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } And match $.supportingResource == '#[0]' Scenario: testServiceResourceGetInventoryWithServiceSpecId Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' -And params {serviceSpecification.id:'1e3feeb0-8e36-46c6-862c-236d9c626439', relatedParty.id:'6490'} When method get Then status 200 -And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', hasStarted : 'yes', type : 'service-instance', @type : 'serviceONAP' } -And match $.relatedParty contains { role : 'ONAPcustomer' , id : '6490' } +And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', type : 'service-instance', @type : 'serviceONAP' } And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' } And match $.supportingResource[0] contains { id : 'cb80fbb6-9aa7-4ac5-9541-e14f45de533e' , name : 'NewFreeRadius-VNF-instance-01' , status : 'PREPROV' , modelInvariantId : 'f5993703-977f-4346-a1c9-c1884f8cfd8d' , modelVersionId : '902438f7-1e4c-492d-b7cc-8650e13b8aeb' , @referredType : 'ONAP resource' } And match $.supportingResource == '#[2]' diff --git a/src/test/resources/karatetest/features/02--ServiceOrder.feature b/src/test/resources/karatetest/features/02--ServiceOrder.feature index c621709..31aeff1 100644 --- a/src/test/resources/karatetest/features/02--ServiceOrder.feature +++ b/src/test/resources/karatetest/features/02--ServiceOrder.feature @@ -361,7 +361,7 @@ Then status 204 Scenario: testCheckServiceOrderWithCustomerAAINotResponding -* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new"); +* call Context.removeWireMockMapping("/aai/v14/business/customers/customer/new"); Given path 'serviceOrder' And request data[4] When method post @@ -382,7 +382,7 @@ Then status 200 Scenario: testAAIPutServiceNotResponding -* call Context.removeWireMockMapping("/aai/v11/business/customers/customer/new/service-subscriptions/service-subscription/vFW"); +* call Context.removeWireMockMapping("/aai/v14/business/customers/customer/new/service-subscriptions/service-subscription/vFW"); Given path 'serviceOrder' And request data[4] When method post diff --git a/src/test/resources/mappings/aai_get_6490_service-subscriptions.json b/src/test/resources/mappings/aai_get_6490_service-subscriptions.json index 4995025..7606483 100644 --- a/src/test/resources/mappings/aai_get_6490_service-subscriptions.json +++ b/src/test/resources/mappings/aai_get_6490_service-subscriptions.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions" + "url": "/aai/v14/business/customers/customer/6490/service-subscriptions" }, "response": { "status": 200, @@ -33,4 +33,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_customer_6490.json b/src/test/resources/mappings/aai_get_customer_6490.json index eaf5a4b..8361f94 100644 --- a/src/test/resources/mappings/aai_get_customer_6490.json +++ b/src/test/resources/mappings/aai_get_customer_6490.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/6490" + "url": "/aai/v14/business/customers/customer/6490" }, "response": { "status": 200, @@ -15,4 +15,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_customer_generic.json b/src/test/resources/mappings/aai_get_customer_generic.json index 250f5d6..9194687 100644 --- a/src/test/resources/mappings/aai_get_customer_generic.json +++ b/src/test/resources/mappings/aai_get_customer_generic.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/generic" + "url": "/aai/v14/business/customers/customer/generic" }, "response": { "status": 200, @@ -15,4 +15,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_generic_service-subscriptions.json b/src/test/resources/mappings/aai_get_generic_service-subscriptions.json index 5cf9ddd..73bd5e1 100644 --- a/src/test/resources/mappings/aai_get_generic_service-subscriptions.json +++ b/src/test/resources/mappings/aai_get_generic_service-subscriptions.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/generic/service-subscriptions" + "url": "/aai/v14/business/customers/customer/generic/service-subscriptions" }, "response": { "status": 200, @@ -17,4 +17,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_service-subscription-Ansible-service.json b/src/test/resources/mappings/aai_get_service-subscription-Ansible-service.json index 10bcac8..121f7d1 100644 --- a/src/test/resources/mappings/aai_get_service-subscription-Ansible-service.json +++ b/src/test/resources/mappings/aai_get_service-subscription-Ansible-service.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions/service-subscription/AnsibleService/service-instances/service-instance/405c8c00-44b9-4303-9f27-6797d22ca096" + "url": "/aai/v14/business/customers/customer/6490/service-subscriptions/service-subscription/AnsibleService/service-instances/service-instance/405c8c00-44b9-4303-9f27-6797d22ca096" }, "response": { "status": 200, @@ -49,4 +49,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_service-subscription.json b/src/test/resources/mappings/aai_get_service-subscription.json deleted file mode 100644 index 03558a9..0000000 --- a/src/test/resources/mappings/aai_get_service-subscription.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "request": { - "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions/service-subscription/vFW/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb" - }, - "response": { - "status": 200, - "jsonBody": { - "service-instance-id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", - "service-instance-name": "NewFreeRadius-service-instance-01", - "model-invariant-id": "709d157b-52fb-4250-976e-7133dff5c347", - "model-version-id": "98d95267-5e0f-4531-abf8-f14b90031dc5", - "resource-version": "1518508381261", - "relationship-list": { - "relationship": [ - { - "related-to": "generic-vnf", - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/cb80fbb6-9aa7-4ac5-9541-e14f45de533e", - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "cb80fbb6-9aa7-4ac5-9541-e14f45de533e" - } - ], - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "NewFreeRadius-VNF-instance-01" - } - ] - }, - { - "related-to": "generic-vnf", - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/cb80fbb6-9aa7-4ac5-9541-e14f45de533e", - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "cb80fbb6-9aa7-4ac5-9541-e14f45de533e" - } - ], - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "NewFreeRadius-VNF-instance-01" - } - ] - } - ] - } - }, - "headers": { - "Content-Type": "application/json" - } - } -} \ No newline at end of file diff --git a/src/test/resources/mappings/aai_get_service-subscriptionWithoutList.json b/src/test/resources/mappings/aai_get_service-subscriptionWithoutList.json deleted file mode 100644 index 2765c77..0000000 --- a/src/test/resources/mappings/aai_get_service-subscriptionWithoutList.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions/service-subscription/vFW/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList" - }, - "response": { - "status": 200, - "jsonBody": { - "service-instance-id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", - "service-instance-name": "NewFreeRadius-service-instance-01", - "model-invariant-id": "709d157b-52fb-4250-976e-7133dff5c347", - "model-version-id": "98d95267-5e0f-4531-abf8-f14b90031dc5", - "resource-version": "1518508381261" - }, - "headers": { - "Content-Type": "application/json" - } - } -} \ No newline at end of file diff --git a/src/test/resources/mappings/aai_get_service-subscriptionsVFW.json b/src/test/resources/mappings/aai_get_service-subscriptionsVFW.json index 093dd96..6fb1b4c 100644 --- a/src/test/resources/mappings/aai_get_service-subscriptionsVFW.json +++ b/src/test/resources/mappings/aai_get_service-subscriptionsVFW.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions/service-subscription/vFW/service-instances/" + "url": "/aai/v14/business/customers/customer/6490/service-subscriptions/service-subscription/vFW/service-instances/" }, "response": { "status": 200, @@ -40,4 +40,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_service-subscriptionsvFW-service-2VF-based.json b/src/test/resources/mappings/aai_get_service-subscriptionsvFW-service-2VF-based.json index 444e3cd..10c172d 100644 --- a/src/test/resources/mappings/aai_get_service-subscriptionsvFW-service-2VF-based.json +++ b/src/test/resources/mappings/aai_get_service-subscriptionsvFW-service-2VF-based.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/business/customers/customer/6490/service-subscriptions/service-subscription/vFW-service-2VF-based/service-instances/" + "url": "/aai/v14/business/customers/customer/6490/service-subscriptions/service-subscription/vFW-service-2VF-based/service-instances/" }, "response": { "status": 200, @@ -40,4 +40,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_get_service_3.json b/src/test/resources/mappings/aai_get_service_3.json new file mode 100644 index 0000000..fc2e416 --- /dev/null +++ b/src/test/resources/mappings/aai_get_service_3.json @@ -0,0 +1,19 @@ +{ + "request": { + "method": "GET", + "url": "/aai/v14/nodes/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList" + }, + "response": { + "status": 200, + "jsonBody": { + "service-instance-id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "service-instance-name": "NewFreeRadius-service-instance-01", + "model-invariant-id": "709d157b-52fb-4250-976e-7133dff5c347", + "model-version-id": "98d95267-5e0f-4531-abf8-f14b90031dc5", + "resource-version": "1518508381261" + }, + "headers": { + "Content-Type": "application/json" + } + } +} diff --git a/src/test/resources/mappings/aai_get_service_instance.json b/src/test/resources/mappings/aai_get_service_instance.json new file mode 100644 index 0000000..d9f2ab2 --- /dev/null +++ b/src/test/resources/mappings/aai_get_service_instance.json @@ -0,0 +1,52 @@ +{ + "request": { + "method": "GET", + "url": "/aai/v14/nodes/service-instances/service-instance/405c8c00-44b9-4303-9f27-6797d22ca096" + }, + "response": { + "status": 200, + "jsonBody": { + "service-instance-id": "405c8c00-44b9-4303-9f27-6797d22ca096", + "service-instance-name": "ansibleService-service-instance-065FYE", + "environment-context": "General_Revenue-Bearing", + "workload-context": "Production", + "model-invariant-id": "f3ec9092-5c98-41f1-9fea-96be80abd064", + "model-version-id": "0bf5f56a-4506-4e98-ab50-336d73ca4b07", + "resource-version": "1530200875713", + "orchestration-status": "Active", + "relationship-list": { + "relationship": [ + { + "related-to": "generic-vnf", + "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/3f73377f-d9be-4a33-b068-e3f35b5b770b", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "3f73377f-d9be-4a33-b068-e3f35b5b770b" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "ansibleService-vnf-instance-DebianVNF_0_065FYE" + } + ] + }, + { + "related-to": "owning-entity", + "related-link": "/aai/v11/business/owning-entities/owning-entity/OE-generic", + "relationship-data": [ + { + "relationship-key": "owning-entity.owning-entity-id", + "relationship-value": "OE-generic" + } + ] + } + ] + } + }, + "headers": { + "Content-Type": "application/json" + } + } +} diff --git a/src/test/resources/mappings/aai_get_service_instance_2.json b/src/test/resources/mappings/aai_get_service_instance_2.json new file mode 100644 index 0000000..7d90bc2 --- /dev/null +++ b/src/test/resources/mappings/aai_get_service_instance_2.json @@ -0,0 +1,55 @@ +{ + "request": { + "method": "GET", + "url": "/aai/v14/nodes/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb" + }, + "response": { + "status": 200, + "jsonBody": { + "service-instance-id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcb", + "service-instance-name": "NewFreeRadius-service-instance-01", + "model-invariant-id": "709d157b-52fb-4250-976e-7133dff5c347", + "model-version-id": "98d95267-5e0f-4531-abf8-f14b90031dc5", + "resource-version": "1518508381261", + "relationship-list": { + "relationship": [ + { + "related-to": "generic-vnf", + "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/cb80fbb6-9aa7-4ac5-9541-e14f45de533e", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "cb80fbb6-9aa7-4ac5-9541-e14f45de533e" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "NewFreeRadius-VNF-instance-01" + } + ] + }, + { + "related-to": "generic-vnf", + "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/cb80fbb6-9aa7-4ac5-9541-e14f45de533e", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "cb80fbb6-9aa7-4ac5-9541-e14f45de533e" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "NewFreeRadius-VNF-instance-01" + } + ] + } + ] + } + }, + "headers": { + "Content-Type": "application/json" + } + } +} diff --git a/src/test/resources/mappings/aai_get_tenants.json b/src/test/resources/mappings/aai_get_tenants.json index 7581a91..2dda86e 100644 --- a/src/test/resources/mappings/aai_get_tenants.json +++ b/src/test/resources/mappings/aai_get_tenants.json @@ -1,7 +1,7 @@ { "request": { "method": "GET", - "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants" + "url": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants" }, "response": { "status": 200, @@ -164,4 +164,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_put_customer.json b/src/test/resources/mappings/aai_put_customer.json index ec28b72..f9f2418 100644 --- a/src/test/resources/mappings/aai_put_customer.json +++ b/src/test/resources/mappings/aai_put_customer.json @@ -1,7 +1,7 @@ { "request": { "method": "PUT", - "url": "/aai/v11/business/customers/customer/new" + "url": "/aai/v14/business/customers/customer/new" }, "response": { "status": 201, @@ -9,4 +9,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} diff --git a/src/test/resources/mappings/aai_put_customer_service.json b/src/test/resources/mappings/aai_put_customer_service.json index 889627a..98ed133 100644 --- a/src/test/resources/mappings/aai_put_customer_service.json +++ b/src/test/resources/mappings/aai_put_customer_service.json @@ -1,7 +1,7 @@ { "request": { "method": "PUT", - "url": "/aai/v11/business/customers/customer/new/service-subscriptions/service-subscription/vFW" + "url": "/aai/v14/business/customers/customer/new/service-subscriptions/service-subscription/vFW" }, "response": { "status": 201, @@ -9,4 +9,4 @@ "Content-Type": "application/json" } } -} \ No newline at end of file +} -- cgit 1.2.3-korg