Skip to content

Commit 2c6560c

Browse files
author
Fernando López
committed
Introduce the test of NGSI-LD tutorials 103, 104, 105, and 106 and make some corrections
1 parent c79b382 commit 2c6560c

47 files changed

Lines changed: 1063 additions & 116 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

features/103.ngsild.CRUD_Operations_orionld.feature

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
2121
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
2222
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
2323
And I send a GET HTTP request to that url
24-
Then I receive a HTTP "200" response code
24+
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response103ld-02.json"
2525

2626
Scenario: 03 - Create New Attributes
2727
When I set the "Content-Type" header with the value "application/json"
@@ -34,9 +34,8 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
3434
Scenario: 04 - Read a Data Entity (verbose)
3535
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
3636
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
37-
And I set the params equal to "options=sysAttrs"
3837
And I send a GET HTTP request to that url
39-
Then I receive a HTTP "200" response code
38+
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response103ld-04.json"
4039

4140
Scenario: 05 - Batch Create New Data Entities or Attributes
4241
When I set the "Content-Type" header with the value "application/json"
@@ -70,6 +69,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
7069
And I send a GET HTTP request to that url
7170
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response103ld-08.json"
7271

72+
# Need to change the tutorial, category is vocab and temperature is 25
7373
Scenario: 09 - Read a Data Entity (key-value pairs)
7474
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
7575
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
@@ -89,6 +89,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
8989

9090
Scenario: 11 - List all Data Entities (verbose)
9191
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
92+
And I set the "Accept" header with the value "application/ld+json"
9293
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/"
9394
And I set the params equal to "type=TemperatureSensor"
9495
And I send a GET HTTP request to that url
@@ -114,13 +115,14 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
114115
And I send a GET HTTP request to that url
115116
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response103ld-13.json"
116117

118+
# Orion-LD crash here
117119
Scenario: 14 - Overwrite the value of an Attribute value
118120
When I set the "Content-Type" header with the value "application/json"
119121
And I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
120122
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001/attrs/category"
121123
And I set the request body described in file "request103ld-14.json"
122124
And I send a PATCH HTTP request to that url
123-
Then I receive a HTTP "204" response code
125+
Then I receive a HTTP "200" response code
124126

125127
Scenario: 15 - Overwrite Multiple Attributes of a Data Entity
126128
When I set the "Content-Type" header with the value "application/json"
@@ -149,7 +151,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
149151
Scenario: 18 - Delete an Entity
150152
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:004"
151153
And I send a DELETE HTTP request to that url
152-
Then I receive a HTTP "204" response code
154+
Then I receive a HTTP "204" response code from Orion-LD with the body equal to "response103ld-18.json"
153155

154156
Scenario: 19 - Delete an Attribute from an Entity
155157
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
@@ -160,11 +162,19 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Orion-LD)
160162
Scenario: 20 - Batch Delete Multiple Entities
161163
When I set the "Content-Type" header with the value "application/json"
162164
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/delete"
163-
And the body request described in file "request103ld-20.json"
165+
And I set the request body described in file "request103ld-20.json"
164166
And I send a POST HTTP request to that url
165167
Then I receive a HTTP "204" response code
166168

167-
Scenario: 21 - Find Existing Data Relationships
169+
# It will produce always an error 404
170+
Scenario: 21 - Batch Delete Multiple Attributes from an Entity
171+
When I set the "Content-Type" header with the value "application/json"
172+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/delete"
173+
And I set the request body described in file "request103ld-20.json"
174+
And I send a POST HTTP request to that url
175+
Then I receive a HTTP "204" response code from Orion-LD with the body equal to "response103ld-21.json"
176+
177+
Scenario: 22 - Find Existing Data Relationships
168178
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
169179
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/?type=TemperatureSensor&limit=0&count=true&q=controlledAsset==%22urn:ngsi-ld:Building:barn002%22"
170180
And I set the "Accept" header with the value "application/json"

features/103.ngsild.CRUD_Operations_scorpio.feature

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
2121
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
2222
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
2323
And I send a GET HTTP request to that url
24-
Then I receive a HTTP "200" response code
24+
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response103ld-02.json"
2525

2626
Scenario: 03 - Create New Attributes
2727
When I set the "Content-Type" header with the value "application/json"
@@ -34,9 +34,8 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
3434
Scenario: 04 - Read a Data Entity (verbose)
3535
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
3636
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
37-
And I set the params equal to "options=sysAttrs"
3837
And I send a GET HTTP request to that url
39-
Then I receive a HTTP "200" response code
38+
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response103ld-04.json"
4039

4140
Scenario: 05 - Batch Create New Data Entities or Attributes
4241
When I set the "Content-Type" header with the value "application/json"
@@ -70,6 +69,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
7069
And I send a GET HTTP request to that url
7170
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response103ld-08.json"
7271

72+
# Need to change the tutorial, category is vocab and temperature is 25
7373
Scenario: 09 - Read a Data Entity (key-value pairs)
7474
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
7575
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
@@ -89,6 +89,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
8989

