node query for service instance query
[externalapi/nbi.git] / src / test / resources / karatetest / features / 01--ServiceInventory.feature
1 # new feature
2 # Tags: optional
3     
4 Feature: Service Inventory
5
6 Background:
7 * url nbiBaseUrl
8 * def Context = Java.type('org.onap.nbi.test.Context');
9 * call Context.startServers();
10
11     
12 Scenario: testServiceResourceGetInventory
13 Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
14 When method get
15 Then status 200
16 And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', type : 'service-instance', @type : 'serviceONAP' }
17 And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' }
18 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' }
19 And match $.supportingResource == '#[2]'
20
21 Scenario: testServiceResourceGetInventoryWithStatus
22 Given url 'http://localhost:8080/nbi/api/v3/service/405c8c00-44b9-4303-9f27-6797d22ca096'
23 When method get
24 Then status 200
25 And match $.state == 'Active'
26
27 Scenario: testServiceResourceGetInventoryWithoutRelationShipList
28 Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcbWithoutList'
29 When method get
30 Then status 200
31 And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' , type : 'service-instance' , @type : 'serviceONAP' }
32 And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' }
33 And match $.supportingResource == '#[0]'
34
35 Scenario: testServiceResourceGetInventoryWithServiceSpecId
36 Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
37 When method get
38 Then status 200
39 And match $ contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01', type : 'service-instance', @type : 'serviceONAP' }
40 And match $.serviceSpecification contains { id : '98d95267-5e0f-4531-abf8-f14b90031dc5' , invariantUUID : '709d157b-52fb-4250-976e-7133dff5c347' , @type : 'ONAPservice' }
41 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' }
42 And match $.supportingResource == '#[2]'
43
44
45 Scenario: testServiceInventoryFind
46 Given path 'service'
47 And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490' }
48 When method get
49 Then status 200
50 And match $ == '#[1]'
51 And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' }
52 And match $[0].relatedParty  contains { role : 'ONAPcustomer' , id : '6490' }
53 And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' }
54
55 Scenario: testServiceInventoryFindWithServiceSpecId
56 Given path 'service'
57 And params {serviceSpecification.id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , relatedParty.id : '6490'}
58 When method get
59 Then status 200
60 And match $ == '#[1]'
61 And match $[0] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' }
62 And match $[0].relatedParty  contains { role : 'ONAPcustomer' , id : '6490' }
63 And match $[0].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' }
64
65 Scenario: testServiceInventoryFindWithoutParameter
66 Given path 'service'
67 And params {relatedParty.id:'6490'}
68 When method get
69 Then status 200
70 And match $ == '#[2]'
71 And match $[0] contains { id : 'vfw-service-id' , name : 'vfw-service-name' }
72 And match $[0].relatedParty  contains { role : 'ONAPcustomer' , id : '6490' }
73 And match $[0].serviceSpecification contains { name : 'vFW-service-2VF-based' , id : '9vfw-service-modek-version-id' }
74 And match $[1] contains { id : 'e4688e5f-61a0-4f8b-ae02-a2fbde623bcb' , name : 'NewFreeRadius-service-instance-01' }
75 And match $[1].relatedParty  contains { role : 'ONAPcustomer' , id : '6490' }
76 And match $[1].serviceSpecification contains { name : 'vFW' , id : '98d95267-5e0f-4531-abf8-f14b90031dc5' }
77
78
79 Scenario: testServiceResourceGetInventoryWithoutWiremock
80 * call Context.stopWiremock();
81 Given path 'service','e4688e5f-61a0-4f8b-ae02-a2fbde623bcb'
82 And params {serviceSpecification.name : 'vFW' , relatedParty.id : '6490'}
83 When method get
84 Then status 500
85 * call Context.startServers();
86
87
88
89
90
91
92