Service Catalog - json schema reference
[externalapi/nbi.git] / src / test / resources / karatetest / features / 00--ServiceCatalog.feature
1 # new feature
2 # Tags: optional
3
4 Feature: Service Catalog
5
6 Background:
7 * url nbiBaseUrl
8 * def Context = Java.type('org.onap.nbi.test.Context');
9 * call Context.startServers();
10     
11 Scenario: testServiceCatalogGetResourceWithoutTosca
12 Given path 'serviceSpecification','1e3feeb0-8e36-46c6-862c-236d9c626439_withoutTosca'
13 When method get
14 Then status 206
15 And match $ contains { id : '1e3feeb0-8e36-46c6-862c-236d9c626439' , name : 'vFW' , invariantUUID : 'b58a118e-eeb9-4f6e-bdca-e292f84d17df' , toscaModelURL : '/sdc/v1/catalog/services/1e3feeb0-8e36-46c6-862c-236d9c626439toto/toscaModel' , distributionStatus : 'DISTRIBUTED' , version : '2.0' , lifecycleStatus : 'CERTIFIED' , @type : 'ONAPservice' , attachment : '#array' , relatedParty : '#notnull' , resourceSpecification : '#array' }
16 And match $.relatedParty contains { name : 'Joni Mitchell', role : 'lastUpdater' }
17 And match $.resourceSpecification[0] contains { name : 'vFW-vSINK', resourceInstanceName : 'vFW-vSINK 0', resourceType : 'VF' , resourceInvariantUUID : '18b90934-aa82-456f-938e-e74a07a426f3' , @type : 'ONAPresource', modelCustomizationName : 'vFW-vSINK 0' }
18 And match $.resourceSpecification == '#[2]'
19 And match $.attachment == '#[5]'
20
21 Scenario: testServiceCatalogGetServiceWithToscaInput
22 Given path 'serviceSpecification','462f84e5-f0e5-44c5-ab95-38fb4bf77064'
23 When method get
24 Then status 200
25 And match $ contains { id : '462f84e5-f0e5-44c5-ab95-38fb4bf77064' , name : 'vFW' , invariantUUID : 'b58a118e-eeb9-4f6e-bdca-e292f84d17df' , toscaModelURL : '/sdc/v1/catalog/services/462f84e5-f0e5-44c5-ab95-38fb4bf77064/toscaModel' , distributionStatus : 'DISTRIBUTED' , version : '2.0' , lifecycleStatus : 'CERTIFIED' , @type : 'ONAPservice' , attachment : '#array' , relatedParty : '#notnull' , resourceSpecification : '#array' }
26 And match $.serviceSpecCharacteristic contains
27 """
28 {
29     name : 'vFW_ServiceCharacteristics',
30     description : 'This object describes all the inputs needed from the client to interact with the vFW Service Topology',
31     valueType : 'Object',
32     @type : 'ONAPServiceCharacteristic',
33     @schemaLocation : 'null',
34     serviceSpecCharacteristicValue :
35     {
36        valueType : 'Object',
37        @schemaLocation : '/serviceSpecification/462f84e5-f0e5-44c5-ab95-38fb4bf77064/specificationInputSchema',
38        @type : 'vFW_ServiceCharacteristic',
39     }
40 }
41 """
42
43
44 Scenario: testServiceCatalogInputSchema
45 Given path 'serviceSpecification','462f84e5-f0e5-44c5-ab95-38fb4bf77064'
46 When method get
47 Then status 200
48 Given path 'serviceSpecification','462f84e5-f0e5-44c5-ab95-38fb4bf77064','specificationInputSchema'
49 When method get
50 Then status 200
51 And match $ contains
52 """
53 {
54   "ServiceCharacteristics" : {
55     "required" : [ "sdwanconnectivity0_name", "sdwanconnectivity0_topology" ],
56     "properties" : {
57       "sdwanconnectivity0_topology" : {
58         "type" : "string",
59         "description" : "full mesh, hub-spoke"
60       },
61       "sdwanconnectivity0_name" : {
62         "type" : "string",
63         "description" : "the name of this VPM object"
64       }
65     }
66   }
67 }
68 """
69
70
71 Scenario: findServiceCatalog
72 Given path 'serviceSpecification'
73 When method get
74 Then status 200
75 And assert response.length == 21
76 And match $[0] contains { id : '446afaf6-79b5-420e-aff8-7551b00bb510' , name : 'FreeRadius-service' , invariantUUID : '7e4781e8-6c6e-41c5-b889-6a321d5f2490' , category : 'Network L4+' , distributionStatus : 'DISTRIBUTED' , version : '1.0' , lifecycleStatus : 'CERTIFIED'  }
77 And match $[0].relatedParty contains { role : 'lastUpdater' }
78
79
80
81 Scenario: findServiceCatalogWithFilter
82 Given path 'serviceSpecification'
83 And params {fields:'name'}
84 When method get
85 Then status 200
86 And assert response.length == 21
87 And match $[0] contains { name : 'FreeRadius-service' }
88
89 Scenario: findServiceCatalogWithoutWiremock
90 * call Context.stopWiremock();
91 Given path 'serviceSpecification','1e3feeb0-8e36-46c6-862c-236d9c626439'
92 When method get
93 Then status 500
94 * call Context.startServers();
95
96