Skip to content

Commit f218624

Browse files
author
Fernando López
committed
Update 60x tutorials
1 parent 343ccbf commit f218624

26 files changed

Lines changed: 361 additions & 189 deletions

features/602.ngsild.RelationshipsAndDataModels_Orion-LD.feature

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Orion-LD)
120120
#
121121
Scenario: [8] FIND THE IDS OF ALL SHELF UNITS IN A STORE
122122
When I send GET HTTP request to Orion-LD at "http://localhost:1026/ngsi-ld/v1/entities/"
123-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
124-
And With parameters "type$Shelf$options$keyValues$attrs$locatedIn"
123+
And I set header Accept to application/json
124+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
125+
And the params equal to "type=Shelf"
126+
And the params equal to "options=keyValues"
127+
And the params equal to "attrs=locatedIn"
125128
Then I receive from Orion-LD "200" response code with the body equal to "response602-08.json"
126129

127130

@@ -147,8 +150,10 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Orion-LD)
147150
#
148151
Scenario: [10] FINDING ALL SHELF UNITS FOUND WITHIN A STORE
149152
When I send GET HTTP request to Orion-LD at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001"
150-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
151-
And With parameters "options$keyValues$attrs$furniture"
153+
And I set header Accept to application/json
154+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
155+
And the params equal to "options=keyValues"
156+
And the params equal to "attrs=furniture"
152157
Then I receive from Orion-LD "200" response code with the body equal to "response602-10.json"
153158

154159

@@ -174,8 +179,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Orion-LD)
174179
#
175180
Scenario: [12] FINDING ALL SHELF UNITS FOUND WITHIN A STORE
176181
When I send GET HTTP request to Orion-LD at "http://localhost:1026/ngsi-ld/v1/entities/"
177-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
178-
And With parameters "type$StockOrder$q$orderedProduct=="urn:ngsi-ld:Product:001"$attrs$requestedFor$options$keyValues"
182+
And I set header Accept to application/json
183+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
184+
And the params equal to "type=StockOrder"
185+
And the params equal to "q=orderedProduct=="urn:ngsi-ld:Product:001""
186+
And the params equal to "attrs=requestedFor"
187+
And the params equal to "options=keyValues"
179188
Then I receive from Orion-LD "200" response code with the body equal to "response602-12.json"
180189

181190

@@ -184,8 +193,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Orion-LD)
184193
#
185194
Scenario: [13] FIND ALL PRODUCTS SOLD IN A STORE
186195
When I send GET HTTP request to Orion-LD at "http://localhost:1026/ngsi-ld/v1/entities/"
187-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
188-
And With parameters "type$StockOrder$q$requestedFor=="urn:ngsi-ld:Building:store001"$attrs$orderedProduct$options$keyValues"
196+
And I set header Accept to application/json
197+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
198+
And the params equal to "type=StockOrder"
199+
And the params equal to "q=requestedFor=="urn:ngsi-ld:Building:store001""
200+
And the params equal to "attrs=orderedProduct"
201+
And the params equal to "options=keyValues"
189202
Then I receive from Orion-LD "200" response code with the body equal to "response602-13.json"
190203

191204

features/602.ngsild.RelationshipsAndDataModels_Scorpio.feature

Lines changed: 68 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
2727
# 2) attribute 'name' expected first, instead it is second after attribute 'https://schema.org/address'
2828
#
2929
Scenario: [1] DISPLAY ALL entities of a given type (BUILDINGS)
30-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities"
31-
And With header 'NA$NA'
32-
And With parameters "type$https://uri.fiware.org/ns/data-models#Building$options$keyValues"
33-
Then I receive from Scorpio "200" response code with the body equal to "response602-01.json"
30+
When I prepare a GET HTTP request for "obtaining an entity data" to "http://localhost:1026/ngsi-ld/v1/entities"
31+
And I set header Accept to application/ld+json
32+
And the params equal to "type=https://uri.fiware.org/ns/data-models#Building"
33+
And the params equal to "options=keyValues"
34+
And I perform the request
35+
Then I receive from Scorpio "200" response code with the body equal to "response602-01-list.json"
3436

3537