9090
Scenario: 11 - List all Data Entities (verbose)
9191
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
92+
And I set the "Accept" header with the value "application/ld+json"
9293
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/"
9394
And I set the params equal to "type=TemperatureSensor"
9495
And I send a GET HTTP request to that url
@@ -149,7 +150,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
149150
Scenario: 18 - Delete an Entity
150151
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:004"
151152
And I send a DELETE HTTP request to that url
152-
Then I receive a HTTP "204" response code
153+
Then I receive a HTTP "204" response code from Scorpio with the body equal to "response103ld-18.json"
153154

154155
Scenario: 19 - Delete an Attribute from an Entity
155156
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
@@ -160,11 +161,19 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Scorpio)
160161
Scenario: 20 - Batch Delete Multiple Entities
161162
When I set the "Content-Type" header with the value "application/json"
162163
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/delete"
163-
And the body request described in file "request103ld-20.json"
164+
And I set the request body described in file "request103ld-20.json"
164165
And I send a POST HTTP request to that url
165166
Then I receive a HTTP "204" response code
166167

167-
Scenario: 21 - Find Existing Data Relationships
168+
# It will produce always an error 404
169+
Scenario: 21 - Batch Delete Multiple Attributes from an Entity
170+
When I set the "Content-Type" header with the value "application/json"
171+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/delete"
172+
And I set the request body described in file "request103ld-20.json"
173+
And I send a POST HTTP request to that url
174+
Then I receive a HTTP "204" response code from Scorpio with the body equal to "response103ld-21.json"
175+
176+
Scenario: 22 - Find Existing Data Relationships
168177
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
169178
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/?type=TemperatureSensor&limit=0&count=true&q=controlledAsset==%22urn:ngsi-ld:Building:barn002%22"
170179
And I set the "Accept" header with the value "application/json"

features/103.ngsild.CRUD_Operations_stellio.feature

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
2121
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
2222
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
2323
And I send a GET HTTP request to that url
24-
Then I receive a HTTP "200" response code
24+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response103ld-02.json"
2525

2626
Scenario: 03 - Create New Attributes
2727
When I set the "Content-Type" header with the value "application/json"
@@ -34,9 +34,8 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
3434
Scenario: 04 - Read a Data Entity (verbose)
3535
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
3636
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
37-
And I set the params equal to "options=sysAttrs"
3837
And I send a GET HTTP request to that url
39-
Then I receive a HTTP "200" response code
38+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response103ld-04.json"
4039

4140
Scenario: 05 - Batch Create New Data Entities or Attributes
4241
When I set the "Content-Type" header with the value "application/json"
@@ -54,7 +53,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
5453
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/upsert"
5554
And I set the request body described in file "request103ld-06.json"
5655
And I send a POST HTTP request to that url
57-
Then I receive a HTTP "204" response code
56+
Then I receive a HTTP "204" response code
5857

5958
Scenario: 07 - Read a Data Entity (verbose)
6059
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
@@ -70,6 +69,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
7069
And I send a GET HTTP request to that url
7170
Then I receive a HTTP "200" response code from Stellio with the body equal to "response103ld-08.json"
7271

72+
# Need to change the tutorial, category is vocab and temperature is 25
7373
Scenario: 09 - Read a Data Entity (key-value pairs)
7474
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
7575
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001"
@@ -89,6 +89,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
8989

9090
Scenario: 11 - List all Data Entities (verbose)
9191
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
92+
And I set the "Accept" header with the value "application/ld+json"
9293
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/"
9394
And I set the params equal to "type=TemperatureSensor"
9495
And I send a GET HTTP request to that url
@@ -120,7 +121,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
120121
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001/attrs/category"
121122
And I set the request body described in file "request103ld-14.json"
122123
And I send a PATCH HTTP request to that url
123-
Then I receive a HTTP "204" response code
124+
Then I receive a HTTP "204" response code
124125

125126
Scenario: 15 - Overwrite Multiple Attributes of a Data Entity
126127
When I set the "Content-Type" header with the value "application/json"
@@ -149,7 +150,7 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
149150
Scenario: 18 - Delete an Entity
150151
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:004"
151152
And I send a DELETE HTTP request to that url
152-
Then I receive a HTTP "204" response code
153+
Then I receive a HTTP "204" response code from Stellio with the body equal to "response103ld-18.json"
153154

154155
Scenario: 19 - Delete an Attribute from an Entity
155156
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
@@ -164,7 +165,15 @@ Feature: Test tutorial 103.NGSI-LD.CRUD Operations (Stellio)
164165
And I send a POST HTTP request to that url
165166
Then I receive a HTTP "204" response code
166167

167-
Scenario: 21 - Find Existing Data Relationships
168+
# It will produce always an error 404
169+
Scenario: 21 - Batch Delete Multiple Attributes from an Entity
170+
When I set the "Content-Type" header with the value "application/json"
171+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entityOperations/delete"
172+
And I set the request body described in file "request103ld-20.json"
173+
And I send a POST HTTP request to that url
174+
Then I receive a HTTP "204" response code from Stellio with the body equal to "response103ld-21.json"
175+
176+
Scenario: 22 - Find Existing Data Relationships
168177
When I set the "Link" header with the value "<http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
169178
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities/?type=TemperatureSensor&limit=0&count=true&q=controlledAsset==%22urn:ngsi-ld:Building:barn002%22"
170179
And I set the "Accept" header with the value "application/json"

0 commit comments

Comments
 (0)