summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/resources/karatetest/features/01--ServiceInventory.feature20
-rw-r--r--src/test/resources/mappings/aai_get_service_3_format_resource_url.json26
-rw-r--r--src/test/resources/mappings/aai_get_service_instance_2_format_resource_url.json62
-rw-r--r--src/test/resources/mappings/aai_get_service_instance_format_resource_url.json59
4 files changed, 155 insertions, 12 deletions
diff --git a/src/test/resources/karatetest/features/01--ServiceInventory.feature b/src/test/resources/karatetest/features/01--ServiceInventory.feature
index 6dbef15..3ae33b1 100644
--- a/src/test/resources/karatetest/features/01--ServiceInventory.feature
+++ b/src/test/resources/karatetest/features/01--ServiceInventory.feature
@@ -7,40 +7,36 @@ Background:
* url nbiBaseUrl
* def Context = Java.type('org.onap.nbi.test.Context');
* call Context.startServers();
-
Scenario: testServiceResourceGetInventory
Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
When method get
Then status 200
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 $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice', name :'servicename2' }
+And match $.relatedParty contains { role : 'ONAPcustomer' , id : 'DemoTest2' }
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'
When method get
Then status 200
And match $.state == 'Active'
+And match $.relatedParty contains { role : 'ONAPcustomer' , id : 'DemoTest1' }
+And match $.serviceSpecification contains { id : '0bf5f56a-4506-4e98-ab50-336d73ca4b07' , invariantUUID : 'f3ec9092-5c98-41f1-9fea-96be80abd064' , @type : 'ONAPservice', name :'servicename1' }
+
Scenario: testServiceResourceGetInventoryWithoutRelationShipList
Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList'
When method get
Then status 200
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 $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice', name : 'servicename3' }
+And match $.relatedParty contains { role : 'ONAPcustomer' , id : 'DemoTest3' }
And match $.supportingResource == '#[0]'
-Scenario: testServiceResourceGetInventoryWithServiceSpecId
-Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
-When method get
-Then status 200
-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: testServiceInventoryFind
Given path 'service'
diff --git a/src/test/resources/mappings/aai_get_service_3_format_resource_url.json b/src/test/resources/mappings/aai_get_service_3_format_resource_url.json
new file mode 100644
index 0000000..f78847d
--- /dev/null
+++ b/src/test/resources/mappings/aai_get_service_3_format_resource_url.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/aai/v14/nodes/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList?format=resource_and_url"
+ },
+ "response": {
+ "status": 200,
+ "jsonBody": {
+ "results": [
+ {
+ "url": "/aai/v14/business/customers/customer/DemoTest3/service-subscriptions/service-subscription/servicename3/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList",
+ "service-instance": {
+ "service-instance-id": "e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList",
+ "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_2_format_resource_url.json b/src/test/resources/mappings/aai_get_service_instance_2_format_resource_url.json
new file mode 100644
index 0000000..086441e
--- /dev/null
+++ b/src/test/resources/mappings/aai_get_service_instance_2_format_resource_url.json
@@ -0,0 +1,62 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/aai/v14/nodes/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb?format=resource_and_url"
+ },
+ "response": {
+ "status": 200,
+ "jsonBody": {
+ "results": [
+ {
+ "url": "/aai/v14/business/customers/customer/DemoTest2/service-subscriptions/service-subscription/servicename2/service-instances/service-instance/e4688e5f-61a0-4f8b-ae02-a2fbde623bcb",
+ "service-instance": {
+ "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_service_instance_format_resource_url.json b/src/test/resources/mappings/aai_get_service_instance_format_resource_url.json
new file mode 100644
index 0000000..7f0db27
--- /dev/null
+++ b/src/test/resources/mappings/aai_get_service_instance_format_resource_url.json
@@ -0,0 +1,59 @@
+{
+ "request": {
+ "method": "GET",
+ "url": "/aai/v14/nodes/service-instances/service-instance/405c8c00-44b9-4303-9f27-6797d22ca096?format=resource_and_url"
+ },
+ "response": {
+ "status": 200,
+ "jsonBody": {
+ "results": [
+ {
+ "url": "/aai/v14/business/customers/customer/DemoTest1/service-subscriptions/service-subscription/servicename1/service-instances/service-instance/405c8c00-44b9-4303-9f27-6797d22ca096",
+ "service-instance": {
+ "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"
+ }
+ }
+}