3638
#
@@ -39,9 +41,11 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
3941
# 1) attribute 'name' expected first, instead it is last
4042
#
4143
Scenario: [2] DISPLAY ALL entities of a given type (PRODUCT)
42-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities"
43-
And With header 'Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
44-
And With parameters "type$https://fiware.github.io/tutorials.Step-by-Step/schema/Product$options$keyValues"
44+
When I prepare a GET HTTP request for "obtaining entities data" to "http://localhost:1026/ngsi-ld/v1/entities"
45+
And I set header Link to <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
46+
And the params equal to "type=https://fiware.github.io/tutorials.Step-by-Step/schema/Product"
47+
And the params equal to "options=keyValues"
48+
And I perform the request
4549
Then I receive from Scorpio "200" response code with the body equal to "response602-02.json"
4650

4751

@@ -51,9 +55,11 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
5155
# 1) attribute 'name' expected first, instead it is second after 'maxCapacity' attribute
5256
#
5357
Scenario: [3] DISPLAY ALL entities of a given type (SHELF)
54-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities"
55-
And With header 'Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
56-
And With parameters "type$Shelf$options$keyValues"
58+
When I prepare a GET HTTP request for "obtaining entities data" to "http://localhost:1026/ngsi-ld/v1/entities"
59+
And I set header Link to <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
60+
And the params equal to "type=Shelf"
61+
And the params equal to "options=keyValues"
62+
And I perform the request
5763
Then I receive from Scorpio "200" response code with the body equal to "response602-03.json"
5864

5965

@@ -63,23 +69,24 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
6369
# 1) attributes order completely mixed-up. Expected: name, maxCapacity, location, Current: location, maxCapacity, name
6470
#
6571
Scenario: [4] OBTAIN SHELF INFORMATION
66-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/"
67-
And With header 'Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
68-
And With parameters "options$keyValues"
72+
When I prepare a GET HTTP request for "obtaining an entity data" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001"
73+
And I set header Link to <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
74+
And the params equal to "options=keyValues"
75+
And I perform the request
6976
Then I receive from Scorpio "200" response code with the body equal to "response602-04.json"
7077

7178

7279
#
7380
# Request 5
7481
#
7582
Scenario Outline: [5] ADDING 1-1 RELATIONSHIPS
76-
When I send POST HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/attrs"
77-
# And With the post header "fiware-servicepath": " /"
78-
And With the post header "NA": "NA"
79-
And With the body request described in an Scorpio file "<file>"
83+
When I prepare a POST HTTP request for "creating an entity" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/attrs"
84+
And I set header Content-Type to application/ld+json
85+
And I set the body request as described in <file>
86+
And I perform the request
8087
Then I receive a HTTP response with the following Scorpio data
81-
| Status-Code | Location | Connection | fiware-correlator |
82-
| 204 | <location> | Keep-Alive | Any |
88+
| Status-Code | Location |
89+
| 204 | <location> |
8390

8491
Examples:
8592
| file | location |
@@ -112,9 +119,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
112119
# current: 'https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld'
113120
#
114121
Scenario: [7] FIND THE STORE IN WHICH A SPECIFIC SHELF IS LOCATED
115-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/"
116-
And With header 'Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
117-
And With parameters "attrs$locatedIn$options$keyValues"
122+
When I prepare a GET HTTP request for "obtaining an entity data" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001"
123+
And I set header Link to <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
124+
And I set header Accept to application/ld+json
125+
And the params equal to "attrs=locatedIn"
126+
And the params equal to "options=keyValues"
127+
And I perform the request
118128
Then I receive from Scorpio "200" response code with the body equal to "response602-07.json"
119129

120130

@@ -123,21 +133,25 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
123133
#
124134
Scenario: [8] FIND THE IDS OF ALL SHELF UNITS IN A STORE
125135
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/"
126-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
127-
And With parameters "type$Shelf$options$keyValues$attrs$locatedIn"
136+
And I set header Accept to application/json
137+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
138+
And the params equal to "type=Shelf"
139+
And the params equal to "options=keyValues"
140+
And the params equal to "attrs=locatedIn"
128141
Then I receive from Scorpio "200" response code with the body equal to "response602-08.json"
129142

130143

131144
#
132145
# Request 9
133146
#
134147
Scenario Outline: [9] ADDING 1-MANY RELATIONSHIP
135-
When I send POST HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001/attrs"
136-
And With the post header "NA": "NA"
137-
And With the body request described in an Scorpio file "<file>"
148+
When I prepare a POST HTTP request for "adding new attribute" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001/attrs"
149+
And I set header Content-Type to application/ld+json
150+
And I set the body request as described in <file>
151+
And I perform the request
138152
Then I receive a HTTP response with the following Scorpio data
139-
| Status-Code | Location | Connection | fiware-correlator |
140-
| 204 | <location> | Keep-Alive | Any |
153+
| Status-Code | Location |
154+
| 204 | <location> |
141155

142156
Examples:
143157
| file | location |
@@ -149,18 +163,21 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
149163
#
150164
Scenario: [10] FINDING ALL SHELF UNITS FOUND WITHIN A STORE
151165
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001"
152-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
153-
And With parameters "options$keyValues$attrs$furniture"
166+
And I set header Accept to application/json
167+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
168+
And the params equal to "options=keyValues"
169+
And the params equal to "attrs=furniture"
154170
Then I receive from Scorpio "200" response code with the body equal to "response602-10.json"
155171

156172

157173
#
158174
# Request 11
159175
#
160176
Scenario Outline: [11] CREATING COMPLEX RELATIONSHIPS
161-
When I send POST HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/"
162-
And With the post header "NA": "NA"
163-
And With the body request described in an Scorpio file "<file>"
177+
When I prepare a POST HTTP request for "creating an entity" to "http://localhost:1026/ngsi-ld/v1/entities/"
178+
And I set header Content-Type to application/ld+json
179+
And I set the body request as described in <file>
180+
And I perform the request
164181
Then I receive a HTTP response with the following Scorpio data
165182
| Status-Code | Location | Connection | fiware-correlator |
166183
| 201 | <location> | Keep-Alive | Any |
@@ -175,8 +192,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
175192
#
176193
Scenario: [12] FINDING ALL SHELF UNITS FOUND WITHIN A STORE
177194
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/"
178-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
179-
And With parameters "type$StockOrder$q$orderedProduct=="urn:ngsi-ld:Product:001"$attrs$requestedFor$options$keyValues"
195+
And I set header Accept to application/json
196+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
197+
And the params equal to "type=StockOrder"
198+
And the params equal to "q=orderedProduct=="urn:ngsi-ld:Product:001""
199+
And the params equal to "attrs=requestedFor"
200+
And the params equal to "options=keyValues"
180201
Then I receive from Scorpio "200" response code with the body equal to "response602-12.json"
181202

182203

@@ -185,8 +206,12 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
185206
#
186207
Scenario: [13] FIND ALL PRODUCTS SOLD IN A STORE
187208
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/"
188-
And With header 'Accept$application/json$Link$<https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
189-
And With parameters "type$StockOrder$q$requestedFor=="urn:ngsi-ld:Building:store001"$attrs$orderedProduct$options$keyValues"
209+
And I set header Accept to application/json
210+
And I set header Link to <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
211+
And the params equal to "type=StockOrder"
212+
And the params equal to "q=requestedFor=="urn:ngsi-ld:Building:store001""
213+
And the params equal to "attrs=orderedProduct"
214+
And the params equal to "options=keyValues"
190215
Then I receive from Scorpio "200" response code with the body equal to "response602-13.json"
191216

192217

@@ -200,7 +225,8 @@ Feature: Test tutorial 602 Linked Data: Relationships and Data Models (Scorpio)
200225
# current attributes order: type, requestedFor, requestedBy, orderedProduct, stockCount, orderDate
201226
#
202227
Scenario: [14] OBTAIN STOCK ORDER
203-
When I send GET HTTP request to Scorpio at "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:StockOrder:001"
204-
And With header 'NA$NA'
205-
And With parameters "options$keyValues"
206-
Then I receive from Scorpio "200" response code with the body equal to "response602-14.json"
228+
When I prepare a GET HTTP request for "obtaining an entity data" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:StockOrder:001"
229+
And I set header Accept to application/ld+json
230+
And the params equal to "options=keyValues"
231+
And I perform the request
232+
Then I receive from Scorpio "200" response code with the body equal to "response602-14-list.json"

0 commit comments

Comments
 (0)