From b968389c706a57896e38f870c26b3446f00a2409 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 9 Sep 2020 16:56:08 +0200 Subject: [PATCH 001/442] feat: bootstrap some samples of NGSI-LD entities --- samples/building-location-attribute.jsonld | 23 ++++++++++++++ samples/building-minimal.jsonld | 8 +++++ .../building-relationship-of-property.jsonld | 30 +++++++++++++++++++ samples/building-relationship.jsonld | 12 ++++++++ samples/building-simple-attributes.jsonld | 26 ++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 samples/building-location-attribute.jsonld create mode 100644 samples/building-minimal.jsonld create mode 100644 samples/building-relationship-of-property.jsonld create mode 100644 samples/building-relationship.jsonld create mode 100644 samples/building-simple-attributes.jsonld diff --git a/samples/building-location-attribute.jsonld b/samples/building-location-attribute.jsonld new file mode 100644 index 00000000..864d122e --- /dev/null +++ b/samples/building-location-attribute.jsonld @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/samples/building-minimal.jsonld b/samples/building-minimal.jsonld new file mode 100644 index 00000000..23fadf8a --- /dev/null +++ b/samples/building-minimal.jsonld @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/samples/building-relationship-of-property.jsonld b/samples/building-relationship-of-property.jsonld new file mode 100644 index 00000000..6483778e --- /dev/null +++ b/samples/building-relationship-of-property.jsonld @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z", + "hasWeatherObserved": { + "type": "Relationship", + "object": "urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/samples/building-relationship.jsonld b/samples/building-relationship.jsonld new file mode 100644 index 00000000..ec4bb68b --- /dev/null +++ b/samples/building-relationship.jsonld @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/samples/building-simple-attributes.jsonld b/samples/building-simple-attributes.jsonld new file mode 100644 index 00000000..bc3dd795 --- /dev/null +++ b/samples/building-simple-attributes.jsonld @@ -0,0 +1,26 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file -- GitLab From 7f51dcc04dbf398efd1d822ed94a0006c178d82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patr=C3=ADcia=20Oliveira?= Date: Sat, 12 Sep 2020 01:08:08 +0100 Subject: [PATCH 002/442] First demo draft with structure and run instructions --- README.md | 0 .../Provision/Entities/CreateEntity_200.robot | 44 + .../Entities/CreateEntity_200_DD.robot | 6 + .../data}/building-location-attribute.jsonld | 0 .../Entities/data}/building-minimal.jsonld | 0 .../building-relationship-of-property.jsonld | 0 .../data}/building-relationship.jsonld | 0 .../data}/building-simple-attributes.jsonld | 0 .../Provision/Entities/schemas/response.json | 73 + requirements.txt | 5 + resources/ApiUtils.resource | 62 + .../__pycache__/variables.cpython-37.pyc | Bin 0 -> 1757 bytes resources/variables.py | 6 + results/log.html | 2137 +++++++++++++++ results/output.xml | 183 ++ results/report.html | 2434 +++++++++++++++++ scripts/run_tests.sh | 24 + 17 files changed, 4974 insertions(+) create mode 100644 README.md create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot rename {samples => TP/NGSI-LD/ContextInformation/Provision/Entities/data}/building-location-attribute.jsonld (100%) rename {samples => TP/NGSI-LD/ContextInformation/Provision/Entities/data}/building-minimal.jsonld (100%) rename {samples => TP/NGSI-LD/ContextInformation/Provision/Entities/data}/building-relationship-of-property.jsonld (100%) rename {samples => TP/NGSI-LD/ContextInformation/Provision/Entities/data}/building-relationship.jsonld (100%) rename {samples => TP/NGSI-LD/ContextInformation/Provision/Entities/data}/building-simple-attributes.jsonld (100%) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json create mode 100644 requirements.txt create mode 100644 resources/ApiUtils.resource create mode 100644 resources/__pycache__/variables.cpython-37.pyc create mode 100644 resources/variables.py create mode 100644 results/log.html create mode 100644 results/output.xml create mode 100644 results/report.html create mode 100755 scripts/run_tests.sh diff --git a/README.md b/README.md new file mode 100644 index 00000000..e69de29b diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot new file mode 100644 index 00000000..68247a18 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation TP description. +Variables ../../../../../resources/variables.py +Library REST ${url} +Library JSONSchemaLibrary .schemas/ +Library OperatingSystem + +#Suite Setup +#Suite Teardown + +*** Variable *** +${endpoint}= entities + + +*** Test Case *** +CreateEntity_200_MINIMAL + [Documentation] TP Variation description. + [Tags] critical + Log To Console "Will start Test Case CreateEntity_200_MINIMAL ..." + #TO DO: read body from files + Create Entity {"id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building"} + Check HTTP Status Code Is 201 + Check HTTP Response Body Json Schema Is response.json + +*** Keywords *** +Create Entity + [Arguments] ${body} + ${response} POST ${endpoint} body=${body} + Output request + Output response + Set Test Variable ${response} + +Check HTTP Status Code Is + [Arguments] ${status} + Log To Console ${response} + Should Be Equal ${response['status']} ${status} + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot new file mode 100644 index 00000000..53c2e08d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot @@ -0,0 +1,6 @@ +#TODO: Data Driven example + + +*** Test Case *** +CreateEntity_200_DD + Log To Console "Will start Test Case CreateEntity_200_DD..." \ No newline at end of file diff --git a/samples/building-location-attribute.jsonld b/TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-location-attribute.jsonld similarity index 100% rename from samples/building-location-attribute.jsonld rename to TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-location-attribute.jsonld diff --git a/samples/building-minimal.jsonld b/TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-minimal.jsonld similarity index 100% rename from samples/building-minimal.jsonld rename to TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-minimal.jsonld diff --git a/samples/building-relationship-of-property.jsonld b/TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-relationship-of-property.jsonld similarity index 100% rename from samples/building-relationship-of-property.jsonld rename to TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-relationship-of-property.jsonld diff --git a/samples/building-relationship.jsonld b/TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-relationship.jsonld similarity index 100% rename from samples/building-relationship.jsonld rename to TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-relationship.jsonld diff --git a/samples/building-simple-attributes.jsonld b/TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-simple-attributes.jsonld similarity index 100% rename from samples/building-simple-attributes.jsonld rename to TP/NGSI-LD/ContextInformation/Provision/Entities/data/building-simple-attributes.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json b/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json new file mode 100644 index 00000000..f566f086 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json @@ -0,0 +1,73 @@ +{ + "required": [ + "timestamp", + "path", + "status", + "error", + "message", + "requestId" + ], + "properties": { + "timestamp": { + "$id": "#/properties/timestamp", + "type": "integer", + "title": "The timestamp schema", + "description": "An explanation about the purpose of this instance.", + "default": 0, + "examples": [ + 1599842686277 + ] + }, + "path": { + "$id": "#/properties/path", + "type": "string", + "title": "The path schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "/ngsi-ld/v1/entities" + ] + }, + "status": { + "$id": "#/properties/status", + "type": "integer", + "title": "The status schema", + "description": "An explanation about the purpose of this instance.", + "default": 0, + "examples": [ + 415 + ] + }, + "error": { + "$id": "#/properties/error", + "type": "string", + "title": "The error schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "Unsupported Media Type" + ] + }, + "message": { + "$id": "#/properties/message", + "type": "string", + "title": "The message schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "Content type '' not supported" + ] + }, + "requestId": { + "$id": "#/properties/requestId", + "type": "string", + "title": "The requestId schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "9a15420d-86" + ] + } + }, + "additionalProperties": true +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..abbafcd8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +robotframework==3.2.1 +RESTinstance==1.0.2 +robotframework-jsonschemalibrary==1.0 +robotframework-pabot==1.8.0 + diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource new file mode 100644 index 00000000..5610f609 --- /dev/null +++ b/resources/ApiUtils.resource @@ -0,0 +1,62 @@ +*** Settings *** +Variables ./variables.py + +Library REST ${url} + +*** Variables *** +${response} + +*** Keywords *** +Api POST request + [Arguments] ${api path} ${header} ${body} + ${response} POST ${api path}/ headers=${header} body=${body} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Api GET request + [Arguments] ${api path} ${header} + ${response} GET ${api path} headers=${header} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Api DEL request + [Arguments] ${header} ${api path} + ${response} DEL ${api path} headers=${header} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Assert response status code + [Arguments] ${code} + Should Be Equal ${response}[status] ${code} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Console + Should Be Equal ${response['status']} ${status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + +Should Be Present In Json List + [Arguments] ${expr} ${json_field} ${json_value} + Log Check if ${json_field} is present in ${expr} with the value ${jsonvalue} + :FOR ${item} IN @{expr} + \ Exit For Loop If "${item['${json_field}']}" == "${json_value}" + Log Item found ${item} + [return] ${item} + +Check Result Contains + [Arguments] ${source} ${parameter} ${value} + Should Be Present In Json List ${source} ${parameter} ${value} \ No newline at end of file diff --git a/resources/__pycache__/variables.cpython-37.pyc b/resources/__pycache__/variables.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..854d46792f09a3a79cf67b4333dbb2690cbdd767 GIT binary patch literal 1757 zcmaJ?OOvZa6i#NmdbR5MCtTgdOn?ljiDg;l1!;!IO?Y%@7gIo!(9jJTAS9u5r9Z=^ z8~>1t+4>XQxw6Tv`zS5#sso4SJihat13i89>WdyddVh2e@76U}zT;AT z$uIaC_wm)webmD}yZ8DNGwSo*Ze4NdOlMr)nsP&Y{ma#l{U7=l({_;5^}hOgFsSO7 zQc~RDxVepYvSDBEk`r3 zv&e+l6uW>NNg&Y-kjV(lG++y-Cdw&@=H|#-Qp*<>wF&*>N*oh!CMF@1DV{63?IwyN zxT2SvqM5EskPEjwAB~q2Vxpe&d zV$4nEJCmW`X0@5R0x)P1n6)yEa^L*jf?yztS@KkRkCG{n*jm}`idvy+_ z6YX?()>^E3RjATN=Y9w(LO28+o(3_*d6MZzzC4~+``$Rgn{^QmwSCMKp~DQQIOaZQ zUPFU7T8g-hFPStN8pO&gf|qN?<>tNX0_!eR(IBo!y?1z&24GRNF-d2knDGjG`Af<^O=}+s> z)sNuI1^#|2Us z4v}@Y(r2T25iN|zH<^S>bA`06I3X*Rdx>@mWqCSX#n!ae=UTziMwyVTJr;LEZAW!M zOzvjIEIR4AD}iQ6$ddx9g{eIzH^7^ZJp(*F6X2?)md3 zC`k~~xGK9p|K;-6H-n^L@nBz2(!`_;20Ky@NVU6(2)n8GnDW0qD+Xm;6^Am4tHJvq zxBK(+t6f|_zTfH2mWrQ8{B*hMzq~3xWV_fIap FzX4nIH%9;f literal 0 HcmV?d00001 diff --git a/resources/variables.py b/resources/variables.py new file mode 100644 index 00000000..7be45ca3 --- /dev/null +++ b/resources/variables.py @@ -0,0 +1,6 @@ +def get_variables(arg=None): + variables = { + 'url': 'https://stellio-dev.eglobalmark.com/ngsi-ld/v1/', + 'token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDA3MDI2MjUsImlhdCI6MTU5OTgzODYyNSwianRpIjoiMDNmYTA3YzktNjU0ZS00NDVjLWIwNjQtM2U4YzBkOTVjNzFjIiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNzFiMGQ4N2QtZTZiOS00YTk0LTlkMDItOGQ2OTljMjQ1MzU0IiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.WdTawXIl2SKrlYvmba25fsE-2jbB5a2jhLcLqRbULwbEWyLBZMuRAnq3ArMRB9IxawlSn1fsMfaFvcsGbdBGjVUeC1XiVezHRYlTiwEZGETi5LUsLC6DocEM_Pk2drNQZJf1AiQmnVhJxb55BBQeOBtLDJomjvFAikzwo43JglL01h4CoCcxLnU2Iv3iiqFIsENJ_h-IVD9VMZdcTkvTS3hiD52nJ2XozR5UG8gqYf55Og5NBrKBtPo5pLZ6fuKwiHYdIsQlYV_EGuWrGwkmmCiNt_ZDO9szqPIKlz8zeASuuZgCigQcL6B59_kbv1-lbMGip5UQH9TJkdKU121lLA' + } + return variables diff --git a/results/log.html b/results/log.html new file mode 100644 index 00000000..cf5c76c6 --- /dev/null +++ b/results/log.html @@ -0,0 +1,2137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 8 or newer is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/results/output.xml b/results/output.xml new file mode 100644 index 00000000..887aafca --- /dev/null +++ b/results/output.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + +Logs the given message to the console. + +"Will start Test Case CreateEntity_200_MINIMAL ..." + + + + + +{"id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building"} + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=${body} + + +${response} + +${response} = {'seconds': 0.5796079999999999, 'status': 401, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Sat, 12 Sep 2020 00:05:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'WWW-Authen... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building" + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-12T00:05:57.090645+00:00", + "local": "2020-09-12T01:05:57.090645+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.5796079999999999, + "status": 401, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Sat, 12 Sep 2020 00:05:56 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "WWW-Authenticate": "Bearer", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.5796079999999999, 'status': 401, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Sat, 12 Sep 2020 00:05:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'WWW-Authen... + + + + + + +201 + + +Logs the given message to the console. + +${response} + + + + +Fails if the given objects are unequal. + +${response['status']} +${status} + +Argument types are: +<class 'int'> +<type 'unicode'> +401 != 201 + + + + +TP Variation description. + +critical + +401 != 201 + +TP description. + + + + + + + + + + + + + + + + +Critical Tests +All Tests + + +critical + + +Isg-Cim-Tpdl-Demo +Isg-Cim-Tpdl-Demo.TP +Isg-Cim-Tpdl-Demo.TP.NGSI-LD +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity 200 + + + + + diff --git a/results/report.html b/results/report.html new file mode 100644 index 00000000..ebef607e --- /dev/null +++ b/results/report.html @@ -0,0 +1,2434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 8 or newer is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh new file mode 100755 index 00000000..37d96e63 --- /dev/null +++ b/scripts/run_tests.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#run all tests +robot --outputdir ./results . + +#run all tests with base url overriden +robot --variable url:"URL_HERE" --outputdir ./results . + +#specify which tests are critical +robot --critical critical --outputdir ./results . + +#run by specific tag(s) +robot --include critical --outputdir ./results . +robot --include critical --include negative --outputdir ./results . + +#run specific test suite +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot + +#run specific test case +robot --outputdir ./results -t "CreateEntity_200_MINIMAL" ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot + +#rerun failed tests +robot --rerunfailedsuites ./results/output.xml --outputdir ./results . -- GitLab From e2b97d8e5de3803d5456da019a57e1d14415eb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patr=C3=ADcia=20Oliveira?= Date: Mon, 14 Sep 2020 17:50:13 +0100 Subject: [PATCH 003/442] Fix test CreateEntity_200_Minimal. Add test CreateEntity_409_AlreadyExists --- .../Provision/Entities/CreateEntity.robot | 53 +++ .../Provision/Entities/CreateEntity_200.robot | 44 -- ...D.robot => CreateEntity_data-driven.robot} | 0 .../schemas/error_response.schema.json | 7 + .../Provision/Entities/schemas/response.json | 73 --- results/log.html | 10 +- results/output.xml | 423 +++++++++++++++--- results/report.html | 10 +- 8 files changed, 421 insertions(+), 199 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot rename TP/NGSI-LD/ContextInformation/Provision/Entities/{CreateEntity_200_DD.robot => CreateEntity_data-driven.robot} (100%) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/error_response.schema.json delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity.robot new file mode 100644 index 00000000..1faf731c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation TP description. +Variables ../../../../../resources/variables.py +Library REST ${url} +Library JSONSchemaLibrary ${CURDIR}/schemas +Library OperatingSystem +Library String + +#Suite Setup +Suite Teardown Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + +*** Variable *** +${endpoint}= entities + +*** Test Case *** +CreateEntity_200_Minimal + [Documentation] TP Variation description. + [Tags] critical + Create Entity building-minimal.jsonld + Check HTTP Status Code Is 201 + +CreateEntity_409_AlreadyExists + Create Entity building-minimal.jsonld + Check HTTP Status Code Is 409 + Check HTTP Response Body Json Schema Is error_response + +*** Keywords *** +Create Entity + [Arguments] ${filename} + &{headers}= Create Dictionary Content-Type=application/ld+json authorization=Bearer ${token} + ${response}= POST ${endpoint} body=${CURDIR}/data/${filename} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Check HTTP Status Code Is + [Arguments] ${status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${status} + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema}= Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + +Delete Entity by Id + [Arguments] ${id} + &{headers}= Create Dictionary authorization=Bearer ${token} + ${response}= DELETE ${endpoint}/${id} headers=${headers} + Output request + Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot deleted file mode 100644 index 68247a18..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200.robot +++ /dev/null @@ -1,44 +0,0 @@ -*** Settings *** -Documentation TP description. -Variables ../../../../../resources/variables.py -Library REST ${url} -Library JSONSchemaLibrary .schemas/ -Library OperatingSystem - -#Suite Setup -#Suite Teardown - -*** Variable *** -${endpoint}= entities - - -*** Test Case *** -CreateEntity_200_MINIMAL - [Documentation] TP Variation description. - [Tags] critical - Log To Console "Will start Test Case CreateEntity_200_MINIMAL ..." - #TO DO: read body from files - Create Entity {"id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building"} - Check HTTP Status Code Is 201 - Check HTTP Response Body Json Schema Is response.json - -*** Keywords *** -Create Entity - [Arguments] ${body} - ${response} POST ${endpoint} body=${body} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - Log To Console ${response} - Should Be Equal ${response['status']} ${status} - -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json - ${schema} = Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_data-driven.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_200_DD.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity_data-driven.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/error_response.schema.json b/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/error_response.schema.json new file mode 100644 index 00000000..11507449 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/error_response.schema.json @@ -0,0 +1,7 @@ +{ + "required": [ + "detail", + "type", + "title" + ] +} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json b/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json deleted file mode 100644 index f566f086..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/schemas/response.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "required": [ - "timestamp", - "path", - "status", - "error", - "message", - "requestId" - ], - "properties": { - "timestamp": { - "$id": "#/properties/timestamp", - "type": "integer", - "title": "The timestamp schema", - "description": "An explanation about the purpose of this instance.", - "default": 0, - "examples": [ - 1599842686277 - ] - }, - "path": { - "$id": "#/properties/path", - "type": "string", - "title": "The path schema", - "description": "An explanation about the purpose of this instance.", - "default": "", - "examples": [ - "/ngsi-ld/v1/entities" - ] - }, - "status": { - "$id": "#/properties/status", - "type": "integer", - "title": "The status schema", - "description": "An explanation about the purpose of this instance.", - "default": 0, - "examples": [ - 415 - ] - }, - "error": { - "$id": "#/properties/error", - "type": "string", - "title": "The error schema", - "description": "An explanation about the purpose of this instance.", - "default": "", - "examples": [ - "Unsupported Media Type" - ] - }, - "message": { - "$id": "#/properties/message", - "type": "string", - "title": "The message schema", - "description": "An explanation about the purpose of this instance.", - "default": "", - "examples": [ - "Content type '' not supported" - ] - }, - "requestId": { - "$id": "#/properties/requestId", - "type": "string", - "title": "The requestId schema", - "description": "An explanation about the purpose of this instance.", - "default": "", - "examples": [ - "9a15420d-86" - ] - } - }, - "additionalProperties": true -} \ No newline at end of file diff --git a/results/log.html b/results/log.html index cf5c76c6..3ad41627 100644 --- a/results/log.html +++ b/results/log.html @@ -1743,25 +1743,25 @@ function stopPropagation(event) { window.output = {}; - - - - - - - - - - - - - - - - - - - - - - -
-

Opening Robot Framework log failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 8 or newer is required.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/results/output.xml b/results/output.xml deleted file mode 100644 index 27b67026..00000000 --- a/results/output.xml +++ /dev/null @@ -1,1509 +0,0 @@ - - - - - - - - - - - - - -building-minimal.jsonld - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.157198, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:50 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:51.029286+00:00", - "local": "2020-09-25T13:50:51.029286+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.157198, - "status": 201, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:50 GMT", - "Content-Length": "0", - "Connection": "keep-alive", - "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.157198, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:50 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... - - - - - - -building-minimal.jsonld - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.509346, 'status': 409, 'body': {'detail': 'Already Exists', 'type': 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists', 'title': 'The referred element already exists'}, 'headers': {'Ser... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:51.618156+00:00", - "local": "2020-09-25T13:50:51.618156+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.509346, - "status": 409, - "body": { - "detail": "Already Exists", - "type": "https://uri.etsi.org/ngsi-ld/errors/AlreadyExists", - "title": "The referred element already exists" - }, - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:51 GMT", - "Content-Type": "application/json", - "Content-Length": "132", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.509346, 'status': 409, 'body': {'detail': 'Already Exists', 'type': 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists', 'title': 'The referred element already exists'}, 'headers': {'Ser... - - - - - - -409 - - -Converts the given item to a Unicode string. - -${response['status']} - - -${response_status} - -${response_status} = 409 - - - -Fails if the given objects are unequal. - -${response_status} -${status} - - - - - - - -error_response - - -Fails if ``container`` does not contain ``item`` one or more times. - -${response['headers']['Content-Type']} -application/json - - - - -Catenates the given items together and returns the resulted string. - -SEPARATOR= -${input} -.schema.json - - -${schema} - -${schema} = error_response.schema.json - - - -Validates the sample JSON against the given schema. - -${schema} -${response['body']} - - - - -Logs the given message with the given level. - -Json Schema Validation OK - -Json Schema Validation OK - - - - - - -urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - - -Creates and returns a dictionary based on the given ``items``. - -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... - - - - -http - -*Sends a DELETE request to the endpoint.* - -${endpoint}/${id} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.650642, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:53 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "DELETE", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "query": {}, - "body": null, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:53.353383+00:00", - "local": "2020-09-25T13:50:53.353383+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.650642, - "status": 204, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:53 GMT", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - - -Check that the IUT refuses to create an entity if one exists with the same identifier - -critical - - - -Check that the IUT refuses to create an entity if one exists with the same identifier - - - - - - -building-minimal.jsonld - - - -${filename} - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.7107, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld/v... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:54.157780+00:00", - "local": "2020-09-25T13:50:54.157780+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.7107, - "status": 201, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:54 GMT", - "Content-Length": "0", - "Connection": "keep-alive", - "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.7107, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld/v... - - - - - - -201 - - -Converts the given item to a Unicode string. - -${response['status']} - - -${response_status} - -${response_status} = 201 - - - -Fails if the given objects are unequal. - -${response_status} -${status} - - - - - - - -${id} - - -Creates and returns a dictionary based on the given ``items``. - -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... - - - - -http - -*Sends a DELETE request to the endpoint.* - -${endpoint}/${id} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.359526, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "DELETE", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "query": {}, - "body": null, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:54.591366+00:00", - "local": "2020-09-25T13:50:54.591366+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.359526, - "status": 204, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:54 GMT", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - - - - - - - - - -building-simple-attributes.jsonld - - - -${filename} - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.805437, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "subCategory": { - "type": "Property", - "value": [ - "tourism" - ] - }, - "airQualityLevel": { - "type": "Property", - "value": 4, - "unitCode": "C62", - "observedAt": "2020-09-09T16:40:00.000Z" - }, - "almostFull": { - "type": "Property", - "value": false - }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:55.461312+00:00", - "local": "2020-09-25T13:50:55.461312+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.805437, - "status": 201, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:55 GMT", - "Content-Length": "0", - "Connection": "keep-alive", - "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.805437, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... - - - - - - -201 - - -Converts the given item to a Unicode string. - -${response['status']} - - -${response_status} - -${response_status} = 201 - - - -Fails if the given objects are unequal. - -${response_status} -${status} - - - - - - - -${id} - - -Creates and returns a dictionary based on the given ``items``. - -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... - - - - -http - -*Sends a DELETE request to the endpoint.* - -${endpoint}/${id} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.349996, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "DELETE", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "query": {}, - "body": null, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:55.862031+00:00", - "local": "2020-09-25T13:50:55.862031+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.349996, - "status": 204, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:55 GMT", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - - - - - - -Check that the IUT accepts the creation of an entity - - - - - - -building-minimal.jsonld - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.6256670000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:56.588451+00:00", - "local": "2020-09-25T13:50:56.588451+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.6256670000000001, - "status": 201, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:56 GMT", - "Content-Length": "0", - "Connection": "keep-alive", - "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.6256670000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... - - - - - - -201 - - -Converts the given item to a Unicode string. - -${response['status']} - - -${response_status} - -${response_status} = 201 - - - -Fails if the given objects are unequal. - -${response_status} -${status} - - - - - - - -${id} - - -Creates and returns a dictionary based on the given ``items``. - -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... - - - - -http - -*Sends a DELETE request to the endpoint.* - -${endpoint}/${id} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.338409, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "DELETE", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "query": {}, - "body": null, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:56.975523+00:00", - "local": "2020-09-25T13:50:56.975523+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.338409, - "status": 204, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:56 GMT", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - - -Create an entity with a JSON-LD payload containing the minimal information - -critical - - - - - - -building-simple-attributes.jsonld - - -Creates and returns a dictionary based on the given ``items``. - -Content-Type=application/ld+json -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... - - - - -http - -*Sends a POST request to the endpoint.* - -${endpoint} -body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.7369450000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:57 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "POST", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities", - "query": {}, - "body": { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "subCategory": { - "type": "Property", - "value": [ - "tourism" - ] - }, - "airQualityLevel": { - "type": "Property", - "value": 4, - "unitCode": "C62", - "observedAt": "2020-09-09T16:40:00.000Z" - }, - "almostFull": { - "type": "Property", - "value": false - }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - }, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/ld+json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:57.757931+00:00", - "local": "2020-09-25T13:50:57.757931+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.7369450000000001, - "status": 201, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:57 GMT", - "Content-Length": "0", - "Connection": "keep-alive", - "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - -Makes a variable available everywhere within the scope of the current test. - -${response} - -${response} = {'seconds': 0.7369450000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:57 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... - - - - - - -201 - - -Converts the given item to a Unicode string. - -${response['status']} - - -${response_status} - -${response_status} = 201 - - - -Fails if the given objects are unequal. - -${response_status} -${status} - - - - - - - -${id} - - -Creates and returns a dictionary based on the given ``items``. - -authorization=Bearer ${token} - - -&{headers} - -&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... - - - - -http - -*Sends a DELETE request to the endpoint.* - -${endpoint}/${id} -headers=${headers} - - -${response} - -${response} = {'seconds': 0.29047500000000004, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:58 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-st... - - - - -I/O - -*Outputs JSON to terminal or a file.* - -request - - -{ - "method": "DELETE", - "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "scheme": "https", - "netloc": "stellio-dev.eglobalmark.com", - "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "query": {}, - "body": null, - "headers": { - "Accept": "application/json, */*", - "Content-Type": "application/json", - "User-Agent": "RESTinstance/1.0.2", - "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" - }, - "proxies": {}, - "timeout": [ - null, - null - ], - "cert": null, - "sslVerify": true, - "allowRedirects": true, - "timestamp": { - "utc": "2020-09-25T12:50:58.109191+00:00", - "local": "2020-09-25T13:50:58.109191+01:00" - } -} - - - - -I/O - -*Outputs JSON to terminal or a file.* - -response - - -{ - "seconds": 0.29047500000000004, - "status": 204, - "body": "", - "headers": { - "Server": "nginx/1.14.2", - "Date": "Fri, 25 Sep 2020 12:50:58 GMT", - "Connection": "keep-alive", - "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", - "Pragma": "no-cache", - "Expires": "0", - "X-Content-Type-Options": "nosniff", - "X-Frame-Options": "DENY", - "X-XSS-Protection": "1 ; mode=block", - "Referrer-Policy": "no-referrer", - "Strict-Transport-Security": "max-age=31536000" - } -} - - - - -Create an entity with a JSON-LD payload containing only simple properties - - -Check that the IUT accepts the creation of an entity - - - - - - - - - - - - - - - - - - -Critical Tests -All Tests - - -critical - - -Isg-Cim-Tpdl-Demo -Isg-Cim-Tpdl-Demo.TP -Isg-Cim-Tpdl-Demo.TP.NGSI-LD -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.AlreadyExists -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.SuccessCases-datadriven -Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.SuccessCases - - - - - diff --git a/results/report.html b/results/report.html deleted file mode 100644 index f1f3c2cf..00000000 --- a/results/report.html +++ /dev/null @@ -1,2434 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Opening Robot Framework report failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 8 or newer is required.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- GitLab From 7f535ba6bd402def9b0b0657c442ad1fb5ee929d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 2 Dec 2020 11:42:44 +0100 Subject: [PATCH 035/442] chore: remove cached Python files from VCS --- resources/__pycache__/variables.cpython-37.pyc | Bin 1757 -> 0 bytes resources/__pycache__/variables.cpython-38.pyc | Bin 332 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 resources/__pycache__/variables.cpython-37.pyc delete mode 100644 resources/__pycache__/variables.cpython-38.pyc diff --git a/resources/__pycache__/variables.cpython-37.pyc b/resources/__pycache__/variables.cpython-37.pyc deleted file mode 100644 index 96f03c4e89ef1ad187891feb2553e9f1b1e4f9a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1757 zcmaJ?-IAk36i#MbU9DOl!n?W11W3pxx@DOOkibBbgg^r~DgFkUbOQF?<1E zX>Psn0lf3dCR;nZrKMeUplQzO^PTTI&<}6keAS`jyFbYGo6kF)-`j@|ZTd-773H`6epy8r zqr4YJr~4?zx$j}(9d`FYPWo9~q8<+WC${hX{HoK5Y9;aK0n(9Tn2pQ=B$slw=7X6W z>u8D$9GWsZBag#78BIs>Opy)datbmm2Lc#b3#>bgSOMsqSL_5?GdA%Fk3&IH4KtB8 zjLBLVU_rV*$Qg4_^WkVQMS3c7njjAK&5qTDRVfpkgfn@hZJe{VnKoc!4#AA(&DMpS z=17AYt5b95Vx?~s;--6|)VRHr89LnP8!f)Oykc z-1z9iu=KgMZZ-)>d33l*rE(G*&f`-+taiOo2Y_+mrS#yqa_1J;?&sLnuHDapAoT~< zk>aIX0oFnCNG49>5)124+Nn?;(99JOB%;*}PuD3cpk|+1v|Ea zgO+3&w_Sd%2Q*SSAXiik)|i&@6(gvQjg zhEr%OsY`tv4&Y#*Aw4TmxL6aqf8iS}>kvHf=2q<*|H8uhPgZ9#Df>y;&1Z= z)Hj%$?RWF>-JI48aoNVXkWHxnQ%J1ZgKpu%71D{D_zQq({VC-U``KD?|6l75ezH%s zzG}6Z9)U5usHxa;Pjg$uwJD!){S?}iN5UsQyyBvLqHrFh`CzN*g!Qvk^&kAwz5`T4 z+S8)6a~HH1TRo6`(Pl%I<~nMIGPzHz=xCZ`@itXP3Hy+aPPx-~VvlDBie~Z_$WoJ+ z2%E3quHpPiD&qXf5Vy;RUQd}?;f^0B^P@2_w+CS~w$E|TSzLA?^5)AraUJ`J#Pe~o zev60Vw0IQaz2^gMn{OZWUh1Ycwp8y>lksCSG=ryNAPuJqCuHjUQA(z!H7xRtYYoe> zYT34*8;b{Nzb+o-*>brByZPC?JYivRRuL;8J{Bc&C}xtN?D;Y?#A7^hmY6K0In)h1~MIm#v3v@D^;OWWV2@vhgZX+;m_Y<6Xv0xA1U|<9%ksB8O(NJ=l^e zmgAj+6XZY4&w?tG6<)HBCefzGESrSqY-TnAY?kyZZ&r6V&$q_|etuQuyD0mu(>{BL z`1#9|cR-$xqw>)H`LCD1-u085MExSi=oF!Y*N;)vM`hd#5b0G#i0NOSzl(DbavMTcirpkW77At*75oEJCcV-9DU!$ I{zLtN0{{R3 diff --git a/resources/__pycache__/variables.cpython-38.pyc b/resources/__pycache__/variables.cpython-38.pyc deleted file mode 100644 index ab03eeb393dba98563c96965a3aa31d68144baca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 332 zcmYjMJ5Izf5cOw43nCnXE=4j4f?`()fuK%)Y&!-uDpvhos w?#@Rw_Oo>+9O1?!Ob8~vM$&GQk9iUEmHXTM<2I=3$491BgT~|V`-8~70b=Y* Date: Fri, 4 Dec 2020 12:31:53 +0100 Subject: [PATCH 036/442] chore: ignore directories that do not have to be versioned --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..25d6273d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +resources/__pycache__ +results -- GitLab From 6740ca1053011b34eaa2647553180b831f563bf6 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 7 Dec 2020 15:37:59 +0100 Subject: [PATCH 037/442] fix: call Batch Delete Entities in test teardown --- .../CreateBatchOfEntities/fullSuccess.robot | 13 ++++--------- .../CreateBatchOfEntities/partialSuccess.robot | 10 ++++------ .../DeleteBatchOfEntities/fullSuccess.robot | 2 +- .../DeleteBatchOfEntities/partialSuccess.robot | 2 +- .../UpdateBatchOfEntities/fullSuccess.robot | 6 +++--- .../fullSuccessNoOverwriteMode.robot | 6 +++--- .../UpdateBatchOfEntities/partialSuccess.robot | 5 ++--- .../fullSuccessReplaceMode.robot | 11 ++++------- .../fullSuccessReplaceModeAllUpdated.robot | 6 +++--- .../fullSuccessUpdateMode.robot | 6 +++--- .../UpsertBatchOfEntities/partialSucess.robot | 5 ++--- resources/ApiUtils.resource | 2 +- 12 files changed, 31 insertions(+), 43 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index 4f678cb5..56bda491 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -11,6 +11,7 @@ Library Collections *** Variable *** ${batch_endpoint}= entityOperations/create +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -31,9 +32,7 @@ Create a batch of minimal entities Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + Batch Delete Entities @{expected_entities_ids} Create a batch of entities having only simple properties [Documentation] Check that you can create a batch of entities having only simple properties @@ -51,9 +50,7 @@ Create a batch of entities having only simple properties Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + Batch Delete Entities @{expected_entities_ids} Create a batch of entities having multiple attributes [Documentation] Check that you can create a batch of entities having multiple attributes @@ -71,6 +68,4 @@ Create a batch of entities having multiple attributes Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot index db0fef64..6440376b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/create +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -36,14 +37,11 @@ Create a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} - Delete Entity by Id ${existing_entity_id} - + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} + *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id} - diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot index 3e5883f3..09049cb3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot @@ -12,7 +12,7 @@ Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/delete +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot index 5fda7423..ea7152e9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot @@ -12,7 +12,7 @@ Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/delete +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot index 19254c4c..88425216 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/update +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -29,9 +30,8 @@ Update a batch of entities Check Response Status Code Set To 204 - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot index 27d8601d..e6c44a31 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/update +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -29,9 +30,8 @@ Update a batch of entities with noOverwrite option Check Response Status Code Set To 204 - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot index 8e20824b..79c8a17b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/update +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -37,9 +38,7 @@ Update a batch of non existing and existing entities Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_existing_entity_id} - Delete Entity by Id ${second_existing_entity_id} + Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot index eee75700..e33ce605 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/upsert +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -33,9 +34,7 @@ Upsert a batch of non existing entities Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + Batch Delete Entities @{expected_entities_ids} Upsert a batch of non existing and existing entities [Documentation] Check that you can upsert a batch of non existing and existing entities @@ -53,10 +52,8 @@ Upsert a batch of non existing and existing entities Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${new_entity_id} - Delete Entity by Id ${first_existing_entity_id} - Delete Entity by Id ${second_existing_entity_id} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot index a4f14d3d..aa3d57ba 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/upsert +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -29,9 +30,8 @@ Upsert a batch of existing entities Check Response Status Code Set To 204 - #TODO call Batch Delete Entities - Delete Entity by Id ${first_existing_entity_id} - Delete Entity by Id ${second_existing_entity_id} + @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot index a6ff8322..12a3b8e5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot @@ -13,6 +13,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/upsert +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -32,9 +33,8 @@ Upsert a batch of entities with update option Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - #TODO call Batch Delete Entities - Delete Entity by Id ${new_entity_id} - Delete Entity by Id ${existing_entity_id} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot index 73e4d251..c507e7c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot @@ -11,6 +11,7 @@ Library Collections *** Variable *** ${batch_endpoint}= entityOperations/upsert +${batch_delete_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: @@ -37,6 +38,4 @@ Upsert a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - #TODO call Batch Delete Entities - Delete Entity by Id ${first_entity_id} - Delete Entity by Id ${second_entity_id} + Batch Delete Entities @{expected_successful_entities_ids} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 8c438520..3a4d99d1 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -74,7 +74,7 @@ Batch Update Entities Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${batch_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} + ${response}= POST ${batch_delete_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Set Test Variable ${response} -- GitLab From 4bbbd9d2ab6b59a6aea6a695ba4a37060d234f6c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 7 Dec 2020 08:37:11 +0100 Subject: [PATCH 038/442] refactor: use EXECDIR variable to avoid long and complexe relative references --- .../BatchEntities/CreateBatchOfEntities/failure.robot | 5 ++--- .../BatchEntities/CreateBatchOfEntities/fullSuccess.robot | 8 ++++---- .../CreateBatchOfEntities/partialSuccess.robot | 8 ++++---- .../BatchEntities/DeleteBatchOfEntities/failure.robot | 6 +++--- .../BatchEntities/DeleteBatchOfEntities/fullSuccess.robot | 8 ++++---- .../DeleteBatchOfEntities/partialSuccess.robot | 8 ++++---- .../BatchEntities/UpdateBatchOfEntities/failure.robot | 8 ++++---- .../BatchEntities/UpdateBatchOfEntities/fullSuccess.robot | 8 ++++---- .../fullSuccessNoOverwriteMode.robot | 8 ++++---- .../UpdateBatchOfEntities/partialSuccess.robot | 8 ++++---- .../BatchEntities/UpsertBatchOfEntities/failure.robot | 7 +++---- .../UpsertBatchOfEntities/fullSuccessReplaceMode.robot | 8 ++++---- .../fullSuccessReplaceModeAllUpdated.robot | 8 ++++---- .../UpsertBatchOfEntities/fullSuccessUpdateMode.robot | 8 ++++---- .../UpsertBatchOfEntities/partialSucess.robot | 8 ++++---- 15 files changed, 56 insertions(+), 58 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot index 18e6cec8..40ed19bd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot @@ -1,8 +1,7 @@ *** Settings *** Documentation Check that you cannot create a batch of entities with an invalid request -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources//AssertionUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index 56bda491..c0f5a64e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can create a batch of entities -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot index 6440376b..86696e9c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can create a batch of entities where some will succeed and others will fail -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot index 6ded9d01..3568893d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot @@ -1,8 +1,8 @@ *** Settings *** Documentation Check that you cannot delete a batch of entities with an invalid request -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot index 09049cb3..9b9026e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can delete a batch of entities -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot index ea7152e9..05b571e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can delete a batch of entities where some will succeed and others will fail -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot index 1698dda2..a73faf73 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you cannot update a batch of entities with an invalid request -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot index 88425216..6e6ab28e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can update a batch of entities -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot index e6c44a31..25148783 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can update a batch of entities with noOverwrite option -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot index 79c8a17b..f7dfc1a0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can update a batch of entities where some will succeed and others will fail -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot index 8eeaff7b..0ee36225 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot @@ -1,9 +1,8 @@ *** Settings *** Documentation Check that you cannot upsert a batch of entities with an invalid request -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot index e33ce605..182ba5b6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can upsert a batch of entities -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot index aa3d57ba..d82f3fdf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can upsert a batch of existing entities and they will be replaced -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot index 12a3b8e5..3fcf71fb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can upsert a batch of entities with update option -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot index c507e7c8..91ed6534 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot @@ -1,9 +1,9 @@ *** Settings *** Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -Variables ../../../../../../resources/variables.py -Resource ../../../../../../resources/ApiUtils.resource -Resource ../../../../../../resources/AssertionUtils.resource -Resource ../../../../../../resources/JsonUtils.resource +Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String -- GitLab From 5668eaa8095a84dc0894499171aa939e91eddb46 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 7 Dec 2020 15:34:27 +0100 Subject: [PATCH 039/442] feat: better use of global variables & fixes for RequestLibrary uses --- .../CreateBatchOfEntities/failure.robot | 15 +++++---------- .../CreateBatchOfEntities/fullSuccess.robot | 5 ----- .../CreateBatchOfEntities/partialSuccess.robot | 5 ----- resources/ApiUtils.resource | 16 ++++++++++------ resources/AssertionUtils.resource | 9 +++++++++ 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot index 40ed19bd..cddb0959 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot @@ -1,16 +1,11 @@ *** Settings *** Documentation Check that you cannot create a batch of entities with an invalid request Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources//AssertionUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem - -*** Variable *** -${batch_endpoint}= entityOperations/create -${endpoint}= entities - *** Test Case *** With invalid json document [Documentation] Check that you cannot create a batch of entities with an invalid json document @@ -18,8 +13,8 @@ With invalid json document Batch Request Entities From File batch/invalid-json-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} With empty json document [Documentation] Check that you cannot create a batch of entities with an empty json document @@ -27,5 +22,5 @@ With empty json document Batch Request Entities From File batch/empty-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index c0f5a64e..b20cad9c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -1,18 +1,13 @@ *** Settings *** Documentation Check that you can create a batch of entities -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} Library JSONLibrary Library String Library Collections *** Variable *** -${batch_endpoint}= entityOperations/create -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot index 86696e9c..324f8211 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -1,10 +1,8 @@ *** Settings *** Documentation Check that you can create a batch of entities where some will succeed and others will fail -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} Library JSONLibrary Library String Library Collections @@ -12,9 +10,6 @@ Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/create -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 3a4d99d1..cdaaf785 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -2,8 +2,12 @@ Variables ./variables.py Library REST ${url} +Library RequestsLibrary *** Variables *** +${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create +${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete +${ENTITIES_ENDPOINT_PATH} entities ${response} *** Keywords *** @@ -33,7 +37,7 @@ Api DEL request Delete Entity by Id [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} Output request Output response @@ -43,14 +47,14 @@ Create Entity ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${entity} headers=${headers} + ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request Output response Batch Create Entities [Arguments] @{entities_to_be_created} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${batch_endpoint} body=@{entities_to_be_created} headers=${headers} + ${response}= POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} Output request Output response Set Test Variable ${response} @@ -74,7 +78,7 @@ Batch Update Entities Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${batch_delete_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} + ${response}= POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Set Test Variable ${response} @@ -84,5 +88,5 @@ Batch Request Entities From File ${file_content}= Get File ${EXECDIR}/data/entities/${filename} Create Session BatchRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST Request BatchRequest ${batch_endpoint} data=${file_content} headers=${headers} - Set Test Variable ${response} ${response.json()} + ${response}= POST Request BatchRequest ${BATCH_CREATE_ENDPOINT_PATH} data=${file_content} headers=${headers} + Set Test Variable ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index ab8faf99..324d8182 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -4,6 +4,10 @@ Check Response Status Code Set To ${response_status}= convert to string ${response['status']} Should Be Equal ${response_status} ${expected_status} +Check RL Response Status Code Set To + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} + Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True @@ -28,6 +32,11 @@ Check Response Body Containing Problem Details Element Containing Detail Element [Arguments] ${response_body} Should Not Be Empty ${response_body['detail']} +Check RL Response Body Containing Problem Details Element Containing Detail Element + [Arguments] ${response_body} + ${json_response_body}= To Json ${response_body.content} + Should Not Be Empty ${json_response_body['detail']} + Assert response status code [Arguments] ${code} Should Be Equal ${response}[status] ${code} -- GitLab From e45da752ccb649c069b22f9660d79550184e3d18 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 7 Dec 2020 15:35:55 +0100 Subject: [PATCH 040/442] chore: update sample scripts to run the tests --- scripts/run_tests.sh | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 7a678f86..7f4c513b 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -1,27 +1,28 @@ #!/bin/bash -#run all tests -robot --outputdir ./results . +# run all tests +robot --outputdir ./results ./TP/NGSI-LD -#run all tests with base url overriden -#robot --variable url:"URL_HERE" --outputdir ./results . +# run all tests with base url overriden +robot --variable url:"URL_HERE" --outputdir ./results . -#specify which tests are critical -#robot --critical critical --outputdir ./results . +# specify which tests are critical +robot --critical critical --outputdir ./results . -#run by specific tag(s) -#robot --include critical --outputdir ./results . +# run by specific tag(s) +robot --include critical --outputdir ./results . -#run specific test suite -#robot --outputdir ./results ./TP/NGSI-LD/ContextInformation -#robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +# run specific test suite +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot -#run specific test case -#robot --outputdir ./results -t "SuccessCases_MinimalEntity" -#robot --outputdir ./results -t "SuccessCases_MinimalEntity" ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +# run specific test case +robot --outputdir ./results -t "SuccessCases_MinimalEntity" +robot --outputdir ./results -t "SuccessCases_MinimalEntity" ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot -#rerun failed tests -#robot --rerunfailedsuites ./results/output.xml --outputdir ./results . +# rerun failed tests +robot --rerunfailedsuites ./results/output.xml --outputdir ./results . -#stop the suite after a failed test +# stop the suite after a failed test robot --exitonfailure --outputdir ./results . -- GitLab From 4d95afe4a3ec037ccc9784d649dd153917f2ab8a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 7 Dec 2020 16:05:53 +0100 Subject: [PATCH 041/442] feat(temp): use the temp checkers for batch entities tests --- .../BatchEntities/DeleteBatchOfEntities/failure.robot | 8 ++++---- .../BatchEntities/UpdateBatchOfEntities/failure.robot | 8 ++++---- .../BatchEntities/UpsertBatchOfEntities/failure.robot | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot index 3568893d..da655d04 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot @@ -19,8 +19,8 @@ With invalid json document Batch Request Entities From File batch/invalid-json-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} With empty json document [Documentation] Check that you cannot delete a batch of entities with an empty json document @@ -28,5 +28,5 @@ With empty json document Batch Request Entities From File batch/empty-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot index a73faf73..410faae5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot @@ -19,8 +19,8 @@ With invalid json document Batch Request Entities From File batch/invalid-json-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} With json-ld document not syntactically correct according to the @context [Documentation] Check that you cannot update a batch of entities with a json-ld document not syntactically correct according to the @context @@ -29,5 +29,5 @@ With json-ld document not syntactically correct according to the @context #TODO: Use a json-ld document not syntactically correct according to the @context Batch Request Entities From File batch/invalid-json-ld-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot index 0ee36225..d7479127 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot @@ -18,8 +18,8 @@ With invalid json document Batch Request Entities From File batch/invalid-json-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} With json-ld document containing a null value in any of its items [Documentation] Check that you cannot upsert a batch of entities with a json-ld document containing a null value in any of its items @@ -27,5 +27,5 @@ With json-ld document containing a null value in any of its items Batch Request Entities From File batch/invalid-json-ld-sample.jsonld - Check Response Status Code Set To 400 - Check Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} -- GitLab From 306a0006983d00b4d285d3a9c3620750921500c7 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 7 Dec 2020 16:16:33 +0100 Subject: [PATCH 042/442] feat: replace critical tag by mandatory --- .../BatchEntities/CreateBatchOfEntities/failure.robot | 4 ++-- .../BatchEntities/CreateBatchOfEntities/fullSuccess.robot | 6 +++--- .../CreateBatchOfEntities/partialSuccess.robot | 2 +- .../BatchEntities/DeleteBatchOfEntities/failure.robot | 4 ++-- .../BatchEntities/DeleteBatchOfEntities/fullSuccess.robot | 2 +- .../DeleteBatchOfEntities/partialSuccess.robot | 2 +- .../BatchEntities/UpdateBatchOfEntities/failure.robot | 4 ++-- .../BatchEntities/UpdateBatchOfEntities/fullSuccess.robot | 2 +- .../UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot | 2 +- .../UpdateBatchOfEntities/partialSuccess.robot | 2 +- .../BatchEntities/UpsertBatchOfEntities/failure.robot | 4 ++-- .../UpsertBatchOfEntities/fullSuccessReplaceMode.robot | 4 ++-- .../fullSuccessReplaceModeAllUpdated.robot | 2 +- .../UpsertBatchOfEntities/fullSuccessUpdateMode.robot | 2 +- .../BatchEntities/UpsertBatchOfEntities/partialSucess.robot | 2 +- .../Provision/Entities/CreateEntity/AlreadyExists.robot | 2 +- .../Provision/Entities/CreateEntity/SuccessCases.robot | 2 +- scripts/run_tests.sh | 6 +++--- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot index cddb0959..80e16d1a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot @@ -9,7 +9,7 @@ Library OperatingSystem *** Test Case *** With invalid json document [Documentation] Check that you cannot create a batch of entities with an invalid json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/invalid-json-sample.jsonld @@ -18,7 +18,7 @@ With invalid json document With empty json document [Documentation] Check that you cannot create a batch of entities with an empty json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/empty-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index b20cad9c..4b9c09d1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -13,7 +13,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of minimal entities [Documentation] Check that you can create a batch of minimal entities - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -31,7 +31,7 @@ Create a batch of minimal entities Create a batch of entities having only simple properties [Documentation] Check that you can create a batch of entities having only simple properties - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -49,7 +49,7 @@ Create a batch of entities having only simple properties Create a batch of entities having multiple attributes [Documentation] Check that you can create a batch of entities having multiple attributes - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot index 324f8211..5555eef1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -15,7 +15,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of two valid entities and one invalid entity [Documentation] Check that you can create a batch of two valid entities and one invalid entity - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot index da655d04..004a7d00 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot @@ -15,7 +15,7 @@ ${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot delete a batch of entities with an invalid json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/invalid-json-sample.jsonld @@ -24,7 +24,7 @@ With invalid json document With empty json document [Documentation] Check that you cannot delete a batch of entities with an empty json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/empty-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot index 9b9026e1..421b44cd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities - [Tags] critical + [Tags] mandatory @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot index 05b571e1..924565b6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of non existing and existing entities [Documentation] Check that you can delete a batch of non existing and existing entities - [Tags] critical + [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot index 410faae5..45badbf3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot @@ -15,7 +15,7 @@ ${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot update a batch of entities with an invalid json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/invalid-json-sample.jsonld @@ -24,7 +24,7 @@ With invalid json document With json-ld document not syntactically correct according to the @context [Documentation] Check that you cannot update a batch of entities with a json-ld document not syntactically correct according to the @context - [Tags] critical + [Tags] mandatory #TODO: Use a json-ld document not syntactically correct according to the @context Batch Request Entities From File batch/invalid-json-ld-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot index 6e6ab28e..6df3d35c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Update a batch of entities [Documentation] Check that you can update a batch of entities - [Tags] critical + [Tags] mandatory ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot index 25148783..7a29ba0c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Update a batch of entities with noOverwrite option [Documentation] Check that you can update a batch of entities with noOverwrite option - [Tags] critical + [Tags] mandatory ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot index f7dfc1a0..3fcb46c5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Update a batch of non existing and existing entities [Documentation] Check that you can update a batch of non existing and existing entities - [Tags] critical + [Tags] mandatory ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot index d7479127..76b94b23 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot @@ -14,7 +14,7 @@ ${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot upsert a batch of entities with an invalid json document - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/invalid-json-sample.jsonld @@ -23,7 +23,7 @@ With invalid json document With json-ld document containing a null value in any of its items [Documentation] Check that you cannot upsert a batch of entities with a json-ld document containing a null value in any of its items - [Tags] critical + [Tags] mandatory Batch Request Entities From File batch/invalid-json-ld-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot index 182ba5b6..499cf835 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of non existing entities [Documentation] Check that you can upsert a batch of non existing entities - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -38,7 +38,7 @@ Upsert a batch of non existing entities Upsert a batch of non existing and existing entities [Documentation] Check that you can upsert a batch of non existing and existing entities - [Tags] critical + [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot index d82f3fdf..1e33acd7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of existing entities [Documentation] Check that you can upsert a batch of existing entities - [Tags] critical + [Tags] mandatory ${first_existing_entity}= Load Entity building-minimal-sample.jsonld ${first_existing_entity_id} ${second_existing_entity}= Load Entity building-minimal-sample.jsonld ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot index 3fcf71fb..73bdff7b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot @@ -20,7 +20,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of entities with update option [Documentation] Check that you can upsert a batch of entities with update option - [Tags] critical + [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot index 91ed6534..1dd2ed22 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot @@ -18,7 +18,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of two valid entities and one invalid entity [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity - [Tags] critical + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot index 85413577..ef8a8050 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot @@ -15,7 +15,7 @@ ${endpoint}= entities *** Test Case *** AlreadyExists [Documentation] Check that the IUT refuses to create an entity if one exists with the same identifier - [Tags] critical + [Tags] mandatory Create Entity building-minimal.jsonld Create Entity building-minimal.jsonld Check HTTP Status Code Is 409 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot index 35b647ab..47474e20 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot @@ -11,7 +11,7 @@ ${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 *** Test Case *** SuccessCases_MinimalEntity [Documentation] Create an entity with a JSON-LD payload containing the minimal information - [Tags] critical + [Tags] mandatory Create Entity building-minimal.jsonld Check HTTP Status Code Is 201 Delete Entity by Id ${id} diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 7f4c513b..d403cf62 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -6,11 +6,11 @@ robot --outputdir ./results ./TP/NGSI-LD # run all tests with base url overriden robot --variable url:"URL_HERE" --outputdir ./results . -# specify which tests are critical -robot --critical critical --outputdir ./results . +# specify which tests are mandatory +robot --critical mandatory --outputdir ./results . # run by specific tag(s) -robot --include critical --outputdir ./results . +robot --include mandatory --outputdir ./results . # run specific test suite robot --outputdir ./results ./TP/NGSI-LD/ContextInformation -- GitLab From 302d09ee075fd7b81cd6032b72bb5c92df0413f8 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 8 Dec 2020 07:57:02 +0100 Subject: [PATCH 043/442] feat: use data-driven features to test batch creation of entities --- .../CreateBatchOfEntities/fullSuccess.robot | 56 +++++-------------- 1 file changed, 14 insertions(+), 42 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index 4b9c09d1..975d4c3d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -7,60 +7,32 @@ Library JSONLibrary Library String Library Collections +Test Template Create Batch Entity Scenarios + *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Create a batch of minimal entities - [Documentation] Check that you can create a batch of minimal entities - [Tags] mandatory - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - - Batch Delete Entities @{expected_entities_ids} - -Create a batch of entities having only simple properties - [Documentation] Check that you can create a batch of entities having only simple properties - [Tags] mandatory +*** Test Cases *** FILENAME +MinimalEntity building-minimal-sample.jsonld +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-simple-attributes-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-simple-attributes-sample.jsonld ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - - Batch Delete Entities @{expected_entities_ids} - -Create a batch of entities having multiple attributes - [Documentation] Check that you can create a batch of entities having multiple attributes - [Tags] mandatory +*** Keywords *** +Create Batch Entity Scenarios + [Arguments] ${filename} + [Documentation] Check that you can create a batch of entities + [Tags] mandatory entityOperations ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} Batch Create Entities @{entities_to_be_created} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} Batch Delete Entities @{expected_entities_ids} -- GitLab From c5bdeebe1d4393536de1fef5d9f7c64e0d0827b6 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 8 Dec 2020 20:06:23 +0100 Subject: [PATCH 044/442] refactor: remove unused variables and libraries in test cases + refactor Batch Request Entities From File keyword --- .../CreateBatchOfEntities/failure.robot | 7 ++----- .../CreateBatchOfEntities/fullSuccess.robot | 3 --- .../CreateBatchOfEntities/partialSuccess.robot | 3 --- .../DeleteBatchOfEntities/failure.robot | 13 ++----------- .../DeleteBatchOfEntities/fullSuccess.robot | 7 ------- .../DeleteBatchOfEntities/partialSuccess.robot | 7 ------- .../UpdateBatchOfEntities/failure.robot | 13 ++----------- .../UpdateBatchOfEntities/fullSuccess.robot | 8 -------- .../fullSuccessNoOverwriteMode.robot | 8 -------- .../UpdateBatchOfEntities/partialSuccess.robot | 8 -------- .../UpsertBatchOfEntities/failure.robot | 12 ++---------- .../fullSuccessReplaceMode.robot | 8 -------- .../fullSuccessReplaceModeAllUpdated.robot | 8 -------- .../fullSuccessUpdateMode.robot | 8 -------- .../UpsertBatchOfEntities/partialSucess.robot | 8 -------- resources/ApiUtils.resource | 14 ++++++++++---- resources/JsonUtils.resource | 4 ++++ resources/variables.py | 2 +- 18 files changed, 23 insertions(+), 118 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot index 80e16d1a..eae07366 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot @@ -2,16 +2,13 @@ Documentation Check that you cannot create a batch of entities with an invalid request Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Library RequestsLibrary -Library JSONLibrary -Library OperatingSystem *** Test Case *** With invalid json document [Documentation] Check that you cannot create a batch of entities with an invalid json document [Tags] mandatory - Batch Request Entities From File batch/invalid-json-sample.jsonld + Batch Request Entities From File create filename=batch/invalid-json-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} @@ -20,7 +17,7 @@ With empty json document [Documentation] Check that you cannot create a batch of entities with an empty json document [Tags] mandatory - Batch Request Entities From File batch/empty-sample.jsonld + Batch Request Entities From File create filename=batch/empty-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot index 975d4c3d..b31491a7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -3,9 +3,6 @@ Documentation Check that you can create a batch of entities Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library JSONLibrary -Library String -Library Collections Test Template Create Batch Entity Scenarios diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot index 5555eef1..83533186 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -3,9 +3,6 @@ Documentation Check that you can create a batch of entities where some will su Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot index 004a7d00..cfdace33 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot @@ -1,23 +1,14 @@ *** Settings *** Documentation Check that you cannot delete a batch of entities with an invalid request -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Library RequestsLibrary -Library JSONLibrary -Library OperatingSystem - - -*** Variable *** -${batch_endpoint}= entityOperations/delete -${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot delete a batch of entities with an invalid json document [Tags] mandatory - Batch Request Entities From File batch/invalid-json-sample.jsonld + Batch Request Entities From File delete filename=batch/invalid-json-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} @@ -26,7 +17,7 @@ With empty json document [Documentation] Check that you cannot delete a batch of entities with an empty json document [Tags] mandatory - Batch Request Entities From File batch/empty-sample.jsonld + Batch Request Entities From File delete filename=batch/empty-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot index 421b44cd..13652a23 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot @@ -1,19 +1,12 @@ *** Settings *** Documentation Check that you can delete a batch of entities -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot index 924565b6..49246ae0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot @@ -1,19 +1,12 @@ *** Settings *** Documentation Check that you can delete a batch of entities where some will succeed and others will fail -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot index 45badbf3..8f094b86 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot @@ -1,23 +1,14 @@ *** Settings *** Documentation Check that you cannot update a batch of entities with an invalid request -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Library RequestsLibrary -Library JSONLibrary -Library OperatingSystem - -*** Variable *** -${batch_endpoint}= entityOperations/update -${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot update a batch of entities with an invalid json document [Tags] mandatory - Batch Request Entities From File batch/invalid-json-sample.jsonld + Batch Request Entities From File update filename=batch/invalid-json-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} @@ -27,7 +18,7 @@ With json-ld document not syntactically correct according to the @context [Tags] mandatory #TODO: Use a json-ld document not syntactically correct according to the @context - Batch Request Entities From File batch/invalid-json-ld-sample.jsonld + Batch Request Entities From File update filename=batch/invalid-json-ld-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot index 6df3d35c..2233b53e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can update a batch of entities -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/update -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot index 7a29ba0c..56ddec05 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can update a batch of entities with noOverwrite option -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/update -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot index 3fcb46c5..6ea6ff51 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can update a batch of entities where some will succeed and others will fail -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/update -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot index 76b94b23..212bbf3e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot @@ -2,21 +2,13 @@ Documentation Check that you cannot upsert a batch of entities with an invalid request Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Library RequestsLibrary -Library JSONLibrary -Library OperatingSystem - -*** Variable *** -${batch_endpoint}= entityOperations/upsert -${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot upsert a batch of entities with an invalid json document [Tags] mandatory - Batch Request Entities From File batch/invalid-json-sample.jsonld + Batch Request Entities From File upsert filename=batch/invalid-json-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} @@ -25,7 +17,7 @@ With json-ld document containing a null value in any of its items [Documentation] Check that you cannot upsert a batch of entities with a json-ld document containing a null value in any of its items [Tags] mandatory - Batch Request Entities From File batch/invalid-json-ld-sample.jsonld + Batch Request Entities From File upsert filename=batch/invalid-json-ld-sample.jsonld Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot index 499cf835..d8b20dfb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can upsert a batch of entities -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/upsert -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot index 1e33acd7..694de2af 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can upsert a batch of existing entities and they will be replaced -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/upsert -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot index 73bdff7b..8ee93d2d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot @@ -1,20 +1,12 @@ *** Settings *** Documentation Check that you can upsert a batch of entities with update option -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections Suite Setup Setup Initial Entities *** Variable *** -${batch_endpoint}= entityOperations/upsert -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot index 1dd2ed22..5bb07723 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot @@ -1,18 +1,10 @@ *** Settings *** Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Library REST ${url} -Library JSONLibrary -Library String -Library Collections *** Variable *** -${batch_endpoint}= entityOperations/upsert -${batch_delete_endpoint}= entityOperations/delete -${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index cdaaf785..16ef8732 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -3,12 +3,17 @@ Variables ./variables.py Library REST ${url} Library RequestsLibrary +Library OperatingSystem +Library Collections *** Variables *** ${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create +${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert +${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete ${ENTITIES_ENDPOINT_PATH} entities ${response} +&{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} *** Keywords *** Api POST request @@ -62,7 +67,7 @@ Batch Create Entities Batch Upsert Entities [Arguments] @{entities_to_be_upserted} ${update_option}=replace &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${batch_endpoint}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} + ${response}= POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} Output request Output response Set Test Variable ${response} @@ -70,7 +75,7 @@ Batch Upsert Entities Batch Update Entities [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${batch_endpoint}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} + ${response}= POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} Output request Output response Set Test Variable ${response} @@ -84,9 +89,10 @@ Batch Delete Entities Set Test Variable ${response} Batch Request Entities From File - [Arguments] ${filename} + [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} + ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} Create Session BatchRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST Request BatchRequest ${BATCH_CREATE_ENDPOINT_PATH} data=${file_content} headers=${headers} + ${response}= POST Request BatchRequest ${endpoint_url} data=${file_content} headers=${headers} Set Test Variable ${response} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index cda79d17..8ae198c2 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -1,3 +1,7 @@ +*** Settings *** +Library String +Library JSONLibrary + *** Keywords *** Load Entity [Arguments] ${entity_file_name} ${entity_id} diff --git a/resources/variables.py b/resources/variables.py index b2ae5498..7136ce1f 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,5 +1,5 @@ def get_variables(arg=None): variables = { - 'url': 'http://10.5.1.214:9090/ngsi-ld/v1' + 'url': 'http://127.0.0.1:8082/ngsi-ld/v1' } return variables -- GitLab From 1b1311beb48fbb06d98e3fb94d9c8cdd48a0c615 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 9 Dec 2020 09:33:56 +0100 Subject: [PATCH 045/442] refactor: rename test cases files to match sequence numbers --- .../{fullSuccess.robot => 003_01.robot} | 0 .../{partialSuccess.robot => 003_02.robot} | 0 .../{failure.robot => 003_03.robot} | 0 .../{fullSuccess.robot => 006_01.robot} | 0 .../{partialSuccess.robot => 006_02.robot} | 0 .../{failure.robot => 006_03.robot} | 0 .../{fullSuccess.robot => 005_01.robot} | 0 ...cessNoOverwriteMode.robot => 005_02.robot} | 0 .../{partialSuccess.robot => 005_03.robot} | 0 .../{failure.robot => 005_04.robot} | 0 .../UpsertBatchOfEntities/004_01.robot | 27 +++++++++++++++++++ ...lSuccessReplaceMode.robot => 004_02.robot} | 20 +------------- ...placeModeAllUpdated.robot => 004_03.robot} | 0 ...llSuccessUpdateMode.robot => 004_04.robot} | 0 .../{partialSucess.robot => 004_05.robot} | 0 .../{failure.robot => 004_06.robot} | 0 16 files changed, 28 insertions(+), 19 deletions(-) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/{fullSuccess.robot => 003_01.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/{partialSuccess.robot => 003_02.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/{failure.robot => 003_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/{fullSuccess.robot => 006_01.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/{partialSuccess.robot => 006_02.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/{failure.robot => 006_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/{fullSuccess.robot => 005_01.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/{fullSuccessNoOverwriteMode.robot => 005_02.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/{partialSuccess.robot => 005_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/{failure.robot => 005_04.robot} (100%) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/{fullSuccessReplaceMode.robot => 004_02.robot} (66%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/{fullSuccessReplaceModeAllUpdated.robot => 004_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/{fullSuccessUpdateMode.robot => 004_04.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/{partialSucess.robot => 004_05.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/{failure.robot => 004_06.robot} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot new file mode 100644 index 00000000..d6c3a548 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you can upsert a batch of non-existing entities and they will be created +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Upsert a batch of non existing entities + [Documentation] Check that you can upsert a batch of non existing entities + [Tags] mandatory + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} + + Batch Upsert Entities @{entities_to_be_upserted} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot similarity index 66% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index d8b20dfb..aa0f6238 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities +Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -10,24 +10,6 @@ Suite Setup Setup Initial Entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** -Upsert a batch of non existing entities - [Documentation] Check that you can upsert a batch of non existing entities - [Tags] mandatory - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} - @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} - - Batch Upsert Entities @{entities_to_be_upserted} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - - Batch Delete Entities @{expected_entities_ids} - Upsert a batch of non existing and existing entities [Documentation] Check that you can upsert a batch of non existing and existing entities [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot rename to TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot -- GitLab From af4e8db9cb52b02e42010704e41a2988238e70e3 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 9 Dec 2020 10:42:33 +0100 Subject: [PATCH 046/442] feat: use data driven features where applicable --- .../CreateBatchOfEntities/003_01.robot | 5 ++-- .../CreateBatchOfEntities/003_03.robot | 20 +++++++-------- .../DeleteBatchOfEntities/006_03.robot | 20 +++++++-------- .../UpdateBatchOfEntities/005_01.robot | 24 ++++++++++++------ .../UpdateBatchOfEntities/005_02.robot | 24 ++++++++++++------ .../UpdateBatchOfEntities/005_04.robot | 21 +++++++--------- .../UpsertBatchOfEntities/004_01.robot | 16 +++++++++--- .../UpsertBatchOfEntities/004_02.robot | 25 +++++++++++++------ .../UpsertBatchOfEntities/004_03.robot | 24 ++++++++++++------ .../UpsertBatchOfEntities/004_04.robot | 23 ++++++++++++----- .../UpsertBatchOfEntities/004_06.robot | 20 +++++++-------- resources/ApiUtils.resource | 4 +-- 12 files changed, 136 insertions(+), 90 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index b31491a7..725fd77b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -4,7 +4,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Batch Entity Scenarios +Test Template Batch Create Entity Scenarios *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -12,10 +12,11 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME MinimalEntity building-minimal-sample.jsonld EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld *** Keywords *** -Create Batch Entity Scenarios +Batch Create Entity Scenarios [Arguments] ${filename} [Documentation] Check that you can create a batch of entities [Tags] mandatory entityOperations diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index eae07366..916fcd5c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -3,21 +3,19 @@ Documentation Check that you cannot create a batch of entities with an invalid Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -*** Test Case *** -With invalid json document - [Documentation] Check that you cannot create a batch of entities with an invalid json document - [Tags] mandatory - - Batch Request Entities From File create filename=batch/invalid-json-sample.jsonld +Test Template Create Batch Entity With Invalid Request Scenarios - Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} +*** Test Cases *** FILENAME +InvalidJson batch/invalid-json-sample.jsonld +EmptyJson batch/empty-sample.jsonld -With empty json document - [Documentation] Check that you cannot create a batch of entities with an empty json document +*** Keywords *** +Create Batch Entity With Invalid Request Scenarios + [Arguments] ${filename} + [Documentation] Check that you cannot create a batch of entities with an invalid request [Tags] mandatory - Batch Request Entities From File create filename=batch/empty-sample.jsonld + Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index cfdace33..ae664944 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -3,21 +3,19 @@ Documentation Check that you cannot delete a batch of entities with an invalid Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -*** Test Case *** -With invalid json document - [Documentation] Check that you cannot delete a batch of entities with an invalid json document - [Tags] mandatory - - Batch Request Entities From File delete filename=batch/invalid-json-sample.jsonld +Test Template Batch Delete Entity With Invalid Request Scenarios - Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} +*** Test Cases *** FILENAME +InvalidJson batch/invalid-json-sample.jsonld +EmptyJson batch/empty-sample.jsonld -With empty json document - [Documentation] Check that you cannot delete a batch of entities with an empty json document +*** Keywords *** +Batch Delete Entity With Invalid Request Scenarios + [Arguments] ${filename} + [Documentation] Check that you cannot delete a batch of entities with an invalid request [Tags] mandatory - Batch Request Entities From File delete filename=batch/empty-sample.jsonld + Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 2233b53e..4ecd8679 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -5,27 +5,31 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Test Template Batch Update Entity Scenarios +Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Update a batch of entities +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Update Entity Scenarios + [Arguments] ${filename} [Documentation] Check that you can update a batch of entities [Tags] mandatory - ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} Batch Update Entities @{entities_to_be_updated} Check Response Status Code Set To 204 - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - -*** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -34,3 +38,7 @@ Setup Initial Entities Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 56ddec05..45485a7d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -5,27 +5,31 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Test Template Batch Update Entity With NoOverwrite Option Scenarios +Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Update a batch of entities with noOverwrite option +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Update Entity With NoOverwrite Option Scenarios + [Arguments] ${filename} [Documentation] Check that you can update a batch of entities with noOverwrite option [Tags] mandatory - ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite Check Response Status Code Set To 204 - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - -*** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -34,3 +38,7 @@ Setup Initial Entities Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index 8f094b86..2c7b8fd1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -3,22 +3,19 @@ Documentation Check that you cannot update a batch of entities with an invalid Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -*** Test Case *** -With invalid json document - [Documentation] Check that you cannot update a batch of entities with an invalid json document - [Tags] mandatory - - Batch Request Entities From File update filename=batch/invalid-json-sample.jsonld +Test Template Batch Update Entity With Invalid Request Scenarios - Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} +*** Test Cases *** FILENAME +InvalidJson batch/invalid-json-sample.jsonld +InvalidJsonLd batch/invalid-json-ld-sample.jsonld -With json-ld document not syntactically correct according to the @context - [Documentation] Check that you cannot update a batch of entities with a json-ld document not syntactically correct according to the @context +*** Keywords *** +Batch Update Entity With Invalid Request Scenarios + [Arguments] ${filename} + [Documentation] Check that you cannot update a batch of entities with an invalid request [Tags] mandatory - #TODO: Use a json-ld document not syntactically correct according to the @context - Batch Request Entities From File update filename=batch/invalid-json-ld-sample.jsonld + Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index d6c3a548..d3f74612 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -4,18 +4,26 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Batch Upsert Entity Scenarios + *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Upsert a batch of non existing entities +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Upsert Entity Scenarios + [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing entities [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} Batch Upsert Entities @{entities_to_be_upserted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index aa0f6238..6ec7f570 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -5,19 +5,27 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Test Template Batch Upsert Non-existing And Existing Entities Scenarios +Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Upsert a batch of non existing and existing entities +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Upsert Non-existing And Existing Entities Scenarios + [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing and existing entities [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} - ${first_existing_entity}= Load Entity building-minimal-sample.jsonld ${first_existing_entity_id} - ${second_existing_entity}= Load Entity building-minimal-sample.jsonld ${second_existing_entity_id} + ${new_entity}= Load Entity ${filename} ${new_entity_id} + ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} + ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${first_existing_entity} ${second_existing_entity} Batch Upsert Entities @{entities_to_be_upserted} @@ -26,10 +34,9 @@ Upsert a batch of non existing and existing entities Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} -*** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -38,3 +45,7 @@ Setup Initial Entities Set Suite Variable ${first_existing_entity_id} Set Suite Variable ${second_existing_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 694de2af..24fe2194 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -5,27 +5,31 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Test Template Batch Upsert Existing Entities Scenarios +Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Upsert a batch of existing entities +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Upsert Existing Entities Scenarios + [Arguments] ${filename} [Documentation] Check that you can upsert a batch of existing entities [Tags] mandatory - ${first_existing_entity}= Load Entity building-minimal-sample.jsonld ${first_existing_entity_id} - ${second_existing_entity}= Load Entity building-minimal-sample.jsonld ${second_existing_entity_id} + ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} + ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} Batch Upsert Entities @{entities_to_be_upserted} Check Response Status Code Set To 204 - @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - -*** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -34,3 +38,7 @@ Setup Initial Entities Set Suite Variable ${first_existing_entity_id} Set Suite Variable ${second_existing_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 8ee93d2d..e9baf486 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -5,18 +5,26 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Test Template Batch Upsert Entities With Update Option Scenarios +Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** -Upsert a batch of entities with update option +*** Test Cases *** FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships building-relationship-sample.jsonld +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + +*** Keywords *** +Batch Upsert Entities With Update Option Scenarios + [Arguments] ${filename} [Documentation] Check that you can upsert a batch of entities with update option [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} - ${existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} + ${new_entity}= Load Entity ${filename} ${new_entity_id} + ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} Batch Upsert Entities @{entities_to_be_upserted} update_option=update @@ -25,12 +33,15 @@ Upsert a batch of entities with update option Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${existing_entity_id} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} -*** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 212bbf3e..aae23c28 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -3,21 +3,19 @@ Documentation Check that you cannot upsert a batch of entities with an invalid Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -*** Test Case *** -With invalid json document - [Documentation] Check that you cannot upsert a batch of entities with an invalid json document - [Tags] mandatory - - Batch Request Entities From File upsert filename=batch/invalid-json-sample.jsonld +Test Template Batch Upsert Entity With Invalid Request Scenarios - Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} +*** Test Cases *** FILENAME +InvalidJson batch/invalid-json-sample.jsonld +InvalidJsonLd batch/invalid-json-ld-sample.jsonld -With json-ld document containing a null value in any of its items - [Documentation] Check that you cannot upsert a batch of entities with a json-ld document containing a null value in any of its items +*** Keywords *** +Batch Upsert Entity With Invalid Request Scenarios + [Arguments] ${filename} + [Documentation] Check that you cannot upsert a batch of entities with an invalid request [Tags] mandatory - Batch Request Entities From File upsert filename=batch/invalid-json-ld-sample.jsonld + Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 16ef8732..934ca4a4 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -81,12 +81,12 @@ Batch Update Entities Set Test Variable ${response} Batch Delete Entities - [Arguments] @{entities_ids_to_be_deleted} + [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response - Set Test Variable ${response} + Run Keyword If not ${teardown} Set Test Variable ${response} Batch Request Entities From File [Arguments] ${batchOperation} ${filename} -- GitLab From f5f7c685ce9edcf5bdd10ef40994e33c80109b6f Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 9 Dec 2020 17:56:27 +0100 Subject: [PATCH 047/442] feat: add 020_01 020_02 20_03 TPs --- .../020_01.robot | 30 ++++++++++++ .../020_02.robot | 30 ++++++++++++ .../020_03.robot | 29 +++++++++++ ...cule-temporal-representation-sample.jsonld | 48 +++++++++++++++++++ resources/ApiUtils.resource | 25 ++++++++++ resources/AssertionUtils.resource | 11 +++++ resources/variables.py | 3 +- 7 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot create mode 100644 data/temporalEntities/vehicule-temporal-representation-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot new file mode 100644 index 00000000..f016390f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -0,0 +1,30 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Case *** +Retrieve the temporal evolution of an entity + [Documentation] Check that you can retrieve the temporal evolution of an entity + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + + @{expected_temporal_attributes}= Create List fuelLevel speed + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${expected_temporal_attributes} + + #TODO Call Delete Temporal Representation Of Entity + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot new file mode 100644 index 00000000..a719e995 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -0,0 +1,30 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of an entity using a context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Case *** +Retrieve the temporal evolution of an entity using a context + [Documentation] Check that you can retrieve the temporal evolution of an entity using a context + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${fiware_context} + + @{expected_temporal_attributes}= Create List speed fuelLevel + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${expected_temporal_attributes} + + #TODO Call Delete Temporal Representation Of Entity + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot new file mode 100644 index 00000000..7d36558e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Case *** +Retrieve the temporal evolution of certain attributes of an entity + [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity + [Tags] mandatory + + @{temporal_attributes_to_be_retrieved}= Create List fuelLevel + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${fiware_context} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${temporal_attributes_to_be_retrieved} + + #TODO Call Delete Temporal Representation Of Entity + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} diff --git a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/vehicule-temporal-representation-sample.jsonld new file mode 100644 index 00000000..4823e1b2 --- /dev/null +++ b/data/temporalEntities/vehicule-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + } + ], + "@context":[ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 934ca4a4..2dc9d5e1 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -12,6 +12,7 @@ ${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete ${ENTITIES_ENDPOINT_PATH} entities +${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${response} &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} @@ -96,3 +97,27 @@ Batch Request Entities From File &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST Request BatchRequest ${endpoint_url} data=${file_content} headers=${headers} Set Test Variable ${response} + +Create Temporal Representation Of Entity + [Arguments] ${filename} ${temporal_entity_representation_id} + ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + Output request + Output response + +Retrieve Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${context}=${EMPTY} + ${attrs_length} = Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 324d8182..d24e7fa4 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -28,6 +28,17 @@ Check Response Body Containing Batch Operation Result Should Not Be Empty ${response_error['error']} END +Check Response Body Containing EntityTemporal element + [Arguments] ${expected_temporal_attributes} + Should Not Be Empty ${response['body']['id']} + Should Not Be Empty ${response['body']['type']} + #Should Not Be Empty ${response['body']['@context']} + + FOR ${expected_temporal_attribute} IN @{expected_temporal_attributes} + ${temporal_attribute}= Get From Dictionary ${response['body']} ${expected_temporal_attribute} + List Should Not Contain Duplicates ${temporal_attribute} + END + Check Response Body Containing Problem Details Element Containing Detail Element [Arguments] ${response_body} Should Not Be Empty ${response_body['detail']} diff --git a/resources/variables.py b/resources/variables.py index 7136ce1f..628e19a5 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,5 +1,6 @@ def get_variables(arg=None): variables = { - 'url': 'http://127.0.0.1:8082/ngsi-ld/v1' + 'url': 'http://10.5.1.214:9090/ngsi-ld/v1', + 'fiware_context': 'https://fiware.github.io/data-models/context.jsonld' } return variables -- GitLab From f8e879d88726eb2b452062c98ba22a18fd963395 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 10 Dec 2020 09:26:01 +0100 Subject: [PATCH 048/442] feat: add test for simplified temporal representation of entity --- .../020_10.robot | 31 +++++++++++++++++++ ...temporal-representation-expectation.jsonld | 15 +++++++++ resources/ApiUtils.resource | 6 ++-- resources/AssertionUtils.resource | 7 +++++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot create mode 100644 data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot new file mode 100644 index 00000000..31293c22 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-simplified-temporal-representation-expectation.jsonld + +*** Test Case *** +Retrieve the temporal evolution of an entity with the simplified temporal representation + [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation + [Tags] mandatory + + @{options}= Create List temporalValues + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${fiware_context} + + Check Response Status Code Set To 200 + Check Response Body Containing simplified temporal representation of EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + + #TODO Call Delete Temporal Representation Of Entity + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld b/data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld new file mode 100644 index 00000000..6ed056e1 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld @@ -0,0 +1,15 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName": "Volvo", + "speed":[ + [ 120, "2018-08-01T12:03:00Z" ], + [ 80, "2018-08-01T12:05:00Z" ], + [ 100, "2018-08-01T12:07:00Z" ] + ], + "fuelLevel":[ + [ 67, "2018-08-01T12:03:00Z" ], + [ 53, "2018-08-01T13:05:00Z" ], + [ 40, "2018-08-01T14:07:00Z" ] + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 2dc9d5e1..4988385a 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -109,15 +109,17 @@ Create Temporal Representation Of Entity Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${context}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${attrs_length} = Get Length ${attrs} + ${options_length} = Get Length ${options} &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request Output response - Set Test Variable ${response} \ No newline at end of file + Set Test Variable ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index d24e7fa4..fd79159c 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -39,6 +39,13 @@ Check Response Body Containing EntityTemporal element List Should Not Contain Duplicates ${temporal_attribute} END +Check Response Body Containing simplified temporal representation of EntityTemporal element + [Arguments] ${filename} ${temporal_entity_representation_id} + ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} + ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + + Dictionaries Should Be Equal ${response['body']} ${temporal_entity_representation} + Check Response Body Containing Problem Details Element Containing Detail Element [Arguments] ${response_body} Should Not Be Empty ${response_body['detail']} -- GitLab From 6510ea6e9190af897966e4fd1a07dafb0a6ba6f2 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 10 Dec 2020 16:24:51 +0100 Subject: [PATCH 049/442] feat: add a custom context for the ngsi-ld test suite --- resources/ngsi-ld-test-suite-context.jsonld | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 resources/ngsi-ld-test-suite-context.jsonld diff --git a/resources/ngsi-ld-test-suite-context.jsonld b/resources/ngsi-ld-test-suite-context.jsonld new file mode 100644 index 00000000..778923cf --- /dev/null +++ b/resources/ngsi-ld-test-suite-context.jsonld @@ -0,0 +1,7 @@ +{ + "@context": { + "brandName": "https://ngsi-ld-test-suite/context#brandName", + "speed": "https://ngsi-ld-test-suite/context#speed", + "fuelLevel": "https://ngsi-ld-test-suite/context#fuelLevel" + } +} \ No newline at end of file -- GitLab From 26deef4d4e0280f80a033b45272d9b7e1f5e8a6f Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 10 Dec 2020 16:40:54 +0100 Subject: [PATCH 050/442] feat: use the temporary added ngsi-ld test suite context --- .../RetrieveTemporalEvolutionOfEntity/020_01.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_02.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_03.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_10.robot | 2 +- .../vehicule-temporal-representation-sample.jsonld | 2 +- resources/variables.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index f016390f..b34e5300 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -16,7 +16,7 @@ Retrieve the temporal evolution of an entity Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - @{expected_temporal_attributes}= Create List fuelLevel speed + @{expected_temporal_attributes}= Create List https://ngsi-ld-test-suite/context#speed https://ngsi-ld-test-suite/context#fuelLevel Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${expected_temporal_attributes} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index a719e995..9a68c60c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -14,7 +14,7 @@ Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] mandatory - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${fiware_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} @{expected_temporal_attributes}= Create List speed fuelLevel diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 7d36558e..7284c81f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -15,7 +15,7 @@ Retrieve the temporal evolution of certain attributes of an entity [Tags] mandatory @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${fiware_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${temporal_attributes_to_be_retrieved} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 31293c22..a6541fbe 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -17,7 +17,7 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres [Tags] mandatory @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${fiware_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 Check Response Body Containing simplified temporal representation of EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} diff --git a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/vehicule-temporal-representation-sample.jsonld index 4823e1b2..3423d17c 100644 --- a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicule-temporal-representation-sample.jsonld @@ -42,7 +42,7 @@ } ], "@context":[ - "https://fiware.github.io/data-models/context.jsonld", + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/resources/variables.py b/resources/variables.py index 628e19a5..1917f8e8 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,6 +1,6 @@ def get_variables(arg=None): variables = { 'url': 'http://10.5.1.214:9090/ngsi-ld/v1', - 'fiware_context': 'https://fiware.github.io/data-models/context.jsonld' + 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld' } return variables -- GitLab From 81f0da8095132d248f6d3c21d861e4294d3b7276 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 11:58:36 +0100 Subject: [PATCH 051/442] feat: improve assertions using a custom Compare Dictionaries Ignoring Keys keyword --- .../020_01.robot | 8 ++-- .../020_02.robot | 8 ++-- .../020_03.robot | 6 ++- .../020_10.robot | 2 +- ...l-representation-020-01-expectation.jsonld | 43 +++++++++++++++++++ ...l-representation-020-02-expectation.jsonld | 43 +++++++++++++++++++ ...l-representation-020-03-expectation.jsonld | 21 +++++++++ libraries/assertionUtils.py | 11 +++++ requirements.txt | 3 +- resources/AssertionUtils.resource | 21 ++++----- 10 files changed, 141 insertions(+), 25 deletions(-) create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld create mode 100644 libraries/assertionUtils.py diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index b34e5300..9bbe02f2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity @@ -16,15 +18,13 @@ Retrieve the temporal evolution of an entity Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - @{expected_temporal_attributes}= Create List https://ngsi-ld-test-suite/context#speed https://ngsi-ld-test-suite/context#fuelLevel - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${expected_temporal_attributes} + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} #TODO Call Delete Temporal Representation Of Entity *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 9a68c60c..8031817d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity using a context @@ -16,15 +18,13 @@ Retrieve the temporal evolution of an entity using a context Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} - @{expected_temporal_attributes}= Create List speed fuelLevel - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${expected_temporal_attributes} + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} #TODO Call Delete Temporal Representation Of Entity *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 7284c81f..47e1f163 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of certain attributes of an entity @@ -18,12 +20,12 @@ Retrieve the temporal evolution of certain attributes of an entity Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${temporal_attributes_to_be_retrieved} + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} #TODO Call Delete Temporal Representation Of Entity *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity vehicule-temporal-representation-sample.jsonld ${temporal_entity_representation_id} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index a6541fbe..8e8661d1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -20,7 +20,7 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing simplified temporal representation of EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} #TODO Call Delete Temporal Representation Of Entity diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld new file mode 100644 index 00000000..3671ae37 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld @@ -0,0 +1,43 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "https://ngsi-ld-test-suite/context#brandName":{ + "type":"Property", + "value":"Volvo" + }, + "https://ngsi-ld-test-suite/context#speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + } + ], + "https://ngsi-ld-test-suite/context#fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld new file mode 100644 index 00000000..ca4ca6ed --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld @@ -0,0 +1,43 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld new file mode 100644 index 00000000..facf8b67 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py new file mode 100644 index 00000000..f2c2b001 --- /dev/null +++ b/libraries/assertionUtils.py @@ -0,0 +1,11 @@ +from deepdiff import DeepDiff + +def compare_dictionaries_ignoring_keys(dict1, dict2, exclude_regex_paths): + """Function exposed as a keyword to compare two dictionaries + :param dict1: actual dictionary + :param dict2: expected dictionary + :param exclude_regex_paths: list of regex paths of keys to be ignored + """ + res = DeepDiff(dict1, dict2, exclude_regex_paths=[exclude_regex_paths], ignore_order=True) + print(res) + return not res \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 6a311f15..66cc2975 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ robotframework==3.2.1 RESTinstance==1.0.2 robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.3.1 -robotframework-requests==0.7.0 \ No newline at end of file +robotframework-requests==0.7.0 +deepdiff==5.0.2 \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index fd79159c..c27409d5 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,3 +1,9 @@ +*** Settings *** +Library ${EXECDIR}/libraries/assertionUtils.py + +*** Variable *** +${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] + *** Keywords *** Check Response Status Code Set To [Arguments] ${expected_status} @@ -29,22 +35,11 @@ Check Response Body Containing Batch Operation Result END Check Response Body Containing EntityTemporal element - [Arguments] ${expected_temporal_attributes} - Should Not Be Empty ${response['body']['id']} - Should Not Be Empty ${response['body']['type']} - #Should Not Be Empty ${response['body']['@context']} - - FOR ${expected_temporal_attribute} IN @{expected_temporal_attributes} - ${temporal_attribute}= Get From Dictionary ${response['body']} ${expected_temporal_attribute} - List Should Not Contain Duplicates ${temporal_attribute} - END - -Check Response Body Containing simplified temporal representation of EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - - Dictionaries Should Be Equal ${response['body']} ${temporal_entity_representation} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed Check Response Body Containing Problem Details Element Containing Detail Element [Arguments] ${response_body} -- GitLab From 3d31e93bdd7dda1e74521f6e37bed92e88600857 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 12:02:53 +0100 Subject: [PATCH 052/442] feat: rename expectation file for TP 020_10 --- .../RetrieveTemporalEvolutionOfEntity/020_10.robot | 2 +- ...> vehicle-temporal-representation-020-10-expectation.jsonld} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename data/temporalEntities/expectations/{vehicle-simplified-temporal-representation-expectation.jsonld => vehicle-temporal-representation-020-10-expectation.jsonld} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 8e8661d1..4c8f62bd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -9,7 +9,7 @@ Suite Setup Setup Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld -${vehicle_expectation_file}= vehicle-simplified-temporal-representation-expectation.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity with the simplified temporal representation diff --git a/data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld similarity index 100% rename from data/temporalEntities/expectations/vehicle-simplified-temporal-representation-expectation.jsonld rename to data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld -- GitLab From 0e98feea45db0d9bb4736691946ce533f42c3bb2 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 12:11:29 +0100 Subject: [PATCH 053/442] refactor: add line in EOF + update compare_dictionaries_ignoring_keys documentation --- libraries/assertionUtils.py | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py index f2c2b001..87a56863 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -4,8 +4,8 @@ def compare_dictionaries_ignoring_keys(dict1, dict2, exclude_regex_paths): """Function exposed as a keyword to compare two dictionaries :param dict1: actual dictionary :param dict2: expected dictionary - :param exclude_regex_paths: list of regex paths of keys to be ignored + :param exclude_regex_paths: regex path of keys to be ignored """ res = DeepDiff(dict1, dict2, exclude_regex_paths=[exclude_regex_paths], ignore_order=True) print(res) - return not res \ No newline at end of file + return not res diff --git a/requirements.txt b/requirements.txt index 66cc2975..c82d1681 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ RESTinstance==1.0.2 robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.3.1 robotframework-requests==0.7.0 -deepdiff==5.0.2 \ No newline at end of file +deepdiff==5.0.2 -- GitLab From aa8e8aab1e06ac878c0c060ec59d5901a91c2e97 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 12:16:03 +0100 Subject: [PATCH 054/442] refactor: refactor ngsi-ld-test-suite-context.jsonld --- resources/ngsi-ld-test-suite-context.jsonld | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/ngsi-ld-test-suite-context.jsonld b/resources/ngsi-ld-test-suite-context.jsonld index 778923cf..b9f67ea2 100644 --- a/resources/ngsi-ld-test-suite-context.jsonld +++ b/resources/ngsi-ld-test-suite-context.jsonld @@ -1,7 +1,7 @@ { - "@context": { - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "speed": "https://ngsi-ld-test-suite/context#speed", - "fuelLevel": "https://ngsi-ld-test-suite/context#fuelLevel" - } + "@context":{ + "brandName":"https://ngsi-ld-test-suite/context#brandName", + "speed":"https://ngsi-ld-test-suite/context#speed", + "fuelLevel":"https://ngsi-ld-test-suite/context#fuelLevel" + } } \ No newline at end of file -- GitLab From fd46483995136ae9aa2dcb05b3ccf37a1623b5a0 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 12:22:46 +0100 Subject: [PATCH 055/442] feat: first integration --- .../020_04.robot | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot new file mode 100644 index 00000000..74c6ac45 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIME ENDTIME VEHICLE_EXPECTATION_FILE +After after 2018-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld +Before before 2018-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld +Between between 2018-08-01T12:00:00Z 2018-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld + +*** Keywords *** +Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + [Arguments] ${timerel} ${time} ${endTime} ${vehicle_expectation_file} + [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} time=${time} endTime=${endTime} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + + +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +#TODO Call Suite Teardown \ No newline at end of file -- GitLab From f96fc52d7edf19443047ba7a957159cb5632c35a Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 11 Dec 2020 12:33:57 +0100 Subject: [PATCH 056/442] feat: add tp 020_04 --- .../020_04.robot | 2 +- ...epresentation-020-04-01-expectation.jsonld | 20 +++++++++++++ ...epresentation-020-04-02-expectation.jsonld | 25 ++++++++++++++++ ...epresentation-020-04-03-expectation.jsonld | 30 +++++++++++++++++++ resources/ApiUtils.resource | 5 +++- 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 74c6ac45..5640f072 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -22,7 +22,7 @@ Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Tags] mandatory - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} time=${time} endTime=${endTime} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} time=${time} endTime=${endTime} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld new file mode 100644 index 00000000..32bf63c0 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld new file mode 100644 index 00000000..af46993b --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":{ + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld new file mode 100644 index 00000000..8c87d29e --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld @@ -0,0 +1,30 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":{ + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 4988385a..547834a9 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -109,7 +109,7 @@ Create Temporal Representation Of Entity Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${time}=${EMPTY} ${endTime}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} &{headers}= Create Dictionary @@ -118,6 +118,9 @@ Retrieve Temporal Representation Of Entity Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${time}'!='' Set To Dictionary ${params} time=${time} + Run Keyword If '${endTime}'!='' Set To Dictionary ${params} endTime=${endTime} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request -- GitLab From 7b7759d91e878483a5a796adfa0508f9ed09820d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 12 Dec 2020 18:08:15 +0100 Subject: [PATCH 057/442] chore: Git ignore all Python compiled files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 25d6273d..3e9e56a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ resources/__pycache__ results +*.pyc -- GitLab From dd072be942ae95238fd4fd1ac9b87060af9ecc04 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 14 Dec 2020 16:48:20 +0100 Subject: [PATCH 058/442] feat: add JSON-LD @context resolution tests for batch entity creation endpoint --- .../CreateBatchOfEntities/003_03.robot | 2 +- .../CreateBatchOfEntities/003_04.robot | 32 +++++++++++++++++++ .../CreateBatchOfEntities/003_05.robot | 32 +++++++++++++++++++ .../CreateBatchOfEntities/003_06.robot | 23 +++++++++++++ .../CreateBatchOfEntities/003_07.robot | 32 +++++++++++++++++++ .../CreateBatchOfEntities/003_08.robot | 23 +++++++++++++ .../CreateBatchOfEntities/003_09.robot | 23 +++++++++++++ .../DeleteBatchOfEntities/006_03.robot | 2 +- .../UpdateBatchOfEntities/005_04.robot | 2 +- .../UpsertBatchOfEntities/004_06.robot | 2 +- .../building-simple-attributes-sample.json | 22 +++++++++++++ resources/ApiUtils.resource | 24 ++++++++++++-- resources/AssertionUtils.resource | 14 ++++++-- 13 files changed, 223 insertions(+), 10 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot create mode 100644 data/entities/building-simple-attributes-sample.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index 916fcd5c..81a0f4ad 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -18,4 +18,4 @@ Create Batch Entity With Invalid Request Scenarios Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot new file mode 100644 index 00000000..484baea7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity using a provided Link header with JSON content type + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 201 + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + # Attribute should be compacted as we used the same context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} + # Attribute should not be compacted as we did not provide a context containing this attribute + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot new file mode 100644 index 00000000..9a489158 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity using the default context with JSON content type + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 201 + + Retrieve Entity by Id ${entity_id} + # Attribute should be compacted as we used the same default context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + # Attribute should not be compacted as we did not provide a context containing this term + Check Response Body Containing an Attribute set to https://uri.etsi.org/ngsi-ld/default-context/almostFull + + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot new file mode 100644 index 00000000..b67ba32e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity containing a JSON-LD @context with a JSON content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot new file mode 100644 index 00000000..89d4cfde --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity using a JSON-LD @context obtained from the request payload + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + + Check Response Status Code Set To 201 + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + # Attribute should be compacted as we used the same context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} + # Attribute should not be compacted as we did not provide a context containing this term + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot new file mode 100644 index 00000000..7646496a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot new file mode 100644 index 00000000..88ebf3ac --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of one entity with a Link header and a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index ae664944..d3a32f42 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -18,4 +18,4 @@ Batch Delete Entity With Invalid Request Scenarios Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index 2c7b8fd1..f9a32ae5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -18,4 +18,4 @@ Batch Update Entity With Invalid Request Scenarios Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index aae23c28..d3a02b9c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -18,4 +18,4 @@ Batch Upsert Entity With Invalid Request Scenarios Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing Problem Details Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} diff --git a/data/entities/building-simple-attributes-sample.json b/data/entities/building-simple-attributes-sample.json new file mode 100644 index 00000000..c0beff52 --- /dev/null +++ b/data/entities/building-simple-attributes-sample.json @@ -0,0 +1,22 @@ +{ + "id": "RandomUuidToBeReplaced", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + } +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 547834a9..946c63e4 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -11,10 +11,16 @@ ${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create ${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete +&{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities + +${CONTENT_TYPE_JSON} application/json +${CONTENT_TYPE_LD_JSON} application/ld+json + +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData + ${response} -&{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} *** Keywords *** Api POST request @@ -47,6 +53,16 @@ Delete Entity by Id Output request Output response +Retrieve Entity by Id + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${ENTITIES_ENDPOINT_PATH}/${id} headers=${headers} + Output request + Output response + Set Test Variable ${response} + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} @@ -58,8 +74,10 @@ Create Entity Output response Batch Create Entities - [Arguments] @{entities_to_be_created} - &{headers}= Create Dictionary Content-Type=application/ld+json + [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${content_type} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} Output request Output response diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c27409d5..6ed5b677 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -18,6 +18,10 @@ Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True +Check Response Body Containing an Attribute set to + [Arguments] ${expected_attribute_name} + Should Not Be Empty ${response['body']['${expected_attribute_name}']} + Check Response Body Containing Batch Operation Result [Arguments] ${expected_batch_operation_result} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success @@ -41,11 +45,15 @@ Check Response Body Containing EntityTemporal element ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed -Check Response Body Containing Problem Details Element Containing Detail Element +Check Response Body Containing ProblemDetails Element Containing Type Element set to + [Arguments] ${response_body} ${type} + Should Be Equal ${response['body']['type']} ${type} + +Check Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response_body} - Should Not Be Empty ${response_body['detail']} + Should Not Be Empty ${response['body']['title']} -Check RL Response Body Containing Problem Details Element Containing Detail Element +Check RL Response Body Containing ProblemDetails Element Containing Detail Element [Arguments] ${response_body} ${json_response_body}= To Json ${response_body.content} Should Not Be Empty ${json_response_body['detail']} -- GitLab From c3afa121927076678c966649cf66bd3c6f46fce2 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 15 Dec 2020 10:43:41 +0100 Subject: [PATCH 059/442] feat: complete implementation of retrieve temporal evolution of entity --- .../020_01.robot | 6 +- .../020_02.robot | 6 +- .../020_03.robot | 6 +- .../020_04.robot | 11 +- .../020_05.robot | 36 ++++ .../020_06.robot | 16 ++ .../020_07.robot | 16 ++ .../020_08.robot | 33 ++++ .../020_09.robot | 38 ++++ .../020_10.robot | 6 +- .../CreateBatchOfEntities/003_03.robot | 11 +- .../DeleteBatchOfEntities/006_03.robot | 11 +- .../UpdateBatchOfEntities/005_04.robot | 11 +- .../UpsertBatchOfEntities/004_06.robot | 11 +- ...epresentation-020-05-01-expectation.jsonld | 112 +++++++++++ ...epresentation-020-05-02-expectation.jsonld | 177 +++++++++++++++++ ...sentation-multiple-instances-sample.jsonld | 183 ++++++++++++++++++ resources/ApiUtils.resource | 16 +- resources/AssertionUtils.resource | 17 +- 19 files changed, 681 insertions(+), 42 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld create mode 100644 data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 9bbe02f2..1fedda07 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 8031817d..54f83eb6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity using a context Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 47e1f163..b2b62855 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -22,10 +23,11 @@ Retrieve the temporal evolution of certain attributes of an entity Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 5640f072..b56fa289 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -5,32 +5,33 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIME ENDTIME VEHICLE_EXPECTATION_FILE +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE After after 2018-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld Before before 2018-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld Between between 2018-08-01T12:00:00Z 2018-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${time} ${endTime} ${vehicle_expectation_file} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Tags] mandatory - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} time=${time} endTime=${endTime} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -#TODO Call Suite Teardown \ No newline at end of file +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot new file mode 100644 index 00000000..3810a1c2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of the last N instances of entity attributes + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-multiple-instances-sample.jsonld + +*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE +Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld +Retrieve All Instances ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + +*** Keywords *** +Retrieve the temporal evolution of the last N instances of entity attributes + [Arguments] ${lastN} ${vehicle_expectation_file} + [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot new file mode 100644 index 00000000..9c591968 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve the temporal evolution of an entity with an invalid id + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) + [Tags] mandatory + + Retrieve Temporal Representation Of Entity invalidUri + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot new file mode 100644 index 00000000..2b5393ff --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve the temporal evolution of a non-existing entity + [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity + [Tags] mandatory + + Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot new file mode 100644 index 00000000..20892e4a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld + +*** Test Case *** +Retrieve the temporal evolution of non-existing entity attributes + [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes + [Tags] mandatory + + @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot new file mode 100644 index 00000000..c67b3d1c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity with an invalid request content + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT +After after ${EMPTY} ${EMPTY} +Before before ${EMPTY} ${EMPTY} +Between between 2020-08-01T12:00:00Z ${EMPTY} + +*** Keywords *** +Retrieve the temporal evolution of an entity with an invalid request content + [Arguments] ${timerel} ${timeAt} ${endTimeAt} + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 4c8f62bd..0813a452 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -22,10 +23,11 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index 81a0f4ad..e169e6fa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Batch Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -EmptyJson batch/empty-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Create Batch Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot create a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index d3a32f42..1cdbba5b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Delete Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -EmptyJson batch/empty-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Delete Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot delete a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index f9a32ae5..a3195d45 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Update Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -InvalidJsonLd batch/invalid-json-ld-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Update Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot update a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index d3a02b9c..8bf80f0f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Upsert Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -InvalidJsonLd batch/invalid-json-ld-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot upsert a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld new file mode 100644 index 00000000..34e35ca1 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -0,0 +1,112 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld new file mode 100644 index 00000000..6399ccd0 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -0,0 +1,177 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2018-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2018-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld new file mode 100644 index 00000000..605dd0e0 --- /dev/null +++ b/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -0,0 +1,183 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2018-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2018-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 946c63e4..13733600 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -19,6 +19,8 @@ ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json ${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${response} @@ -127,7 +129,7 @@ Create Temporal Representation Of Entity Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${time}=${EMPTY} ${endTime}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} &{headers}= Create Dictionary @@ -137,10 +139,18 @@ Retrieve Temporal Representation Of Entity Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${time}'!='' Set To Dictionary ${params} time=${time} - Run Keyword If '${endTime}'!='' Set To Dictionary ${params} endTime=${endTime} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If '${endTimeAt}'!='' Set To Dictionary ${params} endTimeAt=${endTimeAt} + Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} + +Delete Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} + + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6ed5b677..0b31186a 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -46,17 +46,22 @@ Check Response Body Containing EntityTemporal element Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed Check Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response_body} ${type} + [Arguments] ${response} ${type} Should Be Equal ${response['body']['type']} ${type} Check Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response_body} + [Arguments] ${response} Should Not Be Empty ${response['body']['title']} -Check RL Response Body Containing ProblemDetails Element Containing Detail Element - [Arguments] ${response_body} - ${json_response_body}= To Json ${response_body.content} - Should Not Be Empty ${json_response_body['detail']} +Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + [Arguments] ${response} ${type} + ${json_response_body}= To Json ${response.content} + Should Be Equal ${json_response_body['type']} ${type} + +Check RL Response Body Containing ProblemDetails Element Containing Title Element + [Arguments] ${response} + ${json_response_body}= To Json ${response.content} + Should Not Be Empty ${json_response_body['title']} Assert response status code [Arguments] ${code} -- GitLab From e842789e9aba79327d093d404a670b815610613a Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 17:49:17 +0100 Subject: [PATCH 060/442] feature: add tps for query temporal evolution of entities --- .../021_01.robot | 52 +++++ .../021_02.robot | 41 ++++ .../021_03.robot | 40 ++++ .../021_04.robot | 40 ++++ .../021_05.robot | 41 ++++ .../021_06.robot | 41 ++++ .../021_07.robot | 40 ++++ .../021_08.robot | 40 ++++ .../021_09.robot | 45 ++++ .../020_01.robot | 2 +- .../020_02.robot | 2 +- .../020_03.robot | 2 +- .../020_04.robot | 8 +- .../020_05.robot | 2 +- .../020_08.robot | 2 +- .../020_09.robot | 2 +- .../020_10.robot | 2 +- ...-bus-temporal-representation-sample.jsonld | 48 +++++ ...entation-multiple-instances-sample.jsonld} | 66 +++--- ...ule-temporal-representation-sample.jsonld} | 12 +- ...cule-temporal-representation-sample.jsonld | 48 +++++ ...representation-with-location-sample.jsonld | 66 ++++++ ...l-representation-020-01-expectation.jsonld | 12 +- ...l-representation-020-02-expectation.jsonld | 12 +- ...l-representation-020-03-expectation.jsonld | 6 +- ...epresentation-020-04-01-expectation.jsonld | 4 +- ...epresentation-020-04-02-expectation.jsonld | 6 +- ...epresentation-020-04-03-expectation.jsonld | 8 +- ...epresentation-020-05-01-expectation.jsonld | 40 ++-- ...epresentation-020-05-02-expectation.jsonld | 66 +++--- ...l-representation-020-10-expectation.jsonld | 12 +- ...epresentation-021-01-01-expectation.jsonld | 76 +++++++ ...epresentation-021-01-02-expectation.jsonld | 81 ++++++++ ...l-representation-021-02-expectation.jsonld | 44 ++++ ...l-representation-021-03-expectation.jsonld | 196 ++++++++++++++++++ ...l-representation-021-04-expectation.jsonld | 86 ++++++++ ...l-representation-021-05-expectation.jsonld | 86 ++++++++ ...l-representation-021-06-expectation.jsonld | 44 ++++ ...l-representation-021-07-expectation.jsonld | 86 ++++++++ ...l-representation-021-08-expectation.jsonld | 76 +++++++ ...epresentation-021-09-01-expectation.jsonld | 54 +++++ ...epresentation-021-09-02-expectation.jsonld | 62 ++++++ resources/ApiUtils.resource | 26 +++ resources/AssertionUtils.resource | 11 + 44 files changed, 1603 insertions(+), 133 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot create mode 100644 data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld rename data/temporalEntities/{vehicule-temporal-representation-multiple-instances-sample.jsonld => 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld} (64%) rename data/temporalEntities/{vehicule-temporal-representation-sample.jsonld => 2020-08-vehicule-temporal-representation-sample.jsonld} (76%) create mode 100644 data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld create mode 100644 data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot new file mode 100644 index 00000000..44b84152 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld +Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld + + +*** Keywords *** +Query the temporal evolution of entities + [Arguments] ${timerel} ${timeAt} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot new file mode 100644 index 00000000..02eec535 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of certain attributes of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of certain attributes of entities + [Documentation] Check that you can query the temporal evolution of certain attributes of entities + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + @{temporal_attributes_to_be_retrieved}= Create List speed + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot new file mode 100644 index 00000000..01253a3d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of the last N instances of entities attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of the last N instances of entities attributes + [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot new file mode 100644 index 00000000..53380e1f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities using a context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities using a context + [Documentation] Check that you can query the temporal evolution of entities using a context + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot new file mode 100644 index 00000000..1955e003 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given type(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given type(s) + [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle Bus + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot new file mode 100644 index 00000000..953470c1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given identifier(s) + [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + @{entity_ids_to_be_retrieved}= Create List ${first_temporal_entity_representation_id} + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot new file mode 100644 index 00000000..ec96446e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given id pattern + [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot new file mode 100644 index 00000000..ef0c3a0f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given NGSI-LD query + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot new file mode 100644 index 00000000..9c5ab855 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE +Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld +Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + +*** Keywords *** +Query the temporal evolution of entities matching the given NGSI-LD geo-query + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 1fedda07..d6ffc50b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 54f83eb6..80aaad87 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index b2b62855..a23dc00b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index b56fa289..f3b5cf89 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -10,12 +10,12 @@ Test Template Retrieve the temporal evolution of an entity matching the given N *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -After after 2018-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld -Before before 2018-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld -Between between 2018-08-01T12:00:00Z 2018-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld +After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld +Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld +Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 3810a1c2..d7d6e7c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -10,7 +10,7 @@ Test Template Retrieve the temporal evolution of the last N instances of entity *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-multiple-instances-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld *** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 20892e4a..909493fc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Retrieve the temporal evolution of non-existing entity attributes diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index c67b3d1c..b93dc652 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -10,7 +10,7 @@ Test Template Retrieve the temporal evolution of an entity with an invalid requ *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT After after ${EMPTY} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 0813a452..bd14fb81 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld *** Test Case *** diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld new file mode 100644 index 00000000..22efffc5 --- /dev/null +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":[ + { + "type":"Property", + "value":"Mercedes" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld similarity index 64% rename from data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld rename to data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 605dd0e0..23e1fff4 100644 --- a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -11,169 +11,169 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" }, { "type":"Property", "value":110, - "observedAt":"2018-08-01T12:09:00Z" + "observedAt":"2020-08-01T12:09:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:11:00Z" + "observedAt":"2020-08-01T12:11:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:13:00Z" + "observedAt":"2020-08-01T12:13:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T14:20:00Z" + "observedAt":"2020-08-01T14:20:00Z" }, { "type":"Property", "value":30, - "observedAt":"2018-08-01T15:05:00Z" + "observedAt":"2020-08-01T15:05:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T15:07:00Z" + "observedAt":"2020-08-01T15:07:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T15:20:00Z" + "observedAt":"2020-08-01T15:20:00Z" }, { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "@context":[ diff --git a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld similarity index 76% rename from data/temporalEntities/vehicule-temporal-representation-sample.jsonld rename to data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index 3423d17c..070d566b 100644 --- a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -11,34 +11,34 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ], "@context":[ diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld new file mode 100644 index 00000000..4f095bf1 --- /dev/null +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld new file mode 100644 index 00000000..e88e09d5 --- /dev/null +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -0,0 +1,66 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Audi" + } + ], + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Point", + "coordinates":[ + 2.35, + 42.22 + ], + "observedAt":"2020-10-01T12:05:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld index 3671ae37..b632d1c6 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld @@ -9,35 +9,35 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "https://ngsi-ld-test-suite/context#fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld index ca4ca6ed..74f8d774 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld @@ -9,35 +9,35 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld index facf8b67..0c4045ef 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld @@ -5,17 +5,17 @@ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld index 32bf63c0..1a212875 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld @@ -9,12 +9,12 @@ { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld index af46993b..eb29e25a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld @@ -8,18 +8,18 @@ "fuelLevel":{ "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld index 8c87d29e..4af9cc6c 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld @@ -8,23 +8,23 @@ "fuelLevel":{ "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld index 34e35ca1..8799061b 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -9,104 +9,104 @@ { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "speed":[ { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld index 6399ccd0..f8de9cff 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -9,169 +9,169 @@ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T14:20:00Z" + "observedAt":"2020-08-01T14:20:00Z" }, { "type":"Property", "value":30, - "observedAt":"2018-08-01T15:05:00Z" + "observedAt":"2020-08-01T15:05:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T15:07:00Z" + "observedAt":"2020-08-01T15:07:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T15:20:00Z" + "observedAt":"2020-08-01T15:20:00Z" }, { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" }, { "type":"Property", "value":110, - "observedAt":"2018-08-01T12:09:00Z" + "observedAt":"2020-08-01T12:09:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:11:00Z" + "observedAt":"2020-08-01T12:11:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:13:00Z" + "observedAt":"2020-08-01T12:13:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld index 6ed056e1..14fa90a4 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld @@ -3,13 +3,13 @@ "type":"Vehicle", "brandName": "Volvo", "speed":[ - [ 120, "2018-08-01T12:03:00Z" ], - [ 80, "2018-08-01T12:05:00Z" ], - [ 100, "2018-08-01T12:07:00Z" ] + [ 120, "2020-08-01T12:03:00Z" ], + [ 80, "2020-08-01T12:05:00Z" ], + [ 100, "2020-08-01T12:07:00Z" ] ], "fuelLevel":[ - [ 67, "2018-08-01T12:03:00Z" ], - [ 53, "2018-08-01T13:05:00Z" ], - [ 40, "2018-08-01T14:07:00Z" ] + [ 67, "2020-08-01T12:03:00Z" ], + [ 53, "2020-08-01T13:05:00Z" ], + [ 40, "2020-08-01T14:07:00Z" ] ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld new file mode 100644 index 00000000..6fb2bc95 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld new file mode 100644 index 00000000..5c0a60b0 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld @@ -0,0 +1,81 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld new file mode 100644 index 00000000..105bf3a1 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld @@ -0,0 +1,44 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld new file mode 100644 index 00000000..4abeba3b --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld @@ -0,0 +1,196 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2020-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2020-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2020-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2020-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2020-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2020-08-01T12:35:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":35, + "observedAt":"2020-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2020-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2020-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2020-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2020-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2020-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2020-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2020-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2020-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2020-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-08-01T22:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld new file mode 100644 index 00000000..fdbbaea5 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld new file mode 100644 index 00000000..7043d27c --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":{ + "type":"Property", + "value":"Mercedes" + }, + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld new file mode 100644 index 00000000..c5cd1101 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld @@ -0,0 +1,44 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld new file mode 100644 index 00000000..fdbbaea5 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld new file mode 100644 index 00000000..1923befa --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld new file mode 100644 index 00000000..fc6f36e2 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld @@ -0,0 +1,54 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Audi" + }, + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld new file mode 100644 index 00000000..8d6466fc --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld @@ -0,0 +1,62 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Audi" + }, + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Point", + "coordinates":[ + -8.45, + 41.22 + ], + "observedAt":"2020-10-01T12:05:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 13733600..28d92519 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -148,6 +148,32 @@ Retrieve Temporal Representation Of Entity Output response Set Test Variable ${response} +Query Temporal Representation Of Entities + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + ${entity_types_length} = Get Length ${entity_types} + ${entity_ids_length} = Get Length ${entity_ids} + ${attrs_length} = Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} + Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 0b31186a..ef5d6446 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -45,6 +45,17 @@ Check Response Body Containing EntityTemporal element ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed +Check Response Body Containing List Containing EntityTemporal elements + [Arguments] ${filename} ${temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} + ${index}= Set Variable 0 + FOR ${temporal_entity_representation_id} IN @{temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} + ${index}= Evaluate ${index} + 1 + END + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed + Check Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} Should Be Equal ${response['body']['type']} ${type} -- GitLab From 7984ca42ddff9c7ba66189b5e3284c435bf92f4e Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 18 Dec 2020 16:52:22 +0100 Subject: [PATCH 061/442] feat: complete implementation of query temporal entities tps --- .../021_11.robot | 52 +++++++ .../021_12.robot | 32 +++++ .../021_13.robot | 43 ++++++ .../entity-operations-after-query.jsonld | 9 ++ .../entity-operations-before-query.jsonld | 9 ++ ...epresentation-021-11-01-expectation.jsonld | 86 ++++++++++++ ...epresentation-021-11-02-expectation.jsonld | 128 ++++++++++++++++++ ...epresentation-021-13-01-expectation.jsonld | 52 +++++++ ...epresentation-021-13-02-expectation.jsonld | 52 +++++++ resources/ApiUtils.resource | 14 +- 10 files changed, 476 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot create mode 100644 data/temporalEntities/entity-operations-after-query.jsonld create mode 100644 data/temporalEntities/entity-operations-before-query.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot new file mode 100644 index 00000000..b1fdaa47 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + +${expectation_file}= vehicles-temporal-representation-021-11-expectation.jsonld + +*** Test Cases *** LIMIT EXPECTATION_FILE TEMPORAL_ENTITIES_REPRESENTATION_IDS +Query Some entities ${2} vehicles-temporal-representation-021-11-01-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} +Query All entities ${20} vehicles-temporal-representation-021-11-02-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} ${third_temporal_entity_representation_id} + +*** Keywords *** +Query the temporal evolution of entities with a limit to the number of entities to be retrieved + [Arguments] ${limit} ${expectation_file} @{temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle Bus + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot new file mode 100644 index 00000000..6bfb3e01 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld + +*** Test Case *** +Query the temporal evolution of entities with an invalid request + [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request + [Tags] mandatory + + Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot new file mode 100644 index 00000000..fddc62ad --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities using the entityOperations method +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities using the entityOperations method + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE +After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld +Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld + +*** Keywords *** +Query the temporal evolution of entities using the entityOperations method + [Arguments] ${payload_file} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method + [Tags] mandatory + + Query Temporal Representation Of Entities Via Post ${payload_file} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/entity-operations-after-query.jsonld b/data/temporalEntities/entity-operations-after-query.jsonld new file mode 100644 index 00000000..494f7062 --- /dev/null +++ b/data/temporalEntities/entity-operations-after-query.jsonld @@ -0,0 +1,9 @@ +{ + "type":"Vehicle", + "timerel":"after", + "timeAt":"2020-08-02T12:05:00Z", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-before-query.jsonld b/data/temporalEntities/entity-operations-before-query.jsonld new file mode 100644 index 00000000..9a5ab48f --- /dev/null +++ b/data/temporalEntities/entity-operations-before-query.jsonld @@ -0,0 +1,9 @@ +{ + "type":"Vehicle", + "timerel":"before", + "timeAt":"2020-08-02T12:05:00Z", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld new file mode 100644 index 00000000..fdbbaea5 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld new file mode 100644 index 00000000..5396ce0d --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld @@ -0,0 +1,128 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":{ + "type":"Property", + "value":"Mercedes" + }, + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld new file mode 100644 index 00000000..4adef51e --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld @@ -0,0 +1,52 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + } + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld new file mode 100644 index 00000000..7fbe7c43 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld @@ -0,0 +1,52 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + } + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 28d92519..50407fe7 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -14,6 +14,7 @@ ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities +${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json @@ -149,7 +150,7 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} @@ -168,12 +169,23 @@ Query Temporal Representation Of Entities Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} +Query Temporal Representation Of Entities Via Post + [Arguments] ${query_file_name} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${CONTENT_TYPE_LD_JSON} + ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} + ${response}= POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} + Output request + Output response + Set Test Variable ${response} + Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} -- GitLab From 22fb57f9424aea70ebd36ed10b29c7de131d810b Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 22 Dec 2020 15:19:30 +0000 Subject: [PATCH 062/442] created Provision/Entities/CreateEntity/001.robot tests suite --- .gitignore | 1 + .../Provision/Entities/CreateEntity/001.robot | 34 +++++++++++++++++++ ...ding-minimal-without-context-sample.jsonld | 4 +++ resources/ApiUtils.resource | 22 ++++++++++-- resources/AssertionUtils.resource | 5 +++ resources/variables.py | 2 +- 6 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot create mode 100644 data/entities/building-minimal-without-context-sample.jsonld diff --git a/.gitignore b/.gitignore index 3e9e56a4..438bfca9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ resources/__pycache__ results *.pyc +*.http \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot new file mode 100644 index 00000000..920caa27 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you can create an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Entity Scenarios + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME CONTENT_TYPE +MinimalEntity building-minimal-without-context-sample.jsonld application/json +EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json +#EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json +EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json + + + +*** Keywords *** +Create Entity Scenarios + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create an entity + [Tags] mandatory entityOperations + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity ${filename} ${entity_id} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']} ${entity_id} + + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/data/entities/building-minimal-without-context-sample.jsonld b/data/entities/building-minimal-without-context-sample.jsonld new file mode 100644 index 00000000..78ff3565 --- /dev/null +++ b/data/entities/building-minimal-without-context-sample.jsonld @@ -0,0 +1,4 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building" +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 13733600..52f19e04 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -12,7 +12,8 @@ ${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} -${ENTITIES_ENDPOINT_PATH} entities +${ENTITIES_ENDPOINT_PATH} entities/ +#${ENTITIES_ENDPOINT_PATH} entities original ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${CONTENT_TYPE_JSON} application/json @@ -51,7 +52,8 @@ Api DEL request Delete Entity by Id [Arguments] ${id} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} + #${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} original + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} Output request Output response @@ -63,7 +65,20 @@ Retrieve Entity by Id ${response}= GET ${ENTITIES_ENDPOINT_PATH}/${id} headers=${headers} Output request Output response - Set Test Variable ${response} + Set Test Variable ${response} + +Create Entity Selecting Content Type + [Arguments] ${filename} ${entity_id} ${content_type} + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + Output request + Output response + Set Test Variable ${response} + ${request}= Output request + Set Test Variable ${request} Create Entity [Arguments] ${filename} ${entity_id} @@ -74,6 +89,7 @@ Create Entity ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request Output response + Set Test Variable ${response} Batch Create Entities [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 0b31186a..fc090ca2 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -18,6 +18,11 @@ Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True +Check Response Headers Containing URI set to +# upon success, the http response shall include a loication http header that countains the uri of the created entity resource + [Arguments] ${expected_path} ${expected_entity_id} + Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} Should Not Be Empty ${response['body']['${expected_attribute_name}']} diff --git a/resources/variables.py b/resources/variables.py index 1917f8e8..881e64b3 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,6 +1,6 @@ def get_variables(arg=None): variables = { - 'url': 'http://10.5.1.214:9090/ngsi-ld/v1', + 'url': 'http://localhost:9090/ngsi-ld/v1', 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld' } return variables -- GitLab From 66719a60eadfdaa42e8980dcc398a50913396fa3 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 22 Dec 2020 18:12:22 +0000 Subject: [PATCH 063/442] created Provision/Entities/CreateEntity/002.robot --- .../Provision/Entities/CreateEntity/002.robot | 22 +++++++++++++++++++ data/entities/empty-sample.jsonld | 1 + data/entities/invalid-json-sample.jsonld | 10 +++++++++ resources/ApiUtils.resource | 14 ++++++++++-- resources/AssertionUtils.resource | 4 ++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot create mode 100644 data/entities/empty-sample.jsonld create mode 100644 data/entities/invalid-json-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot new file mode 100644 index 00000000..3a46d47d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot create an entity with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Entity With Invalid Request Scenarios + +*** Test Cases *** FILENAME PROBLEM_TYPE EXPECTED_CODE +InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 406 +EmptyJson empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 400 + +*** Keywords *** +Create Entity With Invalid Request Scenarios + [Arguments] ${filename} ${problem_type} ${expected_code} + [Documentation] Check that you cannot create an entity with an invalid request + [Tags] mandatory + + Request Entity From File ${filename} + + Check RL Response Status Code Set To Expected Code ${expected_code} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/data/entities/empty-sample.jsonld b/data/entities/empty-sample.jsonld new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/data/entities/empty-sample.jsonld @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/data/entities/invalid-json-sample.jsonld b/data/entities/invalid-json-sample.jsonld new file mode 100644 index 00000000..dcbdb010 --- /dev/null +++ b/data/entities/invalid-json-sample.jsonld @@ -0,0 +1,10 @@ +[ + { + "id":"urn:ngsi-ld:Building:randomUUID",, + "type":"Building", + "@context":[ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 52f19e04..01d6d9f4 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -19,8 +19,10 @@ ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json -${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +#${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData original +${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData +#${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest original +${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest ${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${response} @@ -125,6 +127,14 @@ Batch Delete Entities Output response Run Keyword If not ${teardown} Set Test Variable ${response} +Request Entity From File + [Arguments] ${filename} + ${file_content}= Get File ${EXECDIR}/data/entities/${filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST Request OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} + Set Test Variable ${response} + Batch Request Entities From File [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index fc090ca2..413628d1 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -10,6 +10,10 @@ Check Response Status Code Set To ${response_status}= convert to string ${response['status']} Should Be Equal ${response_status} ${expected_status} +Check RL Response Status Code Set To Expected Code + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} + Check RL Response Status Code Set To [Arguments] ${expected_status} Status Should Be ${expected_status} ${response} -- GitLab From a824be126a32c3f8398fc6a37a40e0a4d4337576 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 23 Dec 2020 09:59:20 +0000 Subject: [PATCH 064/442] created Provision/Entities/CreateEntity/003.robot --- .../Provision/Entities/CreateEntity/001.robot | 1 - .../Provision/Entities/CreateEntity/003.robot | 26 +++++++++++++++++++ resources/AssertionUtils.resource | 4 +++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot index 920caa27..d64edec0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -25,7 +25,6 @@ Create Entity Scenarios [Tags] mandatory entityOperations ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity ${filename} ${entity_id} Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot new file mode 100644 index 00000000..a0257a3d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot create an entity with and existing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${expected_error_message}= Already exists. + +*** Test Case *** +Create one valid entity and one invalid entity + [Documentation] Check that you cannot create an entity with and existing id + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity building-minimal-sample.jsonld ${entity_id} + Check Response Status Code Set To 201 + + #creating entity with the same id + Create Entity building-minimal-sample.jsonld ${entity_id} + Check Response Status Code Set To 409 + Check Response Body Details Containing Information Error ${expected_error_message} + + [Teardown] Delete Entity by Id ${entity_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 413628d1..5ac51d6b 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -31,6 +31,10 @@ Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} Should Not Be Empty ${response['body']['${expected_attribute_name}']} +Check Response Body Details Containing Information Error + [Arguments] ${expected_error_message} + Should be Equal ${expected_error_message} ${response['body']['details']} + Check Response Body Containing Batch Operation Result [Arguments] ${expected_batch_operation_result} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success -- GitLab From 3acae9035059a1c0aa2356c1dfd2e977741486bc Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 23 Dec 2020 10:44:26 +0000 Subject: [PATCH 065/442] refactored some keywords --- .../Provision/Entities/CreateEntity/003.robot | 10 ++++++---- resources/ApiUtils.resource | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot index a0257a3d..973171d8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -7,6 +7,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${expected_error_message}= Already exists. +${filename}= building-minimal-sample.jsonld +${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity @@ -14,13 +16,13 @@ Create one valid entity and one invalid entity [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity building-minimal-sample.jsonld ${entity_id} + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 - + #creating entity with the same id - Create Entity building-minimal-sample.jsonld ${entity_id} + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 409 Check Response Body Details Containing Information Error ${expected_error_message} [Teardown] Delete Entity by Id ${entity_id} + diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 01d6d9f4..ef14f4ef 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -91,7 +91,6 @@ Create Entity ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request Output response - Set Test Variable ${response} Batch Create Entities [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} -- GitLab From ff84262fd746485329bcaaca1595ef9f526af297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patr=C3=ADcia=20Oliveira?= Date: Wed, 23 Dec 2020 11:37:58 +0000 Subject: [PATCH 066/442] remove unused files and lines --- .../Provision/Entities/CreateEntity/001.robot | 10 ++-- .../Provision/Entities/CreateEntity/002.robot | 4 +- .../Entities/CreateEntity/AlreadyExists.robot | 50 ------------------- .../SuccessCases-datadriven.robot | 41 --------------- .../Entities/CreateEntity/SuccessCases.robot | 44 ---------------- resources/ApiUtils.resource | 4 -- resources/variables.py | 1 + 7 files changed, 8 insertions(+), 146 deletions(-) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot index d64edec0..9ce9d5cf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -10,11 +10,11 @@ Test Template Create Entity Scenarios ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME CONTENT_TYPE -MinimalEntity building-minimal-without-context-sample.jsonld application/json -EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -#EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json -EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json +001_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json +001_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json +001_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json +#001_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json +001_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot index 3a46d47d..8885ef5d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE EXPECTED_CODE -InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 406 -EmptyJson empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 400 +002_01_InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 406 +002_02_EmptyJson empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 400 *** Keywords *** Create Entity With Invalid Request Scenarios diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot deleted file mode 100644 index ef8a8050..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot +++ /dev/null @@ -1,50 +0,0 @@ -*** Settings *** -Documentation Check that the IUT refuses to create an entity if one exists with the same identifier -Variables ../../../../../../resources/variables.py -#Resource ../../../../../../resources/ApiUtils.resource -Library REST ${url} -Library JSONSchemaLibrary ${EXECDIR}/schemas -Library BuiltIn - -#Suite Setup Create Entity building-minimal.jsonld -#Suite Teardown Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Variable *** -${endpoint}= entities - -*** Test Case *** -AlreadyExists - [Documentation] Check that the IUT refuses to create an entity if one exists with the same identifier - [Tags] mandatory - Create Entity building-minimal.jsonld - Create Entity building-minimal.jsonld - Check HTTP Status Code Is 409 - Check HTTP Response Body Json Schema Is error_response - Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Keywords *** -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json - ${schema}= Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot deleted file mode 100644 index d4a31dd4..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot +++ /dev/null @@ -1,41 +0,0 @@ -*** Settings *** -Documentation Check that the IUT accepts the creation of an entity -Variables ../../../../../../resources/variables.py -Library REST ${url} -Library JSONSchemaLibrary ${EXECDIR}/schemas - -Test Template Create Entity Scenarios - -*** Variable *** -${endpoint}= entities -${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Test Cases *** FILENAME -SuccessCases_MinimalEntity building-minimal.jsonld -SuccessCases_EntityWithSimpleProperties building-simple-attributes.jsonld - -*** Keywords *** -Create Entity Scenarios - [Arguments] ${filename} - Create Entity ${filename} - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot deleted file mode 100644 index 47474e20..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +++ /dev/null @@ -1,44 +0,0 @@ -*** Settings *** -Documentation Check that the IUT accepts the creation of an entity -Variables ../../../../../../resources/variables.py -#Resource ../../../../../../resources/ApiUtils.resource -Library REST ${url} - -*** Variable *** -${endpoint}= entities -${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Test Case *** -SuccessCases_MinimalEntity - [Documentation] Create an entity with a JSON-LD payload containing the minimal information - [Tags] mandatory - Create Entity building-minimal.jsonld - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - -SuccessCases_EntityWithSimpleProperties - [Documentation] Create an entity with a JSON-LD payload containing only simple properties - Create Entity building-simple-attributes.jsonld - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - - -*** Keywords *** -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 246b3159..9bd4b663 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -13,16 +13,13 @@ ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities/ -#${ENTITIES_ENDPOINT_PATH} entities original ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json -#${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData original ${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData -#${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest original ${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest ${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound @@ -55,7 +52,6 @@ Api DEL request Delete Entity by Id [Arguments] ${id} - #${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} original ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} Output request Output response diff --git a/resources/variables.py b/resources/variables.py index 881e64b3..88e1f536 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -4,3 +4,4 @@ def get_variables(arg=None): 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld' } return variables + \ No newline at end of file -- GitLab From 91bc389c09cdda616886afb2f9b90739a5a94b18 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 23 Dec 2020 18:18:07 +0000 Subject: [PATCH 067/442] merge with develop branch --- .../Provision/Entities/CreateEntity/001.robot | 33 ++++++++++++ .../Provision/Entities/CreateEntity/002.robot | 22 ++++++++ .../Provision/Entities/CreateEntity/003.robot | 28 +++++++++++ .../Entities/CreateEntity/AlreadyExists.robot | 50 ------------------- .../SuccessCases-datadriven.robot | 41 --------------- .../Entities/CreateEntity/SuccessCases.robot | 44 ---------------- .../Provision/Entities/DeleteEntity/004.robot | 27 ++++++++++ .../Provision/Entities/testAPI.http | 35 +++++++++++++ resources/ApiUtils.resource | 7 +++ 9 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot new file mode 100644 index 00000000..9ce9d5cf --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can create an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Entity Scenarios + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json +001_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json +001_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json +#001_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json +001_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json + + + +*** Keywords *** +Create Entity Scenarios + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create an entity + [Tags] mandatory entityOperations + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']} ${entity_id} + + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot new file mode 100644 index 00000000..8885ef5d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot create an entity with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Entity With Invalid Request Scenarios + +*** Test Cases *** FILENAME PROBLEM_TYPE EXPECTED_CODE +002_01_InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 406 +002_02_EmptyJson empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 400 + +*** Keywords *** +Create Entity With Invalid Request Scenarios + [Arguments] ${filename} ${problem_type} ${expected_code} + [Documentation] Check that you cannot create an entity with an invalid request + [Tags] mandatory + + Request Entity From File ${filename} + + Check RL Response Status Code Set To Expected Code ${expected_code} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot new file mode 100644 index 00000000..973171d8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you cannot create an entity with and existing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${expected_error_message}= Already exists. +${filename}= building-minimal-sample.jsonld +${content_type}= application/ld+json + +*** Test Case *** +Create one valid entity and one invalid entity + [Documentation] Check that you cannot create an entity with and existing id + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code Set To 201 + + #creating entity with the same id + Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code Set To 409 + Check Response Body Details Containing Information Error ${expected_error_message} + + [Teardown] Delete Entity by Id ${entity_id} + diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot deleted file mode 100644 index ef8a8050..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot +++ /dev/null @@ -1,50 +0,0 @@ -*** Settings *** -Documentation Check that the IUT refuses to create an entity if one exists with the same identifier -Variables ../../../../../../resources/variables.py -#Resource ../../../../../../resources/ApiUtils.resource -Library REST ${url} -Library JSONSchemaLibrary ${EXECDIR}/schemas -Library BuiltIn - -#Suite Setup Create Entity building-minimal.jsonld -#Suite Teardown Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Variable *** -${endpoint}= entities - -*** Test Case *** -AlreadyExists - [Documentation] Check that the IUT refuses to create an entity if one exists with the same identifier - [Tags] mandatory - Create Entity building-minimal.jsonld - Create Entity building-minimal.jsonld - Check HTTP Status Code Is 409 - Check HTTP Response Body Json Schema Is error_response - Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Keywords *** -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json - ${schema}= Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot deleted file mode 100644 index d4a31dd4..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot +++ /dev/null @@ -1,41 +0,0 @@ -*** Settings *** -Documentation Check that the IUT accepts the creation of an entity -Variables ../../../../../../resources/variables.py -Library REST ${url} -Library JSONSchemaLibrary ${EXECDIR}/schemas - -Test Template Create Entity Scenarios - -*** Variable *** -${endpoint}= entities -${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Test Cases *** FILENAME -SuccessCases_MinimalEntity building-minimal.jsonld -SuccessCases_EntityWithSimpleProperties building-simple-attributes.jsonld - -*** Keywords *** -Create Entity Scenarios - [Arguments] ${filename} - Create Entity ${filename} - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot deleted file mode 100644 index 47474e20..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot +++ /dev/null @@ -1,44 +0,0 @@ -*** Settings *** -Documentation Check that the IUT accepts the creation of an entity -Variables ../../../../../../resources/variables.py -#Resource ../../../../../../resources/ApiUtils.resource -Library REST ${url} - -*** Variable *** -${endpoint}= entities -${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 - -*** Test Case *** -SuccessCases_MinimalEntity - [Documentation] Create an entity with a JSON-LD payload containing the minimal information - [Tags] mandatory - Create Entity building-minimal.jsonld - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - -SuccessCases_EntityWithSimpleProperties - [Documentation] Create an entity with a JSON-LD payload containing only simple properties - Create Entity building-simple-attributes.jsonld - Check HTTP Status Code Is 201 - Delete Entity by Id ${id} - - -*** Keywords *** -Create Entity - [Arguments] ${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Check HTTP Status Code Is - [Arguments] ${status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${status} - -Delete Entity by Id - [Arguments] ${id} - ${response}= DELETE ${endpoint}/${id} - Output request - Output response diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot new file mode 100644 index 00000000..39812bd9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you can delete an entity by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +#Suite Setup Setup Initial Entity + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Delete an entity + [Documentation] Check that you can delete an entity by id + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + + ${response}= Delete Entity by Id Returning Response ${entity_id} + Should Be Equal 204 ${response['status']} + +#*** Keywords *** +#Setup Initial Entity +# ${entity_id}= Generate Random Entity Id ${building_id_prefix} +# Create Entity building-simple-attributes-sample.jsonld ${entity_id} +# Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http b/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http new file mode 100644 index 00000000..dd7fb4e4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http @@ -0,0 +1,35 @@ +POST http://localhost:9090/ngsi-ld/v1/entities/ +Content-Type: application/ld+json + +{ + "id": "urn:ngsi-ld:Building:0163037144675563", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} + +### +DELETE http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Building:0163037144675563 + +### + +POST http://localhost:9090/ngsi-ld/v1/entities/ +Content-Type: application/ld+json + +{ + "id": "urn:ngsi-ld:Building:0163037144675563",, + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} + +### +POST http://localhost:9090/ngsi-ld/v1/entities/ +Content-Type: application/ld+json + +{ +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 50407fe7..b7317b08 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -50,6 +50,13 @@ Api DEL request Output Schema Set Test Variable ${response} +Delete Entity by Id Returning Response + [Arguments] ${id} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} + Output request + Output response + [return] ${response} + Delete Entity by Id [Arguments] ${id} ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} -- GitLab From 1bb9964d51e733b62473d6b0b35e2979b43aaa19 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 28 Dec 2020 15:23:14 +0000 Subject: [PATCH 068/442] added /provision/entities/deleteEntity/*.robot and refactores some keywords and previous tests --- .../Provision/Entities/CreateEntity/001.robot | 6 ++-- .../Provision/Entities/CreateEntity/003.robot | 11 +++--- .../Provision/Entities/DeleteEntity/004.robot | 15 +++----- .../Provision/Entities/DeleteEntity/005.robot | 28 +++++++++++++++ .../Provision/Entities/DeleteEntity/006.robot | 21 +++++++++++ .../Provision/Entities/testAPI.http | 35 ------------------- resources/ApiUtils.resource | 8 ++--- resources/AssertionUtils.resource | 8 +++-- resources/variables.py | 2 +- 9 files changed, 73 insertions(+), 61 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot index 9ce9d5cf..721c3d99 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -26,8 +26,8 @@ Create Entity Scenarios ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']} ${entity_id} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot index 973171d8..bf0050cc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -16,13 +16,14 @@ Create one valid entity and one invalid entity [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code Set To 201 + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 201 ${response['status']} #creating entity with the same id - Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code Set To 409 - Check Response Body Details Containing Information Error ${expected_error_message} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot index 39812bd9..ca6c0422 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot @@ -4,24 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -#Suite Setup Setup Initial Entity - *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** -Delete an entity +004_Delete an entity [Documentation] Check that you can delete an entity by id [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + Check Response Status Code 201 ${response['status']} ${response}= Delete Entity by Id Returning Response ${entity_id} - Should Be Equal 204 ${response['status']} - -#*** Keywords *** -#Setup Initial Entity -# ${entity_id}= Generate Random Entity Id ${building_id_prefix} -# Create Entity building-simple-attributes-sample.jsonld ${entity_id} -# Set Suite Variable ${entity_id} + Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot new file mode 100644 index 00000000..1e23d929 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you cannot delete an entity with invalid/missing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Entity Scenarios + +*** Variable *** +${entity_id_empty}= +${entity_id_not_valid}= thisisaninvaliduri + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +005_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +005_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + + + +*** Keywords *** +Delete Entity Scenarios + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} + [Documentation] Check that you cannot delete an entity with invalid/missing id + [Tags] mandatory failing + + ${response}= Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot new file mode 100644 index 00000000..b71875cf --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that you cannot delete an entity if the entity id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${expected_status_code}= 404 + +*** Test Case *** +006_Delete an entity with an id not known to the system + [Documentation] Check that you cannot delete an entity if the entity id is not known to the system + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + ${response}= Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http b/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http deleted file mode 100644 index dd7fb4e4..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/testAPI.http +++ /dev/null @@ -1,35 +0,0 @@ -POST http://localhost:9090/ngsi-ld/v1/entities/ -Content-Type: application/ld+json - -{ - "id": "urn:ngsi-ld:Building:0163037144675563", - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] -} - -### -DELETE http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Building:0163037144675563 - -### - -POST http://localhost:9090/ngsi-ld/v1/entities/ -Content-Type: application/ld+json - -{ - "id": "urn:ngsi-ld:Building:0163037144675563",, - "type": "Building", - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] -} - -### -POST http://localhost:9090/ngsi-ld/v1/entities/ -Content-Type: application/ld+json - -{ -} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 2341bac4..cf0f717f 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -21,7 +21,8 @@ ${CONTENT_TYPE_LD_JSON} application/ld+json ${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData ${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists ${response} @@ -52,7 +53,7 @@ Api DEL request Delete Entity by Id Returning Response [Arguments] ${id} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}/${id} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} Output request Output response [return] ${response} @@ -82,9 +83,8 @@ Create Entity Selecting Content Type ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request Output response - Set Test Variable ${response} ${request}= Output request - Set Test Variable ${request} + [return] ${request} ${response} Create Entity [Arguments] ${filename} ${entity_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 52d19507..a648ed4e 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -5,6 +5,11 @@ Library ${EXECDIR}/libraries/assertionUtils.py ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] *** Keywords *** +Check Response Status Code + [Arguments] ${expected_status_code} ${response_status_code} + ${response_status_code}= convert to string ${response_status_code} + Should Be Equal ${expected_status_code} ${response_status_code} + Check Response Status Code Set To [Arguments] ${expected_status} ${response_status}= convert to string ${response['status']} @@ -23,8 +28,7 @@ Check Response Body Containing Array Of URIs set to Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True Check Response Headers Containing URI set to -# upon success, the http response shall include a loication http header that countains the uri of the created entity resource - [Arguments] ${expected_path} ${expected_entity_id} + [Arguments] ${expected_path} ${expected_entity_id} ${response} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True Check Response Body Containing an Attribute set to diff --git a/resources/variables.py b/resources/variables.py index 88e1f536..3b9e617a 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,6 +1,6 @@ def get_variables(arg=None): variables = { - 'url': 'http://localhost:9090/ngsi-ld/v1', + 'url': 'https://broker-ngsi-ld.demeter.ubiwhere.com/ngsi-ld/v1', 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld' } return variables -- GitLab From 39115c9b9467eb9a24250b71d20fcd48fbc8d76e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Dec 2020 18:26:58 +0000 Subject: [PATCH 069/442] Added consumption/entity/001.robot --- .../Consumption/Entity/001.robot | 22 +++++++++++++++++++ resources/ApiUtils.resource | 12 +++++++++- resources/AssertionUtils.resource | 0 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot mode change 100644 => 100755 resources/ApiUtils.resource mode change 100644 => 100755 resources/AssertionUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot new file mode 100644 index 00000000..a23c0809 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you can get an entity by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** +001_01_Check that you can get an entity by id + [Documentation] Check that you can get an entity by id + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + Check Response Status Code 201 ${response['status']} + + ${response}= Retrieve Entity by Id Returning Response ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 200 ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource old mode 100644 new mode 100755 index cf0f717f..627d9725 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -64,12 +64,22 @@ Delete Entity by Id Output request Output response +Retrieve Entity by Id Returning Response + [Arguments] ${id} ${accept} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} + Output request + Output response + [return] ${response} + Retrieve Entity by Id [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${ENTITIES_ENDPOINT_PATH}/${id} headers=${headers} + ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} Output request Output response Set Test Variable ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource old mode 100644 new mode 100755 -- GitLab From 074a55054991fa7a020001a381cc86c94e2c8501 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Dec 2020 18:27:29 +0000 Subject: [PATCH 070/442] Added consumption/entity/001_01.robot --- .../Consumption/Entity/{001.robot => 001_01.robot} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{001.robot => 001_01.robot} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/001.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot -- GitLab From c251b3cd7e5c49c56a873be7eead09acc48e92aa Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Dec 2020 16:17:45 +0000 Subject: [PATCH 071/442] added Consumption/Entity/001_02.robot --- .../Consumption/Entity/001_01.robot | 7 +++-- .../Consumption/Entity/001_02.robot | 28 +++++++++++++++++++ ...sample-expectation-query-attributes.jsonld | 17 +++++++++++ ...imple-attributes-sample-expectation.jsonld | 25 +++++++++++++++++ resources/ApiUtils.resource | 20 ++++++++++--- resources/AssertionUtils.resource | 7 +++++ 6 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot create mode 100644 data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld create mode 100644 data/entities/expectations/building-simple-attributes-sample-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot index a23c0809..b7dd8c46 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot @@ -6,17 +6,20 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation.jsonld *** Test Cases *** -001_01_Check that you can get an entity by id +001_01_Get an entity by id [Documentation] Check that you can get an entity by id [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Retrieve Entity by Id Returning Response ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot new file mode 100644 index 00000000..59040930 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you can query some attributes from entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation-query-attributes.jsonld +${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel +${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory + +*** Test Cases *** +001_02_Query some attributes from an entity + [Documentation] Check that you can query some attributes from entity + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld new file mode 100644 index 00000000..d562f978 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:Building:7123416795055774", + "type": "https://uri.fiware.org/ns/data-models#Building", + "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld new file mode 100644 index 00000000..c7155bd9 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld @@ -0,0 +1,25 @@ +{ + "id": "urn:ngsi-ld:Building:6539860708584325", + "type": "https://uri.fiware.org/ns/data-models#Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://uri.fiware.org/ns/data-models#almostFull": { + "type": "Property", + "value": false + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 627d9725..e289966b 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -68,12 +68,26 @@ Retrieve Entity by Id Returning Response [Arguments] ${id} ${accept} ${context}=${EMPTY} ${headers}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} Output request Output response [return] ${response} +Query Entity + [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} + ${attrs_length} = Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + + ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + Retrieve Entity by Id [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary @@ -88,12 +102,10 @@ Create Entity Selecting Content Type [Arguments] ${filename} ${entity_id} ${content_type} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=${content_type} ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - Output request - Output response ${request}= Output request + Output response [return] ${request} ${response} Create Entity diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index a648ed4e..c8b87ba5 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -55,6 +55,13 @@ Check Response Body Containing Batch Operation Result Should Not Be Empty ${response_error['error']} END +Check Response Body Containing Entity element + [Arguments] ${expectation_filename} ${entity_id} ${response} + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=Entity Comparaison Failed + Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} -- GitLab From d970d01be69ce395d7af4cc9e15c1efa63f3bfa3 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Dec 2020 17:31:29 +0000 Subject: [PATCH 072/442] added Consumption/Entity/001_03.robot --- .../Consumption/Entity/001_01.robot | 2 +- .../Consumption/Entity/001_02.robot | 4 +-- .../Consumption/Entity/001_03.robot | 26 +++++++++++++++++++ .../building-location-attribute-sample.jsonld | 23 ++++++++++++++++ ...ample-expectation-query-geoproperty.jsonld | 25 ++++++++++++++++++ resources/ApiUtils.resource | 14 ++-------- 6 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot create mode 100644 data/entities/building-location-attribute-sample.jsonld create mode 100644 data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot index b7dd8c46..838e8cd9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot @@ -18,7 +18,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Retrieve Entity by Id Returning Response ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot index 59040930..4891b22d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can query some attributes from entity +Documentation Check that you can query some attributes from an entity Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -13,7 +13,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** 001_02_Query some attributes from an entity - [Documentation] Check that you can query some attributes from entity + [Documentation] Check that you can query some attributes from an entity [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot new file mode 100644 index 00000000..37242fe9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you can query the geometry property from an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld +${geometry_property}= location + +*** Test Cases *** +001_03_Query the geometry property from an entity + [Documentation] Check that you can query the geometry property from an entity + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld new file mode 100644 index 00000000..ffb69e92 --- /dev/null +++ b/data/entities/building-location-attribute-sample.jsonld @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld new file mode 100644 index 00000000..823747da --- /dev/null +++ b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld @@ -0,0 +1,25 @@ +{ + "id": "urn:ngsi-ld:Building:9630352980062352", + "type": "https://uri.fiware.org/ns/data-models#Building", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + }, + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e289966b..24d00fd7 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -64,25 +64,15 @@ Delete Entity by Id Output request Output response -Retrieve Entity by Id Returning Response - [Arguments] ${id} ${accept} ${context}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} - ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} - Output request - Output response - [return] ${response} - Query Entity - [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} + [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary &{params}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} Output request Output response -- GitLab From 1b6d8d2abf2afb3e85ff6fbf2609952b9b0eaea1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Dec 2020 17:54:10 +0000 Subject: [PATCH 073/442] added Consumption/Entity/001_03.robot --- .../Consumption/Entity/002.robot | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot new file mode 100644 index 00000000..86fbbe3a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you cannot get an entity with invalid/missing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Get Entity With Invalid/Missing Id + +*** Variable *** +${entity_id_empty}= +${entity_id_not_valid}= thisisaninvaliduri + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +002_01_Get an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_Get an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + +*** Keywords *** +Get Entity With Invalid/Missing Id + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} + [Documentation] Check that you cannot get an entity with invalid/missing id + [Tags] mandatory failing + + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file -- GitLab From f8f65d09ff4a8bf8d6a5c611d3299dd9d7ee1e90 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Dec 2020 11:30:47 +0000 Subject: [PATCH 074/442] added Consumption/Entity/003_01.robot Consumption/Entity/003_02.robot --- .../Consumption/Entity/003_01.robot | 19 +++++++++++++ .../Consumption/Entity/003_02.robot | 27 +++++++++++++++++++ .../Provision/Entities/CreateEntity/003.robot | 1 - 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot new file mode 100644 index 00000000..59647fef --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Check that you cannot get an entity if the entity id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** +003_01_Get an entity if the Entity Id is not known to the system + [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot new file mode 100644 index 00000000..fd207890 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you cannot get an entity if an attribute is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${attribute_not_known}= property_not_found + +*** Test Cases *** +003_02_Get an entity if an atris not known to the system + [Documentation] Check that you cannot get an entity if an attribute is not known to the system + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${attributes_to_be_retrieved}= Create List ${attribute_not_known} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot index bf0050cc..1357d60d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -6,7 +6,6 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${expected_error_message}= Already exists. ${filename}= building-minimal-sample.jsonld ${content_type}= application/ld+json -- GitLab From d2c337617b7a51aa4d62c29827ec595e005ce5da Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Dec 2020 12:05:54 +0000 Subject: [PATCH 075/442] added Consumption/Entity/004.robot --- .../Consumption/Entity/004.robot | 26 +++++++++++++++++++ ...butes-sample-expectation-simplified.jsonld | 11 ++++++++ resources/ApiUtils.resource | 4 ++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot create mode 100644 data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot new file mode 100644 index 00000000..f2b166f6 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that the queried entity by Id can be returned in a simplified representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${options_parameter}= keyValues + +*** Test Cases *** +004 Get an entity in a simplified representation + [Documentation] Check that the queried entity by Id can be returned in a simplified representation + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld new file mode 100644 index 00000000..8fc30e37 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:4982132550789476", + "type": "https://uri.fiware.org/ns/data-models#Building", + "name": "Eiffel Tower", + "https://uri.fiware.org/ns/data-models#airQualityLevel": 4, + "https://uri.fiware.org/ns/data-models#almostFull": false, + "https://uri.fiware.org/ns/data-models#subCategory": "tourism", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 24d00fd7..b2e80977 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -65,14 +65,16 @@ Delete Entity by Id Output response Query Entity - [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} + [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${attrs_length} = Get Length ${attrs} + ${options_length} = Get Length ${options} &{headers}= Create Dictionary &{params}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} Output request Output response -- GitLab From 11382112ff91445249da1bef2889afe8e938cc4d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Dec 2020 12:14:56 +0000 Subject: [PATCH 076/442] changed keyword name --- TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot | 2 +- TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot | 2 +- resources/ApiUtils.resource | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot index 838e8cd9..40abb19c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot @@ -18,7 +18,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot index 4891b22d..b1f294cf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot @@ -21,7 +21,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot index 37242fe9..8653944f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot @@ -19,7 +19,7 @@ ${geometry_property}= location ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot index 86fbbe3a..03c8211d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot @@ -19,7 +19,7 @@ Get Entity With Invalid/Missing Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] mandatory failing - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot index 59647fef..c1639589 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot @@ -13,7 +13,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: [Tags] mandatory failing ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot index fd207890..50e5d4d0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot @@ -19,7 +19,7 @@ ${attribute_not_known}= property_not_found Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_not_known} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot index f2b166f6..260e13a2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot @@ -19,7 +19,7 @@ ${options_parameter}= keyValues ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index b2e80977..5a43fb7a 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -64,7 +64,7 @@ Delete Entity by Id Output request Output response -Query Entity +Get Entity [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} -- GitLab From dc15b4c7c7362cbf9ad1b4299e083dfaa7a4808e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 Jan 2021 19:45:35 +0000 Subject: [PATCH 077/442] added various query entities suites --- .../Consumption/Entity/001_01.robot | 4 +- .../Consumption/Entity/001_02.robot | 4 +- .../Consumption/Entity/001_03.robot | 6 +-- .../Consumption/Entity/002.robot | 2 +- .../Consumption/Entity/003_01.robot | 2 +- .../Consumption/Entity/003_02.robot | 2 +- .../Consumption/Entity/004.robot | 4 +- .../Consumption/Entity/005.robot | 27 +++++++++++ .../Consumption/Entity/006_01.robot | 42 +++++++++++++++++ .../Consumption/Entity/006_02.robot | 43 ++++++++++++++++++ .../Consumption/Entity/006_03.robot | 39 ++++++++++++++++ .../Consumption/Entity/006_04.robot | 40 +++++++++++++++++ .../Consumption/Entity/006_05.robot | 39 ++++++++++++++++ .../Consumption/Entity/007_01.robot | 42 +++++++++++++++++ .../Consumption/Entity/007_02.robot | 43 ++++++++++++++++++ .../Consumption/Entity/007_03.robot | 39 ++++++++++++++++ .../Consumption/Entity/007_04.robot | 40 +++++++++++++++++ .../Consumption/Entity/007_05.robot | 39 ++++++++++++++++ .../Consumption/Entity/008_01.robot | 40 +++++++++++++++++ .../Consumption/Entity/008_02.robot | 41 +++++++++++++++++ .../Consumption/Entity/008_03.robot | 38 ++++++++++++++++ .../Consumption/Entity/008_04.robot | 40 +++++++++++++++++ .../Consumption/Entity/008_05.robot | 38 ++++++++++++++++ ...cation-attribute-sample-expectation.jsonld | 22 +++++++++ ...building-minimal-sample-expectation.jsonld | 7 +++ ...building-vehicle-sample-expectation.jsonld | 0 .../vehicle-simple-attributes-sample.jsonld | 21 +++++++++ resources/ApiUtils.resource | 45 ++++++++++++++++++- resources/AssertionUtils.resource | 12 ++++- 29 files changed, 746 insertions(+), 15 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot create mode 100644 data/entities/expectations/building-location-attribute-sample-expectation.jsonld create mode 100644 data/entities/expectations/building-minimal-sample-expectation.jsonld create mode 100644 data/entities/expectations/building-vehicle-sample-expectation.jsonld create mode 100644 data/entities/vehicle-simple-attributes-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot index 40abb19c..f6aeac9c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot @@ -18,8 +18,8 @@ ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot index b1f294cf..8b97f073 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot @@ -21,8 +21,8 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot index 8653944f..f7a6bd76 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld -${geometry_property}= location +${geometry_property}= test *** Test Cases *** 001_03_Query the geometry property from an entity @@ -19,8 +19,8 @@ ${geometry_property}= location ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot index 03c8211d..86fbbe3a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot @@ -19,7 +19,7 @@ Get Entity With Invalid/Missing Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] mandatory failing - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot index c1639589..59647fef 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot @@ -13,7 +13,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: [Tags] mandatory failing ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot index 50e5d4d0..fd207890 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot @@ -19,7 +19,7 @@ ${attribute_not_known}= property_not_found Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_not_known} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot index 260e13a2..d575056c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot @@ -11,7 +11,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation-simplifi ${options_parameter}= keyValues *** Test Cases *** -004 Get an entity in a simplified representation +004_Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] mandatory failing @@ -19,7 +19,7 @@ ${options_parameter}= keyValues ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot new file mode 100644 index 00000000..689763fd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that the queried entity by id can be returned in a geoJSON format +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${options_parameter}= keyValues +${accept_header}= application/geo+json + +*** Test Cases *** +005_Get an entity by id that can be returned in a geoJSON format + [Documentation] Check that the queried entity by id can be returned in a geoJSON format + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} + Check Response Status Code 200 ${response['status']} + #Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot new file mode 100644 index 00000000..999bd051 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you can query several entities based on ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building + +*** Test Cases *** +006_01_Query several entities based on ids + [Documentation] Check that you can query several entities based on ids + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot new file mode 100644 index 00000000..5be714fb --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you can query several entities based on the entities types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${expection_filename}= building-vehicle-sample-expectation.jsonld +${building_entity_type}= https://uri.fiware.org/ns/data-models#Building +${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle + + +*** Test Cases *** +006_02_Query several entities based on the entities types + [Documentation] Check that you can query several entities based on the entities types + [Tags] mandatory failing + + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + #@{entity_types_to_be_retrieved}= Create List ${building_entity_type} ${vehicle_entity_type} + @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} + ##Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${building_entity_id} ${vehicle_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot new file mode 100644 index 00000000..733d8cb5 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can query several entities based on the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + +*** Test Cases *** +006_03_Query several entities based on the given id pattern + [Documentation] Check that you can query several entities based on the given id pattern + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot new file mode 100644 index 00000000..ebb41814 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query several entities based on attribute names +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel +${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory + +*** Test Cases *** +006_04_Query several entities based on attribute names + [Documentation] Check that you can query several entities based on attribute names + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot new file mode 100644 index 00000000..2a3819e2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can query entitites based on a list of properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${geometry_property}= location + +*** Test Cases *** +006_05_Query several entities based on a list of properties + [Documentation] Check that you can query entitites based on a list of properties + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + Check Response Status Code 200 ${response['status']} + #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot new file mode 100644 index 00000000..38f11503 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you can query several entities via POST Interaction based on ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building + +*** Test Cases *** +007_01_Query several entities via POST Interaction based on ids + [Documentation] Check that you can query several entities via POST Interaction based on ids + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot new file mode 100644 index 00000000..9290b154 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you can query several entities via POST Interaction based on the entities types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${expection_filename}= building-vehicle-sample-expectation.jsonld +${building_entity_type}= https://uri.fiware.org/ns/data-models#Building +${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle + + +*** Test Cases *** +007_02_Query several entities via POST Interaction based on the entities types + [Documentation] Check that you can query several entities via POST Interaction based on the entities types + [Tags] mandatory failing + + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + #@{entity_types_to_be_retrieved}= Create List ${building_entity_type} ${vehicle_entity_type} + @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} + ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} + ##Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${building_entity_id} ${vehicle_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot new file mode 100644 index 00000000..9b2c7832 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can query several entities via POST Interaction based on the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + +*** Test Cases *** +007_03_Query several entities via POST Interaction based on the given id pattern + [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot new file mode 100644 index 00000000..5c18ad20 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query several entities via POST Interaction based on attribute names +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel +${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory + +*** Test Cases *** +006_04_Query several entities via POST Interaction based on attribute names + [Documentation] Check that you can query several entities via POST Interaction based on attribute names + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot new file mode 100644 index 00000000..542beab6 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can query entitites via POST Interaction based on a list of properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expection_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${geometry_property}= location + +*** Test Cases *** +006_05_Query several entities via POST Interaction based on a list of properties + [Documentation] Check that you can query entitites via POST Interaction based on a list of properties + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + Check Response Status Code 200 ${response['status']} + #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot new file mode 100644 index 00000000..569d2723 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you cannot query entities if the requested ids are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_invalid_id_one}= thisisaninvaliduri1 +${entity_invalid_id_two}= thisisaninvaliduri2 + +*** Test Cases *** +008_01_Query entities based on incorrect ids + [Documentation] Check that you cannot query entities if the requested ids are incorrect + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${entity_invalid_id_one} ${entity_invalid_id_two} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot new file mode 100644 index 00000000..c598a04d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you cannot query entities if the requested entity types are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${invalid_entity_type_one}= invalid_entity_type_one +${invalid_entity_type_two}= invalid_entity_type_two + + +*** Test Cases *** +008_02_Query entities based on incorrect entity types + [Documentation] Check that you cannot query entities if the requested entity types are incorrect + [Tags] mandatory failing + + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entity_types_to_be_retrieved}= Create List ${invalid_entity_type_one} ${invalid_entity_type_two} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${building_entity_id} ${vehicle_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot new file mode 100644 index 00000000..999e6a45 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you cannot query entities if the requested id pattern is incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${invalid_entity_id_pattern}= invalid_entity_id_pattern* + +*** Test Cases *** +008_03_Query several entities based on incorrect id pattern + [Documentation] Check that you cannot query entities if the requested id pattern is incorrect + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_id_pattern=${invalid_entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot new file mode 100644 index 00000000..86368ca9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you cannot query entities if the requested attribute names are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${invalid_attribute_one}= invalid_attribute_one +${invalid_attribute_two}= invalid_attribute_two + +*** Test Cases *** +008_04_Query several entities based on incorrect attribute names + [Documentation] Check that you cannot query entities if the requested attribute names are incorrect + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{attributes_to_be_retrieved}= Create List ${invalid_attribute_one} ${invalid_attribute_two} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot new file mode 100644 index 00000000..b29b3ffc --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can query entitites based on a list of properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${invalid_geometry_property}= invalid_geometry_property + +*** Test Cases *** +008_05_Query several entities based on a list of properties + [Documentation] Check that you can query entitites based on a list of properties + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${invalid_geometry_property} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/data/entities/expectations/building-location-attribute-sample-expectation.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation.jsonld new file mode 100644 index 00000000..8e67b86e --- /dev/null +++ b/data/entities/expectations/building-location-attribute-sample-expectation.jsonld @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://uri.fiware.org/ns/data-models#Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + } + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-sample-expectation.jsonld b/data/entities/expectations/building-minimal-sample-expectation.jsonld new file mode 100644 index 00000000..266cb229 --- /dev/null +++ b/data/entities/expectations/building-minimal-sample-expectation.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://uri.fiware.org/ns/data-models#Building", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/building-vehicle-sample-expectation.jsonld b/data/entities/expectations/building-vehicle-sample-expectation.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld new file mode 100644 index 00000000..2da4522d --- /dev/null +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5a43fb7a..3d6b1e94 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -13,6 +13,7 @@ ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities/ +${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations @@ -64,7 +65,7 @@ Delete Entity by Id Output request Output response -Get Entity +Query Entity [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} @@ -75,11 +76,53 @@ Get Entity Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} Output request Output response [return] ${response} +Query Entities + [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${CONTENT_TYPE_LD_JSON} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} + ${attrs_length} = Get Length ${attrs} + ${options_length} = Get Length ${options} + ${entity_ids_length} = Get Length ${entity_ids} + ${entity_types_length} = Get Length ${entity_types} + &{headers}= Create Dictionary + &{params}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} + Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + + ${response}= GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + +Query Entities Via POST + [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} ${attrs}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${geoproperty}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${entity_ids_length} = Get Length ${entity_ids} + ${entity_types_length} = Get Length ${entity_types} + ${attrs_length} = Get Length ${attrs} + Set To Dictionary ${headers} Content-Type ${content_type} + Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} + Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} query=${params} headers=${headers} + Output request + Output response + [return] ${response} + Retrieve Entity by Id [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c8b87ba5..1b7cf8ac 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -56,12 +56,20 @@ Check Response Body Containing Batch Operation Result END Check Response Body Containing Entity element - [Arguments] ${expectation_filename} ${entity_id} ${response} + [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity} ${instance_id_regex_expr} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=Entity Comparaison Failed +Check Response Body Containing List Containing Entity Elements + [Arguments] ${expectation_filename} ${entities_ids} ${response_body} + ${index}= Set Variable 0 + FOR ${entity_id} IN @{entities_ids} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response_body[${index}]} + ${index}= Evaluate ${index} + 1 + END + Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} -- GitLab From 17f34926935a03d94eff2501849e4f976bed93d8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 Jan 2021 15:26:42 +0000 Subject: [PATCH 078/442] added several test suites --- .../Consumption/Entity/001_03.robot | 2 +- .../Consumption/Entity/002.robot | 8 +--- .../Consumption/Entity/004.robot | 2 +- .../Consumption/Entity/005.robot | 2 +- .../Consumption/Entity/006_01.robot | 4 +- .../Consumption/Entity/006_02.robot | 22 ++++++---- .../Consumption/Entity/006_03.robot | 4 +- .../Consumption/Entity/006_04.robot | 4 +- .../Consumption/Entity/006_05.robot | 4 +- .../Consumption/Entity/007_01.robot | 4 +- .../Consumption/Entity/007_02.robot | 20 ++++++--- .../Consumption/Entity/007_03.robot | 4 +- .../Consumption/Entity/007_04.robot | 4 +- .../Consumption/Entity/007_05.robot | 4 +- .../Consumption/Entity/009.robot | 44 +++++++++++++++++++ .../Consumption/Entity/010.robot | 43 ++++++++++++++++++ .../Consumption/Entity/011.robot | 44 +++++++++++++++++++ ...ample-expectation-query-geoproperty.jsonld | 2 +- ...sample-expectation-query-attributes.jsonld | 2 +- ...butes-sample-expectation-simplified.jsonld | 2 +- ...imple-attributes-sample-expectation.jsonld | 2 +- ...vehicle-parking-sample-expectation.jsonld} | 0 .../parking-simple-attributes-sample.jsonld | 36 +++++++++++++++ 23 files changed, 219 insertions(+), 44 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot rename data/entities/expectations/{building-vehicle-sample-expectation.jsonld => vehicle-parking-sample-expectation.jsonld} (100%) create mode 100644 data/entities/parking-simple-attributes-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot index f7a6bd76..76f6b0ed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld -${geometry_property}= test +${geometry_property}= location *** Test Cases *** 001_03_Query the geometry property from an entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot index 86fbbe3a..282a9b00 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot @@ -5,13 +5,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Get Entity With Invalid/Missing Id -*** Variable *** -${entity_id_empty}= -${entity_id_not_valid}= thisisaninvaliduri - *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_01_Get an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -002_02_Get an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Get Entity With Invalid/Missing Id diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot index d575056c..b74f19dd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot @@ -21,6 +21,6 @@ ${options_parameter}= keyValues ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot index 689763fd..c81cc37a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot @@ -22,6 +22,6 @@ ${accept_header}= application/geo+json ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} Check Response Status Code 200 ${response['status']} - #Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot index 999bd051..441ef1eb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** @@ -29,7 +29,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot index 5be714fb..be7e684a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot @@ -7,11 +7,14 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${expection_filename}= building-vehicle-sample-expectation.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld +${expectation_filename}= vehicle-parking-sample-expectation.jsonld ${building_entity_type}= https://uri.fiware.org/ns/data-models#Building ${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle +${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** @@ -25,19 +28,22 @@ ${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} + ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} - #@{entity_types_to_be_retrieved}= Create List ${building_entity_type} ${vehicle_entity_type} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} + @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} - ##Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + @{entities_ids_to_be_retrieved}= Create List ${vehicle_entity_id} ${parking_entity_id} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} + [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id Returning Response ${parking_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot index 733d8cb5..7f1ef6db 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* @@ -27,7 +27,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot index ebb41814..18f59109 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @@ -28,7 +28,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot index 2a3819e2..f4c4ac63 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location @@ -27,7 +27,7 @@ ${geometry_property}= location @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot index 38f11503..b18df22b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** @@ -29,7 +29,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot index 9290b154..6f404862 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot @@ -7,11 +7,14 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${expection_filename}= building-vehicle-sample-expectation.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld +${expectation_filename}= vehicle-parking-sample-expectation.jsonld ${building_entity_type}= https://uri.fiware.org/ns/data-models#Building ${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle +${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** @@ -25,19 +28,22 @@ ${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} + ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} - #@{entity_types_to_be_retrieved}= Create List ${building_entity_type} ${vehicle_entity_type} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} + @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} - ##Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} + [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id Returning Response ${parking_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot index 9b2c7832..fa7d2d66 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* @@ -27,7 +27,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot index 5c18ad20..60e03dda 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @@ -28,7 +28,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot index 542beab6..60645100 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expection_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location @@ -27,7 +27,7 @@ ${geometry_property}= location @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - #Check Response Body Containing List Containing Entity elements ${expection_filename} ${entities_ids_to_be_retrieved} ${response['body']} + #Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot new file mode 100644 index 00000000..a5ec04bd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that the queried entities by Id can be returned in a simplified representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${options_parameter}= keyValues +${entity_type}= https://uri.fiware.org/ns/data-models#Building + +*** Test Cases *** +009_Query entities in a simplified representation + [Documentation] Check that the queried entities by Id can be returned in a simplified representation + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} options=${options_parameter} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot new file mode 100644 index 00000000..c9df1913 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that the queried entities by id can be returned in a geoJSON format +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${accept_header}= application/geo+json + +*** Test Cases *** +010_Get an entity by id that can be returned in a geoJSON format + [Documentation] Check that the queried entities by id can be returned in a geoJSON format + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot new file mode 100644 index 00000000..0c84970a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can query entities specifying a maximum number of results +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-sample-expectation.jsonld +${entity_type}= https://uri.fiware.org/ns/data-models#Building +${limit}= 2 + +*** Test Cases *** +011_Query entities specifying a maximum number of results + [Documentation] Check that you can query entities specifying a maximum number of results + [Tags] mandatory failing + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${third_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} + Check Response Status Code 200 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + + +*** Keywords *** +Delete Entities + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file diff --git a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld index 823747da..d023d039 100644 --- a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld +++ b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld @@ -1,5 +1,5 @@ { - "id": "urn:ngsi-ld:Building:9630352980062352", + "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://uri.fiware.org/ns/data-models#Building", "location": { "type": "GeoProperty", diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld index d562f978..7a2623f6 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld @@ -1,5 +1,5 @@ { - "id": "urn:ngsi-ld:Building:7123416795055774", + "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://uri.fiware.org/ns/data-models#Building", "https://uri.fiware.org/ns/data-models#airQualityLevel": { "type": "Property", diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld index 8fc30e37..e4abf08e 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld @@ -1,5 +1,5 @@ { - "id": "urn:ngsi-ld:Building:4982132550789476", + "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://uri.fiware.org/ns/data-models#Building", "name": "Eiffel Tower", "https://uri.fiware.org/ns/data-models#airQualityLevel": 4, diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld index c7155bd9..74d575bf 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld @@ -1,5 +1,5 @@ { - "id": "urn:ngsi-ld:Building:6539860708584325", + "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://uri.fiware.org/ns/data-models#Building", "name": { "type": "Property", diff --git a/data/entities/expectations/building-vehicle-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-vehicle-sample-expectation.jsonld rename to data/entities/expectations/vehicle-parking-sample-expectation.jsonld diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld new file mode 100644 index 00000000..841177ea --- /dev/null +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -0,0 +1,36 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:randomUUID", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown One" + }, + "availableSpotNumber": { + "type": "Property", + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "reliability": { + "type": "Property", + "value": 0.7 + }, + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + } + }, + "totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.5, 41.2] + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file -- GitLab From 4e1a37e3e5c94c5822131447cd1a6dd97426358e Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 5 Jan 2021 16:40:47 +0100 Subject: [PATCH 079/442] chore: minor upgrade of used frameworks and libraries --- README.md | 9 +++++++++ requirements.txt | 6 +++--- resources/ApiUtils.resource | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d09732ce..2fe03b68 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,15 @@ Launch the tests with the following command: For more running instructions please consult [scripts/run_tests.sh](https://github.com/easy-global-market/isg-cim-tpdl-demo/blob/rf-demo/scripts/run_tests.sh). +# Frameworks and libraries used in the project + +* [Robot Framework](https://github.com/robotframework/robotframework) +* [RESTinstance](https://github.com/asyrjasalo/RESTinstance) +* [JSON Schema Library](https://github.com/jstaffans/robotframework-jsonschemalibrary) +* [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary) +* [Requests Library](https://github.com/MarketSquare/robotframework-requests) +* [Deep Diff](https://github.com/seperman/deepdiff) + # Useful links * [Robot Framework User Guide](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#output-file) diff --git a/requirements.txt b/requirements.txt index c82d1681..a0b25556 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -robotframework==3.2.1 +robotframework==3.2.2 RESTinstance==1.0.2 robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.3.1 -robotframework-requests==0.7.0 -deepdiff==5.0.2 +robotframework-requests==0.8.0 +deepdiff==5.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index cf0f717f..b7f163a7 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -135,7 +135,7 @@ Request Entity From File ${file_content}= Get File ${EXECDIR}/data/entities/${filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST Request OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} + ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any Set Test Variable ${response} Batch Request Entities From File @@ -144,7 +144,7 @@ Batch Request Entities From File ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} Create Session BatchRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST Request BatchRequest ${endpoint_url} data=${file_content} headers=${headers} + ${response}= POST On Session BatchRequest ${endpoint_url} data=${file_content} headers=${headers} expected_status=any Set Test Variable ${response} Create Temporal Representation Of Entity -- GitLab From 189a568070adc4b7b9c900b5190e7e33f6844314 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 Jan 2021 15:52:24 +0000 Subject: [PATCH 080/442] added several test suites --- TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot index 60645100..a7ec401a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot @@ -27,7 +27,7 @@ ${geometry_property}= location @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - #Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} -- GitLab From 792a45ef12ba50f3e60b1a6637ef132352ddc4b1 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Jan 2021 12:46:32 +0000 Subject: [PATCH 081/442] added append attributes suites --- .../Provision/EntityAttributes/001.robot | 32 +++++++++++++++ .../Provision/EntityAttributes/002.robot | 33 ++++++++++++++++ .../Provision/EntityAttributes/002_03.robot | 26 +++++++++++++ ...ibutes-sample-append-expectation-01.jsonld | 39 +++++++++++++++++++ ...ibutes-sample-append-expectation-02.jsonld | 30 ++++++++++++++ ...tes-sample-append-expectation-03-04.jsonld | 30 ++++++++++++++ ...d-vehicle-fragment-datasetid-sample.jsonld | 19 +++++++++ ...cle-fragment-datasetid-sample-01-02.jsonld | 19 +++++++++ ...cle-fragment-datasetid-sample-03-04.jsonld | 19 +++++++++ ...vehicle-datasetid-attributes-sample.jsonld | 39 +++++++++++++++++++ resources/ApiUtils.resource | 20 +++++++++- resources/AssertionUtils.resource | 5 ++- 12 files changed, 307 insertions(+), 4 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot create mode 100644 data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld create mode 100644 data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld create mode 100644 data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld create mode 100644 data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld create mode 100644 data/entities/vehicle-datasetid-attributes-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot new file mode 100644 index 00000000..8a254372 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you can append entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Append Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE OVERWRITE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME +001_01_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-01-02.jsonld vehicle-attributes-sample-append-expectation-01.jsonld +001_02_Append entity attributes 207 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-01-02.jsonld vehicle-attributes-sample-append-expectation-02.jsonld +001_03_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-03-04.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +001_04_Append entity attributes 204 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-03-04.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld + +*** Keywords *** +Append Attributes + [Arguments] ${status_code} ${overwrite} ${filename} ${fragment_filename} ${expectation_filename} + [Documentation] Check that you can append entity attributes + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${overwrite} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot new file mode 100644 index 00000000..01733412 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Append Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld +${fragment_filename}= vehicle-fragment-datasetid-sample-01-02.jsonld + +*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID +002_01_Append entity attributes if the entity Id is not present 400 ${EMPTY} +002_02_Append entity attributes if the Entity Id is not a valid URI 400 thisisaninvaliduri + +*** Keywords *** +Append Attributes + [Arguments] ${status_code} ${entity_invalid_id} + [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot new file mode 100644 index 00000000..1b76af36 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot append entity attributes with invalid entity fragments +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld +${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld + +*** Test Cases *** +Append entity attributes with invalid entity fragments + [Documentation] Check that you cannot append entity attributes with invalid entity fragments + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code 400 ${response['status']} + #Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + #Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld new file mode 100644 index 00000000..60bd3de9 --- /dev/null +++ b/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld @@ -0,0 +1,39 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "BMW" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "speed": [{ + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld new file mode 100644 index 00000000..e29f4875 --- /dev/null +++ b/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld new file mode 100644 index 00000000..e29f4875 --- /dev/null +++ b/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld b/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld new file mode 100644 index 00000000..c4a970b3 --- /dev/null +++ b/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld @@ -0,0 +1,19 @@ +{ + "speed": { + "type": "Property",, + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2" + }, + "brandName": { + "type": "Property", + "value": "BMW" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld b/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld new file mode 100644 index 00000000..3bc23013 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld @@ -0,0 +1,19 @@ +{ + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2" + }, + "brandName": { + "type": "Property", + "value": "BMW" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld b/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld new file mode 100644 index 00000000..4aa9726c --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld @@ -0,0 +1,19 @@ +{ + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "brandName": { + "type": "Property", + "value": "BMW" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/vehicle-datasetid-attributes-sample.jsonld b/data/entities/vehicle-datasetid-attributes-sample.jsonld new file mode 100644 index 00000000..1654928a --- /dev/null +++ b/data/entities/vehicle-datasetid-attributes-sample.jsonld @@ -0,0 +1,39 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 4a2621c0..5856992a 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -118,7 +118,7 @@ Query Entities Via POST Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} query=${params} headers=${headers} + ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} query=${params} headers=${headers} Output request Output response [return] ${response} @@ -143,11 +143,27 @@ Create Entity Selecting Content Type Output response [return] ${request} ${response} +Append Entity Attributes + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Append Entity Attributes Using Session + [Arguments] ${id} ${filename} ${content_type} ${options} + ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any + Set Test Variable ${response} + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 1b7cf8ac..6db6f83a 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -98,12 +98,13 @@ Check Response Body Containing ProblemDetails Element Containing Title Element Check RL Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} - ${json_response_body}= To Json ${response.content} + ${json_response_body}= Set Variable ${response.json()} + Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} - ${json_response_body}= To Json ${response.content} + ${json_response_body}= Set Variable ${response.json()} Should Not Be Empty ${json_response_body['title']} Assert response status code -- GitLab From 9e4da6fe8366590267aa98b040401de28d93e36c Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 8 Jan 2021 19:46:06 +0000 Subject: [PATCH 082/442] added append attributes suites --- .../Provision/EntityAttributes/002_03.robot | 2 +- .../Provision/EntityAttributes/003.robot | 23 +++++++++++++++++++ resources/ApiUtils.resource | 5 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot index 1b76af36..e4598abe 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot @@ -19,7 +19,7 @@ Append entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response} #Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} #Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot new file mode 100644 index 00000000..49e3a993 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you cannot append entity attributes if the entity id or attributes are not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-fragment-datasetid-sample-01-02.jsonld + +*** Test Cases *** +003_Append entity attributes when the entity id is not known to the system + [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5856992a..6ead6b36 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -157,8 +157,9 @@ Append Entity Attributes Using Session ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs params=options=${options} data=${file_content} headers=${headers} expected_status=any + Output ${response.json()} + [return] ${response} Create Entity [Arguments] ${filename} ${entity_id} -- GitLab From b4d5e738082c3ab3362a5ea35be389862359df91 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 8 Jan 2021 19:57:10 +0000 Subject: [PATCH 083/442] added append attributes suites --- .../Provision/EntityAttributes/002_03.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot index e4598abe..3124540f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot @@ -20,7 +20,7 @@ Append entity attributes with invalid entity fragments ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} Check Response Status Code 400 ${response} - #Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} - #Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file -- GitLab From e42ab048d701d4d5f336fb8048e6a023130c4e24 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 11 Jan 2021 18:22:19 +0000 Subject: [PATCH 084/442] added update entity tests --- .../Provision/EntityAttributes/001.robot | 12 +++--- .../Provision/EntityAttributes/004.robot | 32 +++++++++++++++ .../Provision/EntityAttributes/005.robot | 33 +++++++++++++++ .../Provision/EntityAttributes/005_03.robot | 26 ++++++++++++ .../Provision/EntityAttributes/006.robot | 23 +++++++++++ ...id-attributes-sample-expectation-01.jsonld | 0 ...id-attributes-sample-expectation-03.jsonld | 31 ++++++++++++++ ...id-attributes-sample-expectation-04.jsonld | 0 ...ragment-different-datasetid-sample.jsonld} | 0 ...cle-fragment-same-datasetid-sample.jsonld} | 0 ...-two-datasetid-attributes-sample-01.jsonld | 23 +++++++++++ ...-two-datasetid-attributes-sample-02.jsonld | 25 ++++++++++++ ...-two-datasetid-attributes-sample-03.jsonld | 25 ++++++++++++ ...-two-datasetid-attributes-sample-04.jsonld | 25 ++++++++++++ ...cle-two-datasetid-attributes-sample.jsonld | 40 +++++++++++++++++++ resources/ApiUtils.resource | 28 ++++++++++--- resources/AssertionUtils.resource | 8 +++- 17 files changed, 319 insertions(+), 12 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot create mode 100644 data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld create mode 100644 data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld create mode 100644 data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld rename data/entities/fragmentEntities/{vehicle-fragment-datasetid-sample-01-02.jsonld => vehicle-fragment-different-datasetid-sample.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-datasetid-sample-03-04.jsonld => vehicle-fragment-same-datasetid-sample.jsonld} (100%) create mode 100644 data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld create mode 100644 data/entities/vehicle-two-datasetid-attributes-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot index 8a254372..bcecbd8e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot @@ -9,11 +9,11 @@ Test Template Append Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE OVERWRITE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME -001_01_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-01-02.jsonld vehicle-attributes-sample-append-expectation-01.jsonld -001_02_Append entity attributes 207 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-01-02.jsonld vehicle-attributes-sample-append-expectation-02.jsonld -001_03_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-03-04.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld -001_04_Append entity attributes 204 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-datasetid-sample-03-04.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +*** Test Cases *** STATUS_CODE OVERWRITE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME +001_01_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-01.jsonld +001_02_Append entity attributes 207 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld +001_03_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +001_04_Append entity attributes 204 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld *** Keywords *** Append Attributes @@ -27,6 +27,6 @@ Append Attributes ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${overwrite} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Body Content ${expectation_filename} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot new file mode 100644 index 00000000..be96764a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you can update entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME +004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld +004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-02.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld +004_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld +004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-04.jsonld vehicle-two-datasetid-attributes-sample-expectation-04.jsonld + +*** Keywords *** +Update Attributes + [Arguments] ${status_code} ${filename} ${fragment_filename} ${expectation_filename} + [Documentation] Check that you can update entity attributes + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Content ${expectation_filename} ${response['body']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot new file mode 100644 index 00000000..c3ca676d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld + +*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID +005_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} +005_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri + +*** Keywords *** +Update Attributes + [Arguments] ${status_code} ${entity_invalid_id} + [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot new file mode 100644 index 00000000..c6e1a0a4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot update an attribute if the entity fragment is invalid +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld +${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld + +*** Test Cases *** +Update entity attributes with invalid entity fragments + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code 400 ${response} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot new file mode 100644 index 00000000..d372e29d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld + +*** Test Cases *** +003_Update entity attributes when the entity id is not known to the system + [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld new file mode 100644 index 00000000..23254a3e --- /dev/null +++ b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld @@ -0,0 +1,31 @@ +{ + "https://uri.fiware.org/ns/data-models#speed": [ + { + "https://uri.etsi.org/ngsi-ld/datasetId": [ + { + "@id": "urn:ngsi-ld:Property:speedometerA4567-speed" + } + ], + "https://uri.fiware.org/ns/data-models#source": [ + { + "@type": [ + "https://uri.etsi.org/ngsi-ld/Property" + ], + "https://uri.etsi.org/ngsi-ld/hasValue": [ + { + "@value": "Speedometer" + } + ] + } + ], + "@type": [ + "https://uri.etsi.org/ngsi-ld/Property" + ], + "https://uri.etsi.org/ngsi-ld/hasValue": [ + { + "@value": 99 + } + ] + } + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-01-02.jsonld rename to data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-datasetid-sample-03-04.jsonld rename to data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld new file mode 100644 index 00000000..115393ad --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld @@ -0,0 +1,23 @@ +{ + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + } + }, + "speed": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld new file mode 100644 index 00000000..5a0ece28 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld @@ -0,0 +1,25 @@ +{ + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld new file mode 100644 index 00000000..b18c7a96 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld @@ -0,0 +1,25 @@ +{ + "isParked2": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld new file mode 100644 index 00000000..a906bcc3 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld @@ -0,0 +1,25 @@ +{ + "isParked2": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed2": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld new file mode 100644 index 00000000..7e83ea23 --- /dev/null +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -0,0 +1,40 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 6ead6b36..facc21d5 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -20,10 +20,10 @@ ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json -${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists ${response} @@ -157,10 +157,28 @@ Append Entity Attributes Using Session ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs params=options=${options} data=${file_content} headers=${headers} expected_status=any + ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ params=options=${options} data=${file_content} headers=${headers} expected_status=any Output ${response.json()} [return] ${response} +Update Entity Attributes Using Session + [Arguments] ${id} ${filename} ${content_type} ${options} + ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ data=${file_content} headers=${headers} expected_status=any + Output ${response.json()} + [return] ${response} + +Update Entity Attributes + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6db6f83a..e1ee2db9 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -27,9 +27,15 @@ Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True +Check Response Body Content + [Arguments] ${expectation_filename} ${response_body} + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=Entity Comparaison Failed + Check Response Headers Containing URI set to [Arguments] ${expected_path} ${expected_entity_id} ${response} - Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['Location']} ignore_order=True Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} -- GitLab From 996622eed6d6eca328b78f2ab4b7811473ff9752 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 13 Jan 2021 18:16:51 +0100 Subject: [PATCH 085/442] chore: remove unused keywords in ApiUtils --- resources/ApiUtils.resource | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index facc21d5..ab2b45b2 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -28,30 +28,6 @@ ${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExi ${response} *** Keywords *** -Api POST request - [Arguments] ${api path} ${header} ${body} - ${response} POST ${api path}/ headers=${header} body=${body} - Output request - Output response - Output Schema - Set Test Variable ${response} - -Api GET request - [Arguments] ${api path} ${header} - ${response} GET ${api path} headers=${header} - Output request - Output response - Output Schema - Set Test Variable ${response} - -Api DEL request - [Arguments] ${header} ${api path} - ${response} DEL ${api path} headers=${header} - Output request - Output response - Output Schema - Set Test Variable ${response} - Delete Entity by Id Returning Response [Arguments] ${id} ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} -- GitLab From 5b11d570b68ba7900f935dab85b46511f7ca8678 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 18 Jan 2021 10:46:49 +0100 Subject: [PATCH 086/442] feat: implement tps of create context source registration subscription --- .../CreateBatchOfEntities/003_02.robot | 1 + .../032_01.robot | 31 ++++++++++++++++ .../032_02.robot | 29 +++++++++++++++ .../032_03.robot | 31 ++++++++++++++++ .../032_04.robot | 31 ++++++++++++++++ .../032_05.robot | 36 +++++++++++++++++++ .../032_06.robot | 31 ++++++++++++++++ .../032_07.robot | 36 +++++++++++++++++++ .../032_08.robot | 32 +++++++++++++++++ .../032_09.robot | 23 ++++++++++++ ...tion-empty-watchedAttributes-sample.jsonld | 21 +++++++++++ .../subscription-expired-sample.jsonld | 21 +++++++++++ .../subscription-expiresAt-sample.jsonld | 21 +++++++++++ .../subscription-inactive-sample.jsonld | 21 +++++++++++ .../subscription-invalid-query-sample.jsonld | 21 +++++++++++ .../subscription-invalid-type-sample.jsonld | 20 +++++++++++ .../subscription-sample.jsonld | 20 +++++++++++ ...ription-without-notification-sample.jsonld | 13 +++++++ resources/ApiUtils.resource | 19 ++++++++++ resources/HttpUtils.resource | 9 +++++ resources/JsonUtils.resource | 15 +++++++- 21 files changed, 481 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot create mode 100644 data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-expired-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-expiresAt-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-inactive-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-invalid-query-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-invalid-type-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-without-notification-sample.jsonld create mode 100755 resources/HttpUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index 83533186..bc248639 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -16,6 +16,7 @@ Create a batch of two valid entities and one invalid entity ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + # TODO: Use Load Test Sample keyword instead ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot new file mode 100644 index 00000000..d8865cd9 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Check that you can create a minimal context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Create Context Source Registration Subscription + [Documentation] Check that you can create a minimal context source registration subscription + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + +*** Keywords *** +Generate Random Ids For Context Source Registration Subscriptions + # TODO: Refactor Generate Random Entity Id to Generate Random Test Sample Id + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot new file mode 100644 index 00000000..4585d672 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource + +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Create Context Source Registration Subscription Without An Id + [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} + + Create Context Source Registration Subscription ${subscription_payload} + + ${subscription_id}= Fetch Id From Response Location Header + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Set Suite Variable ${subscription_id} + +*** Keywords *** +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot new file mode 100644 index 00000000..82b4f4ef --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Create Context Source Registration Subscription Without isActive Member + [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + # TODO: Retrieve context source registration subscription and check status set to active + +*** Keywords *** +Generate Random Ids For Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot new file mode 100644 index 00000000..4ee7e5d8 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld + +*** Test Case *** +Create Inactive Context Source Registration Subscription + [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + # TODO: Retrieve context source registration subscription and check status set to paused + +*** Keywords *** +Generate Random Ids For Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot new file mode 100644 index 00000000..2ac840e9 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld + +*** Test Case *** +Create Context Source Registration Subscription With expiresAt Member + [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired + [Tags] mandatory + + ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} + ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} + ${subscription_payload}= Update Value To Json ${subscription_payload_sample} $..expiresAt ${expiresAt} + + Create Context Source Registration Subscription ${subscription_payload} + + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + # TODO: Retrieve context source registration subscription after 10 secs and check status set to expired + +*** Keywords *** +Generate Random Ids For Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot new file mode 100644 index 00000000..7cca66d0 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Create Context Source Registration Subscription Without expiresAt Member + [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + # TODO: How to check that the context source registration subscription status will be always set to active ? + +*** Keywords *** +Generate Random Ids For Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot new file mode 100644 index 00000000..4d1b9db8 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Create Existing Context Source Registration Subscription + [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists + [Tags] mandatory + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 409 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Initial Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot new file mode 100644 index 00000000..7bbdbcf3 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Invalid Context Source Registration Subscription + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= + +*** Test Cases *** FILEPATH +WithoutNotification csourceSubscriptions/subscription-without-notification-sample.jsonld +InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld +InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld +EmptyWatchedAttributes csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld + +*** Keywords *** +Create Invalid Context Source Registration Subscription + [Arguments] ${filepath} + [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met + [Tags] mandatory + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot new file mode 100644 index 00000000..9a0f4450 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld + +*** Test Case *** +Create Expired Context Source Registration Subscription + [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time + [Tags] mandatory + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld new file mode 100644 index 00000000..a63a1891 --- /dev/null +++ b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "watchedAttributes": [], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expired-sample.jsonld b/data/csourceSubscriptions/subscription-expired-sample.jsonld new file mode 100644 index 00000000..6666dc7a --- /dev/null +++ b/data/csourceSubscriptions/subscription-expired-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "expiresAt": "2018-08-01T22:07:00Z", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld new file mode 100644 index 00000000..72c0f7b8 --- /dev/null +++ b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "expiresAt": "2022-08-01T22:07:00Z", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-inactive-sample.jsonld b/data/csourceSubscriptions/subscription-inactive-sample.jsonld new file mode 100644 index 00000000..cadb9bea --- /dev/null +++ b/data/csourceSubscriptions/subscription-inactive-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": false, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld new file mode 100644 index 00000000..b4c202a7 --- /dev/null +++ b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "q": "invalidQuery", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld new file mode 100644 index 00000000..087b9fc2 --- /dev/null +++ b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"RandomType", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-sample.jsonld b/data/csourceSubscriptions/subscription-sample.jsonld new file mode 100644 index 00000000..7ca438fd --- /dev/null +++ b/data/csourceSubscriptions/subscription-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld new file mode 100644 index 00000000..36bf7833 --- /dev/null +++ b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld @@ -0,0 +1,13 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ab2b45b2..006e7fdc 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -16,6 +16,7 @@ ${ENTITIES_ENDPOINT_PATH} entities/ ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations +${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json @@ -288,3 +289,21 @@ Delete Temporal Representation Of Entity ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} Output request Output response + +Create Context Source Registration Subscription + [Arguments] ${subscription_payload} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + ${request}= Output request + Output response + + Set Suite Variable ${request} + Set Suite Variable ${response} + +Delete Context Source Registration Subscription + [Arguments] ${subscription_id} + + ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + Output request + Output response diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource new file mode 100755 index 00000000..ea8c64a8 --- /dev/null +++ b/resources/HttpUtils.resource @@ -0,0 +1,9 @@ +*** Settings *** +Variables ./variables.py + +Library String + +*** Keywords *** +Fetch Id From Response Location Header + ${id}= Fetch From Right ${response['headers']['Location']} / + [return] ${id} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 8ae198c2..78c7d74d 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -1,7 +1,10 @@ *** Settings *** Library String +Library DateTime Library JSONLibrary +*** Variable *** +${date_format}= %Y-%m-%dT%H:%M:%SZ *** Keywords *** Load Entity [Arguments] ${entity_file_name} ${entity_id} @@ -11,6 +14,16 @@ Load Entity [return] ${entity} +Load Test Sample + [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} + + ${test_sample_payload}= Load Json From File ${EXECDIR}/data/${test_sample_file_path} + ${test_sample}= Update Value To Json ${test_sample_payload} $..id ${test_sample_id} + + Run Keyword If '${test_sample_id}'=='' Delete Object From Json ${test_sample} $..id + + [return] ${test_sample} + Remove Entity Type [Arguments] ${entity} @@ -31,4 +44,4 @@ Create Batch Operation Result &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} - [return] &{batch_operation_result} \ No newline at end of file + [return] &{batch_operation_result} -- GitLab From 96b26fed296d0e2966bb8e0feeaf9daac8301a32 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 18 Jan 2021 11:00:43 +0100 Subject: [PATCH 087/442] feat: add tps for delete context source registration subscription --- .../036_01.robot | 29 +++++++++++++++++++ .../036_02.robot | 16 ++++++++++ .../036_03.robot | 16 ++++++++++ resources/ApiUtils.resource | 2 ++ 4 files changed, 63 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot new file mode 100644 index 00000000..e422665c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that you can delete a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Delete Context Source Registration Subscription + [Documentation] Check that you can delete a context source registration subscription + [Tags] mandatory + + Delete Context Source Registration Subscription ${subscription_id} + + Check Response Status Code Set To 204 + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot new file mode 100644 index 00000000..61755ee6 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot delete a context source registration subscription with an invalid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Delete Context Source Registration Subscription With Invalid Uri + [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI + [Tags] mandatory + + Delete Context Source Registration Subscription invalidUri + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot new file mode 100644 index 00000000..8156d8f9 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot delete an unknown context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Delete Unknown Context Source Registration Subscription With Invalid Uri + [Documentation] Check that you cannot delete an unknown context source registration subscription + [Tags] mandatory + + Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 006e7fdc..80598c54 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -307,3 +307,5 @@ Delete Context Source Registration Subscription ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Output request Output response + + Set Suite Variable ${response} -- GitLab From 5dfe45a4458a817998e1fe90fdba318c28726670 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 18 Jan 2021 11:13:19 +0100 Subject: [PATCH 088/442] feat: add tps for update context source registration subscription --- .../033_01.robot | 35 ++++++++++++++++ .../033_02.robot | 20 +++++++++ .../033_03.robot | 20 +++++++++ .../033_04.robot | 41 +++++++++++++++++++ .../033_05.robot | 36 ++++++++++++++++ ...bscription-update-invalid-json-sample.json | 9 ++++ ...on-update-invalid-notification-sample.json | 5 +++ ...bscription-update-invalid-type-sample.json | 10 +++++ .../fragments/subscription-update-sample.json | 9 ++++ resources/ApiUtils.resource | 16 ++++++++ 10 files changed, 201 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot create mode 100644 data/csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-update-sample.json diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot new file mode 100644 index 00000000..c72a111c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you can update a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + +*** Test Case *** +Update Context Source Registration Subscription + [Documentation] Check that you can update a context source registration subscription + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + + Check Response Status Code Set To 204 + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Initial Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot new file mode 100644 index 00000000..c62c0d80 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration subscription with an invalid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + +*** Test Case *** +Update Context Source Registration Subscription With Invalid Uri + [Documentation] Check that you cannot update a context source registration subscription with an invalid URI + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} + Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot new file mode 100644 index 00000000..58da0713 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Check that you cannot update an unknown context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + +*** Test Case *** +Update Unknown Context Source Registration Subscription + [Documentation] Check that you cannot update an unknown context source registration subscription + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} + Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot new file mode 100644 index 00000000..54d969c6 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Context Source Registration Subscription With Invalid Fragment +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH +InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json +InvalidNotification csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json + +*** Keywords *** +Update Context Source Registration Subscription With Invalid Fragment + [Arguments] ${filepath} + [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${filepath} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +Setup Initial Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Initial Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot new file mode 100644 index 00000000..b646740c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json + +*** Test Case *** +Update Context Source Registration Subscription With Invalid JSON Fragment + [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) + [Tags] mandatory + + Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} + + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_INVALID_REQUEST} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Initial Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${subscription_id} diff --git a/data/csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json b/data/csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json new file mode 100644 index 00000000..972d1c5c --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json @@ -0,0 +1,9 @@ +{ + "notification":{ + "format":"keyValues",, + "endpoint":{ + "uri":"http://my.second.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json b/data/csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json new file mode 100644 index 00000000..e82d4022 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json @@ -0,0 +1,5 @@ +{ + "notification":{ + "format":"keyValues" + } +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json b/data/csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json new file mode 100644 index 00000000..3f46469e --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json @@ -0,0 +1,10 @@ +{ + "type": null, + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.second.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-update-sample.json b/data/csourceSubscriptions/fragments/subscription-update-sample.json new file mode 100644 index 00000000..81f39078 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-update-sample.json @@ -0,0 +1,9 @@ +{ + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.second.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 80598c54..f81ceb97 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -301,6 +301,15 @@ Create Context Source Registration Subscription Set Suite Variable ${request} Set Suite Variable ${response} +Update Context Source Registration Subscription + [Arguments] ${subscription_id} ${subscription_update_fragment} + + ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} + Output request + Output response + + Set Test Variable ${response} + Delete Context Source Registration Subscription [Arguments] ${subscription_id} @@ -309,3 +318,10 @@ Delete Context Source Registration Subscription Output response Set Suite Variable ${response} + +Update Context Source Registration Subscription From File + [Arguments] ${subscription_id} ${file_path} + ${file_content}= Get File ${EXECDIR}/data/${file_path} + Create Session CsrsUpdateRequest ${url} + ${response}= PATCH On Session CsrsUpdateRequest ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} data=${file_content} expected_status=any + Set Test Variable ${response} -- GitLab From 76e35065a386f9d0c7a1af7ba745534b62236dae Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 19 Jan 2021 17:07:00 +0000 Subject: [PATCH 089/442] added append, update entity attributes and partial update entity attributes suites --- .../Provision/Entities/CreateEntity/001.robot | 8 ++-- .../Provision/Entities/CreateEntity/002.robot | 13 +++--- .../Provision/Entities/CreateEntity/003.robot | 5 +-- .../Provision/Entities/DeleteEntity/005.robot | 2 +- .../Provision/EntityAttributes/001.robot | 13 +++--- .../Provision/EntityAttributes/002.robot | 11 ++--- .../Provision/EntityAttributes/002_03.robot | 6 +-- .../Provision/EntityAttributes/003.robot | 2 +- .../Provision/EntityAttributes/004.robot | 13 +++--- .../Provision/EntityAttributes/005_03.robot | 6 +-- .../Provision/EntityAttributes/006.robot | 4 +- .../Provision/EntityAttributes/007.robot | 33 ++++++++++++++ .../Provision/EntityAttributes/008.robot | 42 ++++++++++++++++++ .../Provision/EntityAttributes/009.robot | 43 +++++++++++++++++++ ...ibutes-sample-append-expectation-01.jsonld | 38 +--------------- ...ibutes-sample-append-expectation-02.jsonld | 36 +++++----------- .../vehicle-fragment-all-empty-sample.jsonld | 2 + ...gment-attribute-name-missing-sample.jsonld | 19 ++++++++ ...fragment-different-datasetid-sample.jsonld | 4 +- ...cle-fragment-empty-datasetid-sample.jsonld | 14 ++++++ ...ual-datasetid-different-type-sample.jsonld | 15 +++++++ ...cle-fragment-equal-datasetid-sample.jsonld | 15 +++++++ ...e-fragment-invalid-datasetid-sample.jsonld | 15 +++++++ ...icle-fragment-same-datasetid-sample.jsonld | 4 +- resources/ApiUtils.resource | 17 ++++++-- resources/AssertionUtils.resource | 10 ++++- 26 files changed, 277 insertions(+), 113 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot create mode 100644 data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot index 721c3d99..6fa0cd12 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot @@ -9,20 +9,18 @@ Test Template Create Entity Scenarios *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Cases *** FILENAME CONTENT_TYPE +*** Test Cases *** FILENAME CONTENT_TYPE 001_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json 001_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json 001_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -#001_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json +001_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json 001_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json - - *** Keywords *** Create Entity Scenarios [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity - [Tags] mandatory entityOperations + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot index 8885ef5d..e552177c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot @@ -5,18 +5,19 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME PROBLEM_TYPE EXPECTED_CODE -002_01_InvalidJson invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 406 -002_02_EmptyJson empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} 400 +*** Test Cases *** FILENAME +002_01_InvalidJson invalid-json-sample.jsonld +002_02_EmptyJson empty-sample.jsonld +002_03_EntityWithNoContext building-minimal-without-context-sample.jsonld *** Keywords *** Create Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} ${expected_code} + [Arguments] ${filename} [Documentation] Check that you cannot create an entity with an invalid request [Tags] mandatory Request Entity From File ${filename} - Check RL Response Status Code Set To Expected Code ${expected_code} - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Status Code Set To Expected Code 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot index 1357d60d..7b18be4f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot create an entity with and existing id +Documentation Check that you cannot create an entity with an existing id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -11,14 +11,13 @@ ${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity - [Documentation] Check that you cannot create an entity with and existing id + [Documentation] Check that you cannot create an entity with an existing id [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 201 ${response['status']} - #creating entity with the same id ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 409 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot index 1e23d929..1a0ee934 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot @@ -20,7 +20,7 @@ ${entity_id_not_valid}= thisisaninvaliduri Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id - [Tags] mandatory failing + [Tags] mandatory ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot index bcecbd8e..12d0fb6d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot @@ -8,16 +8,17 @@ Test Template Append Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE OVERWRITE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME -001_01_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-01.jsonld -001_02_Append entity attributes 207 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld -001_03_Append entity attributes 204 ${EMPTY} vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld -001_04_Append entity attributes 204 noOverwrite vehicle-datasetid-attributes-sample.jsonld vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +*** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME +001_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-01.jsonld +001_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld +001_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +001_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld *** Keywords *** Append Attributes - [Arguments] ${status_code} ${overwrite} ${filename} ${fragment_filename} ${expectation_filename} + [Arguments] ${status_code} ${overwrite} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot index 01733412..66fa4348 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot @@ -9,15 +9,16 @@ Test Template Append Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-fragment-datasetid-sample-01-02.jsonld +${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld +${status_code}= 400 -*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID -002_01_Append entity attributes if the entity Id is not present 400 ${EMPTY} -002_02_Append entity attributes if the Entity Id is not a valid URI 400 thisisaninvaliduri +*** Test Cases *** ENTITY_INVALID_ID +002_01_Append entity attributes if the entity Id is not present ${EMPTY} +002_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri *** Keywords *** Append Attributes - [Arguments] ${status_code} ${entity_invalid_id} + [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot index 3124540f..864d9dbb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot @@ -19,8 +19,8 @@ Append entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code 400 ${response} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot index 49e3a993..7553785b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-fragment-datasetid-sample-01-02.jsonld +${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld *** Test Cases *** 003_Append entity attributes when the entity id is not known to the system diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot index be96764a..4a2dc46d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot @@ -8,16 +8,17 @@ Test Template Update Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE FILENAME FRAGMENT_FILENAME EXPECTATION_FILENAME -004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld -004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-02.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld -004_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld -004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-04.jsonld vehicle-two-datasetid-attributes-sample-expectation-04.jsonld +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME +004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld +004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld +004_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld +004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld vehicle-two-datasetid-attributes-sample-expectation-04.jsonld *** Keywords *** Update Attributes - [Arguments] ${status_code} ${filename} ${fragment_filename} ${expectation_filename} + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot index c6e1a0a4..b64ac927 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot @@ -19,8 +19,8 @@ Update entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code 400 ${response} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot index d372e29d..6b1bea6a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot @@ -9,9 +9,9 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld *** Test Cases *** -003_Update entity attributes when the entity id is not known to the system +006_Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot new file mode 100644 index 00000000..ea2fb14a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can perform a partial update on an entity attribute +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld +${attribute_id}= speed +${status_code}= 204 + +*** Test Cases *** FRAGMENT_FILENAME +007_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld +007_02_CCheck that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld + +*** Keywords *** +Update Attributes + [Arguments] ${fragment_filename} + [Documentation] Check that you can perform a partial update on an entity attribute + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + #TODO: check body response is empty + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot new file mode 100644 index 00000000..8f9f0238 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Update Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${status_code}= 400 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME +008_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-fragment-equal-datasetid-sample.jsonld +008_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-fragment-equal-datasetid-sample.jsonld +008_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-fragment-attribute-name-missing-sample.jsonld +008_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-fragment-equal-datasetid-sample.jsonld +008_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-fragment-equal-datasetid-different-type-sample.jsonld +008_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed vehicle-fragment-all-empty-sample.jsonld + +*** Keywords *** +Update Attributes + [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} + [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids + [Tags] mandatory failing + + ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${init_entity_id} + +Setup Initial Entities + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot new file mode 100644 index 00000000..807efc9d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Partial Update Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-datasetid-attributes-sample.jsonld +${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld +${status_code}= 404 +${attribute_id}= speed + +*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME +009_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-fragment-same-datasetid-sample.jsonld +009_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-fragment-invalid-datasetid-sample.jsonld +009_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-fragment-empty-datasetid-sample.jsonld +009_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-fragment-attribute-name-missing-sample.jsonld + +*** Keywords *** +Partial Update Attributes + [Arguments] ${entity_id} ${fragment_filename} + [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system + [Tags] mandatory failing + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} + +Setup Initial Entities + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} + ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${not_found_entity_id} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld index 60bd3de9..544b7b4d 100644 --- a/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld +++ b/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld @@ -1,39 +1,3 @@ { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "BMW" - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - } - }, - "speed": [{ - "type": "Property", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, - { - "type": "Property", - "value": 54.5, - "source": { - "type": "Property", - "value": "GPS" - }, - "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" - }], - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] + } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld index e29f4875..ff230172 100644 --- a/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld +++ b/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld @@ -1,30 +1,14 @@ { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Mercedes" - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added": [ + { + "@type": [ + "https://uri.etsi.org/ngsi-ld/Property" + ], + "https://uri.etsi.org/ngsi-ld/hasValue": [ + { + "@value": 23 + } + ] } - }, - "speed": { - "type": "Property", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld new file mode 100644 index 00000000..10e3efd8 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld @@ -0,0 +1,19 @@ +{ + "speed2": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "brandName": { + "type": "Property", + "value": "BMW" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld index 3bc23013..43e60c4c 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld @@ -8,9 +8,9 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2" }, - "brandName": { + "attribute_to_be_added": { "type": "Property", - "value": "BMW" + "value": 23 }, "@context": [ "https://fiware.github.io/data-models/context.jsonld", diff --git a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld new file mode 100644 index 00000000..2d30b46e --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld @@ -0,0 +1,14 @@ +{ + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld new file mode 100644 index 00000000..05e676e6 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld @@ -0,0 +1,15 @@ +{ + "speed": { + "type": "different_type", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld new file mode 100644 index 00000000..6a85b902 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld @@ -0,0 +1,15 @@ +{ + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld new file mode 100644 index 00000000..b3776989 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld @@ -0,0 +1,15 @@ +{ + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld index 4aa9726c..86872a11 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld @@ -8,9 +8,9 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, - "brandName": { + "attribute_to_be_added": { "type": "Property", - "value": "BMW" + "value": 23 }, "@context": [ "https://fiware.github.io/data-models/context.jsonld", diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index facc21d5..3740921c 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -20,10 +20,10 @@ ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json -${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists ${response} @@ -179,6 +179,15 @@ Update Entity Attributes Output response [return] ${response} +Partial Update Entity Attributes + [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index e1ee2db9..b368ff36 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -35,7 +35,7 @@ Check Response Body Content Check Response Headers Containing URI set to [Arguments] ${expected_path} ${expected_entity_id} ${response} - Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['Location']} ignore_order=True + Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} @@ -94,10 +94,18 @@ Check Response Body Containing List Containing EntityTemporal elements ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed +Check Response Body Type When Using Session Request + [Arguments] ${response} ${type} + Should Be Equal ${response['type']} ${type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} Should Be Equal ${response['body']['type']} ${type} +Check Response Body Title When Using Session Request + [Arguments] ${response} + Should Not Be Empty ${response['title']} + Check Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} Should Not Be Empty ${response['body']['title']} -- GitLab From cc2a95eaea92317a64f80f95568cb97c3e4fc115 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 20 Jan 2021 17:38:17 +0000 Subject: [PATCH 090/442] added delete entity attributes suite --- .../Provision/EntityAttributes/010.robot | 33 ++++++++++++++++ .../Provision/EntityAttributes/011.robot | 36 ++++++++++++++++++ .../Provision/EntityAttributes/012.robot | 38 +++++++++++++++++++ resources/ApiUtils.resource | 11 ++++++ 4 files changed, 118 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot new file mode 100644 index 00000000..83c959c5 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can delete an attribute from an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Append Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 204 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${attribute_id}= speed + +*** Test Cases *** DATASETID DELETEALL +010_01_delete an attribute with the id ${EMPTY} ${EMPTY} +010_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed ${EMPTY} +010_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed True + +*** Keywords *** +Append Attributes + [Arguments] ${datasetId} ${deleteAll} + [Documentation] Check that you can delete an attribute from an entity + [Tags] mandatory failing + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot new file mode 100644 index 00000000..ebdd033b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Append Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +011_01_delete an attribute if the Entity Id is not present ${EMPTY} speed +011_02_delete an attribute if the Entity Id is not a valid URI thisIsAnInvalidURI speed +011_03_delete an attribute if the Attribute Name is not present ${valid_entity_id} ${EMPTY} + +*** Keywords *** +Append Attributes + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids + [Tags] mandatory failing + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} ${EMPTY} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Setup Initial Entities + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot new file mode 100644 index 00000000..6db51b62 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Append Attributes + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID +012_01_delete an attribute when the Entity Id is not known to the system ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +012_02_delete an attribute when the Entity does not contain the target attribute id ${valid_entity_id} notFound ${EMPTY} +012_03_delete an attribute when the Entity does not contain the target attribute with same datasetId ${valid_entity_id} speed urn:ngsi-ld:Property:notFound + +*** Keywords *** +Append Attributes + [Arguments] ${entity_id} ${attribute_id} ${datasetId} + [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids + [Tags] mandatory failing + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${EMPTY} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Setup Initial Entities + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} + ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${not_found_entity_id} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e32f96d6..0d06d1e8 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -156,6 +156,17 @@ Update Entity Attributes Output response [return] ${response} +Delete Entity Attributes + [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} + &{headers}= Create Dictionary Content-Type=${content_type} + &{params}= Create Dictionary + Run Keyword If '${datasetId}'!='' Set To Dictionary ${params} datasetId=${datasetId} + Run Keyword If '${deleteAll}'!='' Set To Dictionary ${params} deletelAll=${deleteAll} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} headers=${headers} parameter=${params} + Output request + Output response + [return] ${response} + Partial Update Entity Attributes [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} -- GitLab From 2c73170c07cc228d6c04176d08687803eceec6a7 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 20 Jan 2021 17:40:10 +0000 Subject: [PATCH 091/442] status code change --- .../ContextInformation/Provision/EntityAttributes/012.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot index 6db51b62..1b64141a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot @@ -9,7 +9,7 @@ Test Template Append Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 +${status_code}= 404 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld *** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID -- GitLab From 8257d25d9379689c187e6f875a64127e8366282c Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 21 Jan 2021 14:21:32 +0100 Subject: [PATCH 092/442] feat: complete implementation of tps for create context source registration subscription --- .../032_01.robot | 2 ++ .../032_02.robot | 1 + .../032_03.robot | 5 ++++- .../032_04.robot | 5 ++++- .../032_05.robot | 4 +++- .../032_06.robot | 7 ++++++- .../032_07.robot | 2 ++ resources/ApiUtils.resource | 9 +++++++++ resources/AssertionUtils.resource | 3 ++- 9 files changed, 33 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot index d8865cd9..2e97d9dd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot @@ -17,7 +17,9 @@ Create Context Source Registration Subscription [Tags] mandatory ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot index 4585d672..e5347ac4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot @@ -22,6 +22,7 @@ Create Context Source Registration Subscription Without An Id ${subscription_id}= Fetch Id From Response Location Header Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Set Suite Variable ${subscription_id} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot index 82b4f4ef..bb635568 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot @@ -17,10 +17,13 @@ Create Context Source Registration Subscription Without isActive Member [Tags] mandatory ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - # TODO: Retrieve context source registration subscription and check status set to active + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot index 4ee7e5d8..ee2c08b5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot @@ -17,10 +17,13 @@ Create Inactive Context Source Registration Subscription [Tags] mandatory ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - # TODO: Retrieve context source registration subscription and check status set to paused + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status paused *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot index 2ac840e9..4bb7737a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot @@ -25,7 +25,9 @@ Create Context Source Registration Subscription With expiresAt Member Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - # TODO: Retrieve context source registration subscription after 10 secs and check status set to expired + Sleep 15s + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status expired *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot index 7cca66d0..e6c70610 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot @@ -17,10 +17,15 @@ Create Context Source Registration Subscription Without expiresAt Member [Tags] mandatory ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - # TODO: How to check that the context source registration subscription status will be always set to active ? + # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough + Sleep 10s + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot index 4d1b9db8..11d1ab96 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot @@ -17,7 +17,9 @@ Create Existing Context Source Registration Subscription [Tags] mandatory ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 409 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 0d06d1e8..45258587 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -330,6 +330,15 @@ Update Context Source Registration Subscription Set Test Variable ${response} +Retrieve Context Source Registration Subscription + [Arguments] ${subscription_id} + + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + Output request + Output response + + Set Test Variable ${response} + Delete Context Source Registration Subscription [Arguments] ${subscription_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index b368ff36..f72d48f0 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -38,8 +38,9 @@ Check Response Headers Containing URI set to Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True Check Response Body Containing an Attribute set to - [Arguments] ${expected_attribute_name} + [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} Should Not Be Empty ${response['body']['${expected_attribute_name}']} + Run Keyword If '${expected_attribute_value}'!='' Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} Check Response Body Details Containing Information Error [Arguments] ${expected_error_message} -- GitLab From 4151b067e69ab31d9bdb6b78f66f864772f7253a Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 22 Jan 2021 18:08:44 +0000 Subject: [PATCH 093/442] added create registration suite --- .../001_01.robot | 24 ++++++++++ .../001_02.robot | 24 ++++++++++ .../001_03.robot | 22 ++++++++++ .../CreateContextSourceRegistration/002.robot | 30 +++++++++++++ .../002_01.robot | 22 ++++++++++ .../CreateContextSourceRegistration/003.robot | 26 +++++++++++ .../registration-invalid-sample.jsonld | 43 ++++++++++++++++++ ...gistration-invalid-structure-sample.jsonld | 7 +++ .../registration-no-id-sample.jsonld | 42 ++++++++++++++++++ ...registration-past-expiration-sample.jsonld | 44 +++++++++++++++++++ .../registration-sample.jsonld | 43 ++++++++++++++++++ ...registration-with-expiration-sample.jsonld | 44 +++++++++++++++++++ resources/ApiUtils.resource | 26 +++++++++++ resources/AssertionUtils.resource | 6 +++ 14 files changed, 403 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot create mode 100644 data/csourceRegistrations/registration-invalid-sample.jsonld create mode 100644 data/csourceRegistrations/registration-invalid-structure-sample.jsonld create mode 100644 data/csourceRegistrations/registration-no-id-sample.jsonld create mode 100644 data/csourceRegistrations/registration-past-expiration-sample.jsonld create mode 100644 data/csourceRegistrations/registration-sample.jsonld create mode 100644 data/csourceRegistrations/registration-with-expiration-sample.jsonld diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot new file mode 100644 index 00000000..b471b6eb --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can create a context source registration with specific ID and expiration date +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/registration-with-expiration-sample.jsonld + +*** Test Case *** +Create Context Source Registration With Specific Date Expiration Date + [Documentation] Check that you can create a context source registration with specific ID and expiration date + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${registration_id} ${updated_payload} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot new file mode 100644 index 00000000..d9c2b03f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can create a context source registration that never expires +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/registration-sample.jsonld + +*** Test Case *** +Create Context Source Registration That Never Expires + [Documentation] Check that you can create a context source registration that never expires + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${registration_id} ${updated_payload} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot new file mode 100644 index 00000000..bafec59a --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that when creating a context source registration without specifying an ID +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/registration-no-id-sample.jsonld + +*** Test Case *** +Create Context Source Registration Without A Sprecified ID + [Documentation] Check that when creating a context source registration without specifying an ID + [Tags] mandatory + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${request} ${response}= Create Context Source Registration ${payload} + Check Response Status Code 201 ${response['status']} + ${registration_id}= Check Response Headers ID Not Empty ${response} + + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot new file mode 100644 index 00000000..78b751ee --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot @@ -0,0 +1,30 @@ +*** Settings *** +Documentation Check that you cannot create a context source with invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Context Source With Invalid Content + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: + +*** Test Cases *** FILENAME +002_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld +002_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld + +*** Keywords *** +Create Context Source With Invalid Content + [Arguments] ${filename} + [Documentation] Check that you cannot create a context source with invalid content + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 400 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot new file mode 100644 index 00000000..b89f36b0 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Create a context source registration with invalid JSON file +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-invalid-sample.jsonld + +*** Test Cases *** +Create a context source registration with invalid JSON file + [Documentation] Create a context source registration with invalid JSON file + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot new file mode 100644 index 00000000..8eabac9e --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot create a context source registration that already exists +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= csourceRegistrations/registration-sample.jsonld + +*** Test Cases *** +Create a context source registration that already exists + [Documentation] Check that you cannot create a context source registration that already exists + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/csourceRegistrations/registration-invalid-sample.jsonld b/data/csourceRegistrations/registration-invalid-sample.jsonld new file mode 100644 index 00000000..b0ffbb3e --- /dev/null +++ b/data/csourceRegistrations/registration-invalid-sample.jsonld @@ -0,0 +1,43 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID",, + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-invalid-structure-sample.jsonld b/data/csourceRegistrations/registration-invalid-structure-sample.jsonld new file mode 100644 index 00000000..cc6bf6c3 --- /dev/null +++ b/data/csourceRegistrations/registration-invalid-structure-sample.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-no-id-sample.jsonld b/data/csourceRegistrations/registration-no-id-sample.jsonld new file mode 100644 index 00000000..f2abff25 --- /dev/null +++ b/data/csourceRegistrations/registration-no-id-sample.jsonld @@ -0,0 +1,42 @@ +{ + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-past-expiration-sample.jsonld b/data/csourceRegistrations/registration-past-expiration-sample.jsonld new file mode 100644 index 00000000..f9f76264 --- /dev/null +++ b/data/csourceRegistrations/registration-past-expiration-sample.jsonld @@ -0,0 +1,44 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "expiresAt": " 2018-11-29T14:53:15Z", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-sample.jsonld b/data/csourceRegistrations/registration-sample.jsonld new file mode 100644 index 00000000..956aeda4 --- /dev/null +++ b/data/csourceRegistrations/registration-sample.jsonld @@ -0,0 +1,43 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-with-expiration-sample.jsonld b/data/csourceRegistrations/registration-with-expiration-sample.jsonld new file mode 100644 index 00000000..bb9ae210 --- /dev/null +++ b/data/csourceRegistrations/registration-with-expiration-sample.jsonld @@ -0,0 +1,44 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "expiresAt": " 2025-11-29T14:53:15Z", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 0d06d1e8..240a23e3 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -16,6 +16,7 @@ ${ENTITIES_ENDPOINT_PATH} entities/ ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations +${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions ${CONTENT_TYPE_JSON} application/json @@ -176,6 +177,31 @@ Partial Update Entity Attributes Output response [return] ${response} +Create Context Source Registration + [Arguments] ${payload} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} + ${request}= Output request + Output response + [return] ${request} ${response} + +Create Context Source Registration Using Session + [Arguments] ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any + Output ${response.json()} + [return] ${response} + + +Delete Context Source Registration + [Arguments] ${registration_id} + ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + Output request + Output response + [return] ${response} + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index b368ff36..6849b177 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -37,6 +37,12 @@ Check Response Headers Containing URI set to [Arguments] ${expected_path} ${expected_entity_id} ${response} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True +Check Response Headers ID Not Empty + [Arguments] ${response} + ${id}= Fetch From Right ${response['headers']['location']} / + Should Not Be Empty ${id} + [return] ${id} + Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} Should Not Be Empty ${response['body']['${expected_attribute_name}']} -- GitLab From 249e27659d3d575c633d781cfc34c85f35ce07bc Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 25 Jan 2021 09:58:54 +0000 Subject: [PATCH 094/442] some minor bugs --- .../Registration/CreateContextSourceRegistration/001_01.robot | 2 +- .../Registration/CreateContextSourceRegistration/001_02.robot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot index b471b6eb..b416b584 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot @@ -17,7 +17,7 @@ Create Context Source Registration With Specific Date Expiration Date ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${registration_id} ${updated_payload} + ${request} ${response}= Create Context Source Registration ${updated_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot index d9c2b03f..61fed06c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot @@ -17,7 +17,7 @@ Create Context Source Registration That Never Expires ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${registration_id} ${updated_payload} + ${request} ${response}= Create Context Source Registration ${updated_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} -- GitLab From e5cbc7e7de6be563bc01fb55d079f693af6d753f Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 25 Jan 2021 12:07:39 +0100 Subject: [PATCH 095/442] implement tps for notification behaviour of context source registration subscriptions --- .../NotificationBehaviour/037_01.robot | 46 +++++++++++ .../NotificationBehaviour/037_02.robot | 52 ++++++++++++ .../NotificationBehaviour/037_03.robot | 48 +++++++++++ .../NotificationBehaviour/037_04.robot | 46 +++++++++++ .../NotificationBehaviour/037_05.robot | 49 ++++++++++++ .../NotificationBehaviour/037_06.robot | 48 +++++++++++ .../NotificationBehaviour/037_07.robot | 53 +++++++++++++ .../NotificationBehaviour/037_08.robot | 48 +++++++++++ .../NotificationBehaviour/037_09.robot | 48 +++++++++++ .../NotificationBehaviour/037_10.robot | 46 +++++++++++ .../NotificationBehaviour/037_11.robot | 48 +++++++++++ .../NotificationBehaviour/037_12.robot | 46 +++++++++++ .../NotificationBehaviour/037_13.robot | 46 +++++++++++ .../NotificationBehaviour/037_14.robot | 46 +++++++++++ .../NotificationBehaviour/037_15.robot | 46 +++++++++++ .../NotificationBehaviour/037_16.robot | 59 ++++++++++++++ ...on-building-and-bus-entities-sample.jsonld | 25 ++++++ ...ce-registration-bus-entities-sample.jsonld | 18 +++++ ...tration-detailed-information-sample.jsonld | 20 +++++ ...source-registration-location-sample.jsonld | 25 ++++++ ...istration-managementInterval-sample.jsonld | 22 ++++++ ...stration-observationInterval-sample.jsonld | 22 ++++++ .../context-source-registration-sample.jsonld | 18 +++++ ...egistration-vehicle-entities-sample.jsonld | 18 +++++ ...egistration-update-information-sample.json | 11 +++ ...ext-source-registration-update-sample.json | 3 + .../subscription-bus-entities-sample.json | 7 ++ .../subscription-expiresAt-update-sample.json | 3 + .../subscription-isActive-update-sample.json | 3 + ...ption-vehicle-and-bus-entities-sample.json | 10 +++ .../subscription-vehicle-entities-sample.json | 7 ++ .../subscription-geoQ-sample.jsonld | 26 ++++++ ...ion-geoQ-without-geoproperty-sample.jsonld | 25 ++++++ ...cription-temporalQ-createdAt-sample.jsonld | 25 ++++++ ...ription-temporalQ-modifiedAt-sample.jsonld | 25 ++++++ ...ription-temporalQ-observedAt-sample.jsonld | 25 ++++++ .../subscription-timeInterval-sample.jsonld | 21 +++++ ...ription-unreachable-endpoint-sample.jsonld | 20 +++++ ...bscription-watchedAttributes-sample.jsonld | 21 +++++ .../expectations/1-timesSent-failed.json | 9 +++ .../expectations/1-timesSent-ok.json | 9 +++ libraries/dateTimeUtils.py | 13 +++ requirements.txt | 1 + resources/ApiUtils.resource | 29 +++++++ resources/AssertionUtils.resource | 14 +++- resources/NotificationUtils.resource | 79 +++++++++++++++++++ resources/variables.py | 4 +- 47 files changed, 1331 insertions(+), 2 deletions(-) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot create mode 100644 data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-location-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-sample.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld create mode 100644 data/csourceRegistrations/fragments/context-source-registration-update-information-sample.json create mode 100644 data/csourceRegistrations/fragments/context-source-registration-update-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-bus-entities-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-isActive-update-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json create mode 100644 data/csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json create mode 100644 data/csourceSubscriptions/subscription-geoQ-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-timeInterval-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld create mode 100644 data/notifications/expectations/1-timesSent-failed.json create mode 100644 data/notifications/expectations/1-timesSent-ok.json create mode 100644 libraries/dateTimeUtils.py create mode 100644 resources/NotificationUtils.resource diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot new file mode 100644 index 00000000..80b336d4 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld + +*** Test Case *** +Receive cSourceNotification Periodically And Initially On Subscription + [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached + [Tags] mandatory + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Set Suite Variable ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Wait for notification + # Wait for 15 seconds to check if another notification was sent + Wait for notification timeout=${15} + +*** Keywords *** +Setup Initial Context Source Registrations + Start Local Server + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot new file mode 100644 index 00000000..4846a9f5 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + +*** Test Case *** +Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration + [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + [Tags] mandatory + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Set Suite Variable ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + + ${update_fragment}= Load Test Sample ${update_fragment_file_path} + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + +*** Keywords *** +Setup Initial Context Source Registrations + Start Local Server + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot new file mode 100644 index 00000000..7ad2693f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Receive cSourceNotification With Relevant Information + [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + @{expected_notification_data_entities}= Create List Building + + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot new file mode 100644 index 00000000..aac6a6c3 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Receive cSourceNotification With Compliant Structure + [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot new file mode 100644 index 00000000..f562b613 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json + +*** Test Case *** +If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated + [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Wait for notification + + Retrieve Context Source Registration Subscription ${subscription_id} + @{expected_notification_additional_members}= Create List lastNotification lastSuccess + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot new file mode 100644 index 00000000..187bde84 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/0-timesSent-failed.json + +*** Test Case *** +If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated + [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Wait for no notification + Retrieve Context Source Registration Subscription ${subscription_id} + @{expected_notification_additional_members}= Create List lastNotification lastFailure + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot new file mode 100644 index 00000000..09c91737 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH +PausedSubscription csourceSubscriptions/fragments/subscription-isActive-update-sample.json +ExpiredSubscription csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json + +*** Keywords *** +Do Not Receive cSourceNotification If Subscription Status Is Not Active + [Arguments] ${filepath} + [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${filepath} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Wait for no notification + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot new file mode 100644 index 00000000..800f0a9f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information + [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information + [Tags] mandatory + + ${update_fragment}= Load Test Sample ${update_fragment_file_path} + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + +*** Keywords *** +Setup Initial Context Source Registrations And Subscriptions + Start Local Server + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration ${context_source_registration_payload} + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${context_source_registration_id} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot new file mode 100644 index 00000000..bd0794af --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json + +*** Test Case *** +Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information + [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities + [Tags] mandatory + + ${update_fragment}= Load Test Sample ${update_fragment_file_path} + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} noLongerMatching + +*** Keywords *** +Setup Initial Context Source Registrations And Subscriptions + Start Local Server + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration ${context_source_registration_payload} + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${context_source_registration_id} + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot new file mode 100644 index 00000000..37f11385 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations On Observation Interval + [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot new file mode 100644 index 00000000..81487f69 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval +Suite Setup Start Local Server +Suite Teardown Delete Created Context Source Registrations + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld + +*** Test Cases *** FILEPATH +CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld + +*** Keywords *** +Receive cSourceNotification For Matching Context Source Registrations On Management Interval + [Arguments] ${filepath} + [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + [Tags] mandatory + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + + # Moved here since each test case creates a subscription + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +Delete Created Context Source Registrations + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot new file mode 100644 index 00000000..5c63941f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes + [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot new file mode 100644 index 00000000..3da7df0c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute + [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot new file mode 100644 index 00000000..e269b57d --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations On Location + [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot new file mode 100644 index 00000000..9527579f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld + +*** Test Case *** +Receive cSourceNotification For Matching Context Source Registrations On Location As Default + [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot new file mode 100644 index 00000000..8c5b3f15 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot @@ -0,0 +1,59 @@ +*** Settings *** +Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Test Template Receive cSourceNotification For Newly Matching Context Source Registrations +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS +MatchFirstContextSourceRegistration csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} +MatchSecondContextSourceRegistration csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} +MatchBothContextSourceRegistrations csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} + +*** Keywords *** +Receive cSourceNotification For Newly Matching Context Source Registrations + [Arguments] ${filepath} @{notification_csr_ids} + [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations + [Tags] mandatory + + ${subscription_update_fragment}= Load Test Sample ${filepath} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + + Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching + +Setup Initial Context Source Registrations And Subscriptions + Start Local Server + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + + Create Context Source Registration Subscription ${subscription_payload} + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + + Set Suite Variable ${subscription_id} + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + +Delete Created Context Source Registrations And Subscriptions + Stop Local Server + + Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} diff --git a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld new file mode 100644 index 00000000..ce7e8b3a --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + }, + { + "entities":[ + { + "type":"Bus" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld new file mode 100644 index 00000000..fccc6705 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Bus" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld new file mode 100644 index 00000000..90753052 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ], + "propertyNames":["name", "subCategory"], + "relationshipNames":["locatedAt"] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld new file mode 100644 index 00000000..3d4599ec --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"GeoProperty", + "value":{ + "type":"Point", + "coordinates":[-8.521,41.2] + } + }, + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld new file mode 100644 index 00000000..a3785ed2 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "managementInterval":{ + "startAt":"2020-08-01T22:07:00Z", + "endAt":"2021-08-01T21:07:00Z" + }, + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld new file mode 100644 index 00000000..e08c3fbe --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "observationInterval":{ + "startAt":"2020-08-01T22:07:00Z", + "endAt":"2021-08-01T21:07:00Z" + }, + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld new file mode 100644 index 00000000..aee82568 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld new file mode 100644 index 00000000..177d2319 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Vehicle" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/fragments/context-source-registration-update-information-sample.json b/data/csourceRegistrations/fragments/context-source-registration-update-information-sample.json new file mode 100644 index 00000000..5d6df96b --- /dev/null +++ b/data/csourceRegistrations/fragments/context-source-registration-update-information-sample.json @@ -0,0 +1,11 @@ +{ + "information":[ + { + "entities":[ + { + "type":"NewType" + } + ] + } + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/fragments/context-source-registration-update-sample.json b/data/csourceRegistrations/fragments/context-source-registration-update-sample.json new file mode 100644 index 00000000..133cc317 --- /dev/null +++ b/data/csourceRegistrations/fragments/context-source-registration-update-sample.json @@ -0,0 +1,3 @@ +{ + "endpoint":"http://my.new.csource.org:1026" +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-bus-entities-sample.json b/data/csourceSubscriptions/fragments/subscription-bus-entities-sample.json new file mode 100644 index 00000000..97bb80ee --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-bus-entities-sample.json @@ -0,0 +1,7 @@ +{ + "entities":[ + { + "type":"Bus" + } + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json b/data/csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json new file mode 100644 index 00000000..237d2180 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json @@ -0,0 +1,3 @@ +{ + "expiresAt": "2020-08-01T22:07:00Z" +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-isActive-update-sample.json b/data/csourceSubscriptions/fragments/subscription-isActive-update-sample.json new file mode 100644 index 00000000..b432cbae --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-isActive-update-sample.json @@ -0,0 +1,3 @@ +{ + "isActive": false +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json b/data/csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json new file mode 100644 index 00000000..6040ffb6 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json @@ -0,0 +1,10 @@ +{ + "entities":[ + { + "type":"Vehicle" + }, + { + "type":"Bus" + } + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json b/data/csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json new file mode 100644 index 00000000..ff01dca7 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json @@ -0,0 +1,7 @@ +{ + "entities":[ + { + "type":"Vehicle" + } + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld new file mode 100644 index 00000000..3dd0bc74 --- /dev/null +++ b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld @@ -0,0 +1,26 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "geoQ":{ + "georel":"near;maxDistance==2000", + "geometry":"Point", + "coordinates":[-8.52,41.2], + "geoproperty": "location" + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld new file mode 100644 index 00000000..0e664bd6 --- /dev/null +++ b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "geoQ":{ + "georel":"near;maxDistance==2000", + "geometry":"Point", + "coordinates":[-8.52,41.2] + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld new file mode 100644 index 00000000..7265fc1d --- /dev/null +++ b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "temporalQ": { + "timerel": "after", + "timeAt": "2020-06-01T22:07:00Z", + "timeproperty": "createdAt" + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld new file mode 100644 index 00000000..ef21a2b1 --- /dev/null +++ b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "temporalQ": { + "timerel": "after", + "timeAt": "2020-06-01T22:07:00Z", + "timeproperty": "modifiedAt" + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld new file mode 100644 index 00000000..87a23d6f --- /dev/null +++ b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "temporalQ": { + "timerel": "after", + "timeAt": "2020-06-01T22:07:00Z", + "timeproperty": "observedAt" + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld new file mode 100644 index 00000000..1e5eff51 --- /dev/null +++ b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "timeInterval": 10, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld new file mode 100644 index 00000000..aac999b6 --- /dev/null +++ b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://unreachable.endpoint/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld new file mode 100644 index 00000000..1bca0769 --- /dev/null +++ b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "watchedAttributes": ["name", "subCategory"], + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/notifications/expectations/1-timesSent-failed.json b/data/notifications/expectations/1-timesSent-failed.json new file mode 100644 index 00000000..27b2d40f --- /dev/null +++ b/data/notifications/expectations/1-timesSent-failed.json @@ -0,0 +1,9 @@ +{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + }, + "status":"failed", + "timesSent":1 +} \ No newline at end of file diff --git a/data/notifications/expectations/1-timesSent-ok.json b/data/notifications/expectations/1-timesSent-ok.json new file mode 100644 index 00000000..2e61a8ba --- /dev/null +++ b/data/notifications/expectations/1-timesSent-ok.json @@ -0,0 +1,9 @@ +{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + }, + "status":"ok", + "timesSent":1 +} \ No newline at end of file diff --git a/libraries/dateTimeUtils.py b/libraries/dateTimeUtils.py new file mode 100644 index 00000000..d22264c8 --- /dev/null +++ b/libraries/dateTimeUtils.py @@ -0,0 +1,13 @@ +import datetime + + +def is_date(date, format): + """Function exposed as a keyword to check whether the string can be interpreted as a date of given format + :param date: string to check for date + :param format: date format + """ + try: + datetime.datetime.strptime(date, format) + return True + except ValueError: + return False diff --git a/requirements.txt b/requirements.txt index a0b25556..c62307ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.3.1 robotframework-requests==0.8.0 deepdiff==5.2.1 +robotframework-httpctrl==0.1.6 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 0c4ec21f..9d069ef5 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -336,6 +336,35 @@ Delete Temporal Representation Of Entity Output request Output response +Create Context Source Registration + [Arguments] ${context_source_registration_payload} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${context_source_registration_payload} headers=${headers} + ${request}= Output request + Output response + + Set Suite Variable ${request} + Set Suite Variable ${response} + +Update Context Source Registration + [Arguments] ${context_source_registration_id} ${update_fragment} + + ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} body=${update_fragment} + Output request + Output response + + Set Test Variable ${response} + +Delete Context Source Registration + [Arguments] ${context_source_registration_id} + + ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + Output request + Output response + + Set Suite Variable ${response} + Create Context Source Registration Subscription [Arguments] ${subscription_payload} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6236f3f1..89ca3ddb 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -3,6 +3,7 @@ Library ${EXECDIR}/libraries/assertionUtils.py *** Variable *** ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] +${notification_timestamps_regex_expr}= root\\['last.*'\\] *** Keywords *** Check Response Status Code @@ -156,4 +157,15 @@ Should Be Present In Json List Check Result Contains [Arguments] ${source} ${parameter} ${value} - Should Be Present In Json List ${source} ${parameter} ${value} \ No newline at end of file + Should Be Present In Json List ${source} ${parameter} ${value} + +Check NotificationParams + [Arguments] ${filename} ${expected_additional_members} + + ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${notification_timestamps_regex_expr} + Should Be True ${comparaison_result} msg=NotificationParams Comparaison Failed + + FOR ${expected_additional_member} IN @{expected_additional_members} + Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} + END diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource new file mode 100644 index 00000000..e9749abb --- /dev/null +++ b/resources/NotificationUtils.resource @@ -0,0 +1,79 @@ +*** Settings *** +Documentation Check Notification Behaviour +Library BuiltIn +Library Collections +Library HttpCtrl.Server +Library ${EXECDIR}/libraries/assertionUtils.py +Library ${EXECDIR}/libraries/dateTimeUtils.py + +*** Variable *** +${notification_type}= ContextSource Notfication +${date_format}= %Y-%m-%dT%H:%M:%SZ + +*** Keywords *** +Start Local Server + #Initialize HTTP Client And Server + Start Server ${notification_server_host} ${notification_server_port} + +Wait for notification + [Arguments] ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + +Wait for notification and validate it + [Arguments] ${expected_subscription_id} ${expected_context_source_registration_ids} ${expected_trigger_reason} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + + ${notification_payload}= Get Request Body + ${notification} Evaluate json.loads('''${notification_payload}''') json + ${notification_data_length}= Get length ${notification}[data] + ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} + ${expected_notification_data_length}= Get length ${expected_context_source_registration_ids} + + log ${notification} + Should Be Equal ${notification}[type] ${notification_type} + Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + Should Be True ${is_date} + ${index}= Set Variable 0 + FOR ${expected_context_source_registration_id} IN @{expected_context_source_registration_ids} + List Should Contain Value ${expected_context_source_registration_ids} ${notification}[data][${index}][@id] + ${index}= Evaluate ${index} + 1 + END + Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' + Should Be Equal ${notification}[triggerReason] ${expected_trigger_reason} + + # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all + Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + +Wait for no notification + [Arguments] ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For No Request ${timeout} + +Check Notification Data Entities + [Arguments] ${notification_data_information} ${expected_notification_data_entities} + + ${notification_data_entities}= Create List + ${index}= Set Variable 0 + FOR ${registration_information} IN @{notification_data_information} + Append To List ${notification_data_entities} ${registration_information}[entities][0][type][0] + END + + Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True + +Stop Local Server + #Terminate HTTP Server + Stop Server diff --git a/resources/variables.py b/resources/variables.py index 3b9e617a..8cbd37d4 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,7 +1,9 @@ def get_variables(arg=None): variables = { 'url': 'https://broker-ngsi-ld.demeter.ubiwhere.com/ngsi-ld/v1', - 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld' + 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', + 'notification_server_host': '0.0.0.0', + 'notification_server_port': 8085 } return variables \ No newline at end of file -- GitLab From 28c7f2998d84b7fbc719f6e4263f55c5b333e5f5 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 25 Jan 2021 17:25:24 +0000 Subject: [PATCH 096/442] Added update context source registration suite --- .../UpdateContextSourceRegistration/004.robot | 32 ++++++++++++++ .../UpdateContextSourceRegistration/005.robot | 40 +++++++++++++++++ .../005_05.robot | 27 ++++++++++++ .../UpdateContextSourceRegistration/006.robot | 23 ++++++++++ .../registration-different-type-sample.jsonld | 43 +++++++++++++++++++ resources/ApiUtils.resource | 17 ++++++++ 6 files changed, 182 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot create mode 100644 data/csourceRegistrations/registration-different-type-sample.jsonld diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot new file mode 100644 index 00000000..a7aa85cd --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you can update a context source registration by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Context Source + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: + +*** Test Case *** FILENAME UPDATE_FILENAME +004_01_Update a context source registration by id registration-sample.jsonld registration-with-expiration-sample.jsonld +004_02_Update a context source registration to never expire registration-with-expiration-sample.jsonld registration-sample.jsonld + +*** Keywords *** +Update Context Source + [Arguments] ${filename} ${update_filename} + [Documentation] Check that you can update a context source registration by id + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot new file mode 100644 index 00000000..265f1d82 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration under some conditions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Update Context Source + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= registration-sample.jsonld + +*** Test Case *** REGISTRATION_ID FRAGMENT_FILENAME +005_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld +005_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld +005_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld +005_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld + +*** Keywords *** +Update Context Source + [Arguments] ${registration_id} ${fragment_filename} + [Documentation] Check that you cannot update a context source registration under some conditions + [Tags] mandatory + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Context Source Registration ${valid_registration_id} + +Setup Initial Entities + ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${valid_registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot new file mode 100644 index 00000000..9ba06b7b --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration if the request body is invalid +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= registration-sample.jsonld +${registration_payload_file_path}= registration-invalid-sample.jsonld + +*** Test Case *** +005_04_Update a context source registration if the request body is invalid + [Documentation] Check that you cannot update a context source registration if the request body is invalid + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot new file mode 100644 index 00000000..2b64dbc4 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration by id if the id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= registration-sample.jsonld +${registration_payload_file_path}= registration-invalid-sample.jsonld + +*** Test Case *** +006_Update a context source registration by id if the id is not known to the system + [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/csourceRegistrations/registration-different-type-sample.jsonld b/data/csourceRegistrations/registration-different-type-sample.jsonld new file mode 100644 index 00000000..80945e1f --- /dev/null +++ b/data/csourceRegistrations/registration-different-type-sample.jsonld @@ -0,0 +1,43 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "building", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": " 2017-11-29T14:53:15Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 0c4ec21f..4e4ccb2d 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -194,6 +194,23 @@ Create Context Source Registration Using Session Output ${response.json()} [return] ${response} +Update Context Source Registration + [Arguments] ${registration_id} ${fragment} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} + ${request}= Output request + Output response + [return] ${response} + +Update Context Source Registration Using Session + [Arguments] ${registration_id} ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any + ${request}= Output request + Output response + [return] ${response} Delete Context Source Registration [Arguments] ${registration_id} -- GitLab From f96f99e94766c1f60d57d1bc131462eff68b25ee Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 25 Jan 2021 17:49:29 +0000 Subject: [PATCH 097/442] fixed minor bug --- .../Registration/UpdateContextSourceRegistration/006.robot | 1 - 1 file changed, 1 deletion(-) diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot index 2b64dbc4..952d8c5a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot @@ -7,7 +7,6 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld -${registration_payload_file_path}= registration-invalid-sample.jsonld *** Test Case *** 006_Update a context source registration by id if the id is not known to the system -- GitLab From e465120dd4a7aed96f34cbfef63930c805897700 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 25 Jan 2021 18:43:22 +0000 Subject: [PATCH 098/442] added delete context source registration suite --- .../DeleteContextSourceRegistration/007.robot | 23 +++++++++++++ .../DeleteContextSourceRegistration/008.robot | 32 +++++++++++++++++++ .../DeleteContextSourceRegistration/009.robot | 20 ++++++++++++ .../UpdateContextSourceRegistration/006.robot | 2 +- 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot new file mode 100644 index 00000000..210db5b9 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you can delete a context source registration by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-sample.jsonld + +*** Test Case *** +Delete a context source registration by id + [Documentation] Check that you can delete a context source registration by id + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Context Source Registration ${registration_id} + Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot new file mode 100644 index 00000000..b76f552f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot delete a context source registration under some conditions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Context Source + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= registration-sample.jsonld + +*** Test Case *** INVALID_REGISTRATION_ID +008_01_Delete a Context Source Registration if the Id is not present ${EMPTY} +008_02_Delete a Context Source Registration if the Id is not a valid URI invalidURI + +*** Keywords *** +Delete Context Source + [Arguments] ${invalid_registration_id} + [Documentation] Check that you cannot delete a context source registration under some conditions + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Context Source Registration ${invalid_registration_id} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot new file mode 100644 index 00000000..dedbc95c --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Check that you cannot update a context source registration by id if the id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-sample.jsonld + +*** Test Case *** +Delete a context source registration by id + [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Delete Context Source Registration ${registration_id} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot index 952d8c5a..61b079cf 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot @@ -16,7 +16,7 @@ ${filename}= registration-sample.jsonld ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${registration_id} -- GitLab From c7c5ad98d7f120df2bd62e6f2309d6d48c2931ec Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 26 Jan 2021 08:18:04 +0000 Subject: [PATCH 099/442] fixed minor bugs --- .../Registration/DeleteContextSourceRegistration/009.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot index dedbc95c..33768c9d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot update a context source registration by id if the id is not known to the system +Documentation Check that you cannot delete a context source registration by id if the id is not known to the system Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -11,7 +11,7 @@ ${registration_payload_file_path}= registration-sample.jsonld *** Test Case *** Delete a context source registration by id - [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system + [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system [Tags] mandatory ${registration_id}= Generate Random Entity Id ${registration_id_prefix} -- GitLab From 6dea859890f912886752b675bbf0ac0f627e3b6c Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 29 Jan 2021 12:38:46 +0000 Subject: [PATCH 100/442] fixed some tests --- .../Provision/EntityAttributes/001.robot | 10 ++-- .../Provision/EntityAttributes/004.robot | 8 ++-- .../Provision/EntityAttributes/010.robot | 12 ++--- .../Provision/EntityAttributes/011.robot | 4 +- .../Provision/EntityAttributes/012.robot | 4 +- .../Provision/TemporalEntity/001.robot | 27 +++++++++++ .../001_01.robot | 2 +- .../001_02.robot | 2 +- .../001_03.robot | 2 +- .../CreateContextSourceRegistration/002.robot | 2 +- .../CreateContextSourceRegistration/003.robot | 4 +- .../DeleteContextSourceRegistration/007.robot | 4 +- .../DeleteContextSourceRegistration/008.robot | 4 +- .../DeleteContextSourceRegistration/009.robot | 2 +- .../UpdateContextSourceRegistration/004.robot | 4 +- .../UpdateContextSourceRegistration/005.robot | 4 +- .../005_05.robot | 2 +- .../UpdateContextSourceRegistration/006.robot | 2 +- ...ibutes-sample-append-expectation-01.jsonld | 3 -- ...tes-sample-append-expectation-03-04.jsonld | 30 ------------ ...id-attributes-sample-expectation-01.jsonld | 0 ...gment-attribute-name-missing-sample.jsonld | 4 +- ...ual-datasetid-different-type-sample.jsonld | 4 +- ...cle-fragment-equal-datasetid-sample.jsonld | 4 +- ...fied-temporal-representation-sample.jsonld | 22 +++++++++ ...icle-temporal-representation-sample.jsonld | 48 +++++++++++++++++++ ...epresentation-withou-context-sample.jsonld | 44 +++++++++++++++++ resources/ApiUtils.resource | 19 ++++++-- resources/AssertionUtils.resource | 2 + 29 files changed, 197 insertions(+), 82 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot delete mode 100644 data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld delete mode 100644 data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld delete mode 100644 data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld create mode 100644 data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot index 12d0fb6d..d6c2eaff 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot @@ -11,16 +11,16 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME -001_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-01.jsonld +001_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld ${EMPTY} 001_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld -001_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld -001_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-03-04.jsonld +001_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} +001_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} *** Keywords *** Append Attributes [Arguments] ${status_code} ${overwrite} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -28,6 +28,6 @@ Append Attributes ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${overwrite} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Content ${expectation_filename} ${response['body']} + Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot index 4a2dc46d..196c26bc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot @@ -11,10 +11,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME -004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld -004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld vehicle-two-datasetid-attributes-sample-expectation-01.jsonld +004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld ${EMPTY} +004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld ${EMPTY} 004_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld -004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld vehicle-two-datasetid-attributes-sample-expectation-04.jsonld +004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld ${EMPTY} *** Keywords *** Update Attributes @@ -28,6 +28,6 @@ Update Attributes ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Content ${expectation_filename} ${response['body']} + Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot index 83c959c5..069230f5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot @@ -4,21 +4,21 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Append Attributes +Test Template Delete Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${status_code}= 204 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${attribute_id}= speed +${attribute_id}= 'https://uri.fiware.org/ns/data-models#speed' *** Test Cases *** DATASETID DELETEALL -010_01_delete an attribute with the id ${EMPTY} ${EMPTY} -010_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed ${EMPTY} +010_01_delete an attribute with the id ${EMPTY} False +010_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed False 010_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed True *** Keywords *** -Append Attributes +Delete Attributes [Arguments] ${datasetId} ${deleteAll} [Documentation] Check that you can delete an attribute from an entity [Tags] mandatory failing @@ -26,7 +26,7 @@ Append Attributes ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - + Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot index ebdd033b..0fe427c1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot @@ -5,7 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities -Test Template Append Attributes +Test Template Delete Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -18,7 +18,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld 011_03_delete an attribute if the Attribute Name is not present ${valid_entity_id} ${EMPTY} *** Keywords *** -Append Attributes +Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot index 1b64141a..de8dde45 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot @@ -5,7 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities -Test Template Append Attributes +Test Template Delete Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -18,7 +18,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld 012_03_delete an attribute when the Entity does not contain the target attribute with same datasetId ${valid_entity_id} speed urn:ngsi-ld:Property:notFound *** Keywords *** -Append Attributes +Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot new file mode 100644 index 00000000..b0743d7f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Check that you can create a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_Create a temporal representation of an entity with simplified temporal representation of an Entity vehicle-simplified-temporal-representation-sample.jsonld application/json +001_02_Create a temporal representation of an entity with simple temporal properties vehicle-temporal-representation-sample.jsonld application/ld+json +001_03_Create an temporal entity with no context vehicle-temporal-representation-withou-context-sample.jsonld application/ld+json + +*** Keywords *** +Create Temporal Entity + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + Check Response Status Code 201 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot index b416b584..48beab75 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot @@ -17,7 +17,7 @@ Create Context Source Registration With Specific Date Expiration Date ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot index 61fed06c..a45c6ec9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot @@ -17,7 +17,7 @@ Create Context Source Registration That Never Expires ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot index bafec59a..32d8e4f0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot @@ -15,7 +15,7 @@ Create Context Source Registration Without A Sprecified ID [Tags] mandatory ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${request} ${response}= Create Context Source Registration ${payload} + ${request} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot index 78b751ee..a5d629f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot @@ -23,7 +23,7 @@ Create Context Source With Invalid Content ${payload}= Load Json From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 400 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot index 8eabac9e..4274214e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot @@ -16,10 +16,10 @@ Create a context source registration that already exists ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 409 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot index 210db5b9..59485637 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot @@ -16,8 +16,8 @@ Delete a context source registration by id ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${response}= Delete Context Source Registration ${registration_id} + ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot index b76f552f..e6ec0f24 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot @@ -22,10 +22,10 @@ Delete Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${response}= Delete Context Source Registration ${invalid_registration_id} + ${response}= Delete Context Source Registration With Return ${invalid_registration_id} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot index 33768c9d..b9406805 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot @@ -15,6 +15,6 @@ Delete a context source registration by id [Tags] mandatory ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${response}= Delete Context Source Registration ${registration_id} + ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot index a7aa85cd..e78cef49 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot @@ -21,12 +21,12 @@ Update Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} Check Response Status Code 204 ${response['status']} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot index 265f1d82..d6c7cc0b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot @@ -24,12 +24,12 @@ Update Context Source [Tags] mandatory ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot index 9ba06b7b..21cfb6f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot @@ -16,7 +16,7 @@ ${registration_payload_file_path}= registration-invalid-sample.jsonld ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration ${updated_payload} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot index 61b079cf..87ba775a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot @@ -15,7 +15,7 @@ ${filename}= registration-sample.jsonld ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld deleted file mode 100644 index 544b7b4d..00000000 --- a/data/entities/expectations/vehicle-attributes-sample-append-expectation-01.jsonld +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld b/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld deleted file mode 100644 index e29f4875..00000000 --- a/data/entities/expectations/vehicle-attributes-sample-append-expectation-03-04.jsonld +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Mercedes" - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - } - }, - "speed": { - "type": "Property", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-01.jsonld deleted file mode 100644 index e69de29b..00000000 diff --git a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld index 10e3efd8..76037606 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld @@ -12,8 +12,6 @@ "type": "Property", "value": "BMW" }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld index 05e676e6..bb28f7b3 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld @@ -8,8 +8,6 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld index 6a85b902..9b220bf4 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld @@ -8,8 +8,6 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld new file mode 100644 index 00000000..a0f6fe04 --- /dev/null +++ b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "values": [ + ["Volvo",""] + ] + }, + "speed": { + "type": "Property", + "values": [ + [120,"2018-08-01T12:03:00Z"], + [80,"2018-08-01T12:05:00Z"], + [100,"2018-08-01T12:07:00Z"] + ] + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld new file mode 100644 index 00000000..4f095bf1 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld new file mode 100644 index 00000000..e3dba459 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld @@ -0,0 +1,44 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 1256b7b1..d3fdfa44 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -163,7 +163,7 @@ Delete Entity Attributes &{params}= Create Dictionary Run Keyword If '${datasetId}'!='' Set To Dictionary ${params} datasetId=${datasetId} Run Keyword If '${deleteAll}'!='' Set To Dictionary ${params} deletelAll=${deleteAll} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} headers=${headers} parameter=${params} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}/?datasetId='${datasetId}' headers=${headers} Output request Output response [return] ${response} @@ -177,7 +177,7 @@ Partial Update Entity Attributes Output response [return] ${response} -Create Context Source Registration +Create Context Source Registration With Return [Arguments] ${payload} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} @@ -194,7 +194,7 @@ Create Context Source Registration Using Session Output ${response.json()} [return] ${response} -Update Context Source Registration +Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} @@ -212,7 +212,7 @@ Update Context Source Registration Using Session Output response [return] ${response} -Delete Context Source Registration +Delete Context Source Registration With Return [Arguments] ${registration_id} ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} Output request @@ -228,6 +228,17 @@ Create Entity Output request Output response +Create Temporal Representation Of Entity Selecting Content Type + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} + ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + Output request + Output response + [return] ${response} + Batch Create Entities [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 89ca3ddb..415a2d02 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -31,6 +31,8 @@ Check Response Body Containing Array Of URIs set to Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + Output ${response_body} + Output ${entity_payload} ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=Entity Comparaison Failed -- GitLab From a50ef884c49d9ccd8ad801647e33c8a58e3223f3 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 1 Feb 2021 12:09:23 +0000 Subject: [PATCH 101/442] added common behaviours test --- TP/NGSI-LD/CommonBehaviours/043.robot | 28 +++++++++++ ...registration-without-context-sample.jsonld | 14 ++++++ ...subscription-without-context-sample.jsonld | 16 +++++++ ...presentation-without-context-sample.jsonld | 48 +++++++++++++++++++ resources/ApiUtils.resource | 10 ++++ 5 files changed, 116 insertions(+) create mode 100644 TP/NGSI-LD/CommonBehaviours/043.robot create mode 100644 data/csourceRegistrations/context-source-registration-without-context-sample.jsonld create mode 100644 data/csourceSubscriptions/subscription-without-context-sample.jsonld create mode 100644 data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot new file mode 100644 index 00000000..072e0528 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Get Entity With Invalid/Missing Id + +*** Variable *** +${expected_status_code}= 503 + +*** Test Cases *** ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +#043_02_endpoint /csourceRegistrations/ ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +#043_03_endpoint /subscriptions/ ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +#043_04_endpoint /csourceSubscriptions/ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +#043_05_endpoint /temporal/entities/ ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + +*** Keywords *** +Get Entity With Invalid/Missing Id + [Arguments] ${endpoint} ${filename_path} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + [Tags] mandatory + + ${response}= Create Request By Selecting Endpoint ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld b/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld new file mode 100644 index 00000000..b4a6b06e --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld @@ -0,0 +1,14 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-context-sample.jsonld b/data/csourceSubscriptions/subscription-without-context-sample.jsonld new file mode 100644 index 00000000..36860f5b --- /dev/null +++ b/data/csourceSubscriptions/subscription-without-context-sample.jsonld @@ -0,0 +1,16 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld new file mode 100644 index 00000000..22efffc5 --- /dev/null +++ b/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":[ + { + "type":"Property", + "value":"Mercedes" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 1256b7b1..1e1527f7 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -17,6 +17,7 @@ ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations +${SUBSCRIPTION_ENDPOINT_PATH} subscriptions/ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions ${CONTENT_TYPE_JSON} application/json @@ -26,6 +27,7 @@ ${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadReques ${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest ${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} http://uri.etsi.org/ngsi-ld/errors/LDContextNotAvailable ${response} @@ -219,6 +221,14 @@ Delete Context Source Registration Output response [return] ${response} +Create Request By Selecting Endpoint + [Arguments] ${endpoint} ${filename_path} + ${entity_payload}= Load Json From File ${EXECDIR}/data/${filename_path} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${entity} headers=${headers} + Output response + Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} -- GitLab From f102c281b478cb632166290464340d7e24757675 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 2 Feb 2021 10:37:49 +0000 Subject: [PATCH 102/442] common behaviours --- TP/NGSI-LD/CommonBehaviours/043.robot | 30 +++++++----- TP/NGSI-LD/CommonBehaviours/044_01.robot | 47 +++++++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_02.robot | 46 ++++++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_03.robot | 46 ++++++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_04.robot | 46 ++++++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_05.robot | 46 ++++++++++++++++++ ...presentation-without-context-sample.jsonld | 4 -- resources/ApiUtils.resource | 32 ++++++++++--- 8 files changed, 275 insertions(+), 22 deletions(-) create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_02.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_03.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_04.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_05.robot diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 072e0528..fe35908c 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -4,25 +4,33 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Get Entity With Invalid/Missing Id +Test Template Throw 503 LDContextNotAvaliable error *** Variable *** ${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: -*** Test Cases *** ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -#043_02_endpoint /csourceRegistrations/ ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -#043_03_endpoint /subscriptions/ ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -#043_04_endpoint /csourceSubscriptions/ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -#043_05_endpoint /temporal/entities/ ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld +*** Test Cases *** PREFIX DELETE_PREFIX ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${building_id_prefix} ${EMPTY} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +043_02_endpoint /csourceRegistrations/ ${registration_id_prefix} ${EMPTY} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +043_03_endpoint /subscriptions/ ${subscription_id_prefix} ${EMPTY} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_04_endpoint /csourceSubscriptions/ ${subscription_id_prefix} / ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_05_endpoint /temporal/entities/ ${building_id_prefix} / ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld *** Keywords *** -Get Entity With Invalid/Missing Id - [Arguments] ${endpoint} ${filename_path} +Throw 503 LDContextNotAvaliable error + [Arguments] ${prefix} ${delete_prefix} ${endpoint} ${filename_path} [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved [Tags] mandatory - ${response}= Create Request By Selecting Endpoint ${endpoint} ${filename_path} + ${create_id}= Generate Random Entity Id ${prefix} + ${delete_id}= Set Variable ${delete_prefix}${create_id} + + ${response}= Create Request By Selecting Endpoint ${create_id} ${endpoint} ${filename_path} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot new file mode 100644 index 00000000..440d958a --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids +Test Template Throw 503 LDContextNotAvaliable error + +*** Variable *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: + +*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH +044_01_01_endpoint /entities/{entityId}/attrs/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH}{entityId}/attrs/ entities/building-minimal-without-context-sample.jsonld +044_01_02_endpoint /entities/{entityId}/attrs/{attrId} ${csourceRegistration_id} ${csourceRegistration_id} /entities/{entityId}/attrs/{attrId} csourceRegistrations/context-source-registration-without-context-sample.jsonld +044_01_03_endpoint /subscriptions/{subscriptionId} ${subscription_id} ${subscription_id} /subscriptions/{subscriptionId} csourceSubscriptions/subscription-without-context-sample.jsonld +044_01_04_endpoint /csourceRegistrations/{registrationId} ${csourceSubscription_id} ${csourceSubscription_id} /csourceRegistrations/{registrationId} csourceSubscriptions/subscription-without-context-sample.jsonld +044_01_05_endpoint /csourceSubscriptions/{subscriptionId} ${temporal_entity_id} ${temporal_entity_id} /csourceSubscriptions/{subscriptionId} temporalEntities/bus-temporal-representation-without-context-sample.jsonld +044_01_06_endpoint /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} + +*** Keywords *** +PATCH HTTP requests via "application/merge-patch+json" + [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + + ${response}= Merge Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} + +Generate Random Ids + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} + ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${entity_id} + Set Suite Variable ${temporal_entity_id} + Set Suite Variable ${csourceRegistration_id} + Set Suite Variable ${csourceSubscription_id} + Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot new file mode 100644 index 00000000..0db0694c --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids +Test Template Throw 503 LDContextNotAvaliable error + +*** Variable *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: + +*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + +*** Keywords *** +Throw 503 LDContextNotAvaliable error + [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + [Tags] mandatory + + ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} + +Generate Random Ids + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} + ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${entity_id} + Set Suite Variable ${temporal_entity_id} + Set Suite Variable ${csourceRegistration_id} + Set Suite Variable ${csourceSubscription_id} + Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot new file mode 100644 index 00000000..0db0694c --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids +Test Template Throw 503 LDContextNotAvaliable error + +*** Variable *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: + +*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + +*** Keywords *** +Throw 503 LDContextNotAvaliable error + [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + [Tags] mandatory + + ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} + +Generate Random Ids + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} + ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${entity_id} + Set Suite Variable ${temporal_entity_id} + Set Suite Variable ${csourceRegistration_id} + Set Suite Variable ${csourceSubscription_id} + Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot new file mode 100644 index 00000000..0db0694c --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids +Test Template Throw 503 LDContextNotAvaliable error + +*** Variable *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: + +*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + +*** Keywords *** +Throw 503 LDContextNotAvaliable error + [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + [Tags] mandatory + + ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} + +Generate Random Ids + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} + ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${entity_id} + Set Suite Variable ${temporal_entity_id} + Set Suite Variable ${csourceRegistration_id} + Set Suite Variable ${csourceSubscription_id} + Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot new file mode 100644 index 00000000..0db0694c --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids +Test Template Throw 503 LDContextNotAvaliable error + +*** Variable *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${registration_id_prefix}= urn:ngsi-ld:Registration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: + +*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH +043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld +043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld +043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld +043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + +*** Keywords *** +Throw 503 LDContextNotAvaliable error + [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved + [Tags] mandatory + + ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} + +Generate Random Ids + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} + ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${entity_id} + Set Suite Variable ${temporal_entity_id} + Set Suite Variable ${csourceRegistration_id} + Set Suite Variable ${csourceSubscription_id} + Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld index 22efffc5..9a70e2bd 100644 --- a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld +++ b/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld @@ -40,9 +40,5 @@ "value":124, "observedAt":"2020-08-01T14:07:00Z" } - ], - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 1e1527f7..ef40ee55 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -179,7 +179,7 @@ Partial Update Entity Attributes Output response [return] ${response} -Create Context Source Registration +Create Context Source Registration With Return [Arguments] ${payload} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} @@ -196,7 +196,7 @@ Create Context Source Registration Using Session Output ${response.json()} [return] ${response} -Update Context Source Registration +Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} @@ -214,7 +214,7 @@ Update Context Source Registration Using Session Output response [return] ${response} -Delete Context Source Registration +Delete Context Source Registration With Return [Arguments] ${registration_id} ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} Output request @@ -222,11 +222,29 @@ Delete Context Source Registration [return] ${response} Create Request By Selecting Endpoint - [Arguments] ${endpoint} ${filename_path} - ${entity_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + [Arguments] ${id} ${endpoint} ${filename_path} + ${item_payload}= Load Json From File ${EXECDIR}/data/${filename_path} + ${item}= Update Value To Json ${item_payload} $..id ${id} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${item} headers=${headers} + Output request + Output response + [return] ${response} + +Merge Request By Selecting Endpoint + [Arguments] ${id} ${endpoint} ${filename_path} + ${item_payload}= Load Json From File ${EXECDIR}/data/${filename_path} + ${item}= Update Value To Json ${item_payload} $..id ${id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${entity} headers=${headers} + ${response}= POST ${endpoint} body=${item} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Request By Selecting Endpoint/Id + [Arguments] ${id} ${delete_endpoint} + ${response}= DELETE ${delete_endpoint}${id} + Output request Output response Create Entity -- GitLab From 456872aa1e4b3d56f6e743c2757e5c76a10387cc Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 2 Feb 2021 16:34:21 +0000 Subject: [PATCH 103/442] tests renumbering and some fixes --- .../Entity/{001_01.robot => 018_01_01.robot} | 2 +- .../Entity/{001_02.robot => 018_01_02.robot} | 2 +- .../Entity/{001_03.robot => 018_01_03.robot} | 2 +- .../Consumption/Entity/{002.robot => 018_02.robot} | 4 ++-- .../Entity/{003_01.robot => 018_03_01.robot} | 2 +- .../Entity/{003_02.robot => 018_03_02.robot} | 2 +- .../Consumption/Entity/{004.robot => 018_04.robot} | 2 +- .../Consumption/Entity/{005.robot => 018_05.robot} | 2 +- .../Entity/{006_01.robot => 019_01_01.robot} | 2 +- .../Entity/{006_02.robot => 019_01_02.robot} | 2 +- .../Entity/{006_03.robot => 019_01_03.robot} | 2 +- .../Entity/{006_04.robot => 019_01_04.robot} | 2 +- .../Entity/{006_05.robot => 019_01_05.robot} | 2 +- .../Entity/{007_01.robot => 019_02_01.robot} | 2 +- .../Entity/{007_02.robot => 019_02_02.robot} | 2 +- .../Entity/{007_03.robot => 019_02_03.robot} | 2 +- .../Entity/{007_04.robot => 019_02_04.robot} | 2 +- .../Entity/{007_05.robot => 019_02_05.robot} | 2 +- .../Entity/{008_01.robot => 019_03_01.robot} | 2 +- .../Entity/{008_02.robot => 019_03_02.robot} | 2 +- .../Entity/{008_03.robot => 019_03_03.robot} | 2 +- .../Entity/{008_04.robot => 019_03_04.robot} | 2 +- .../Entity/{008_05.robot => 019_03_05.robot} | 2 +- .../Consumption/Entity/{009.robot => 019_04.robot} | 2 +- .../Consumption/Entity/{010.robot => 019_05.robot} | 2 +- .../Consumption/Entity/{011.robot => 019_06.robot} | 2 +- .../CreateEntity/{001.robot => 001_01.robot} | 10 +++++----- .../CreateEntity/{002.robot => 001_02.robot} | 6 +++--- .../CreateEntity/{003.robot => 001_03.robot} | 0 .../DeleteEntity/{004.robot => 002_01.robot} | 2 +- .../DeleteEntity/{005.robot => 002_02.robot} | 4 ++-- .../DeleteEntity/{006.robot => 002_03_.robot} | 2 +- .../EntityAttributes/{001.robot => 010_01.robot} | 8 ++++---- .../EntityAttributes/{002.robot => 010_02.robot} | 4 ++-- .../{002_03.robot => 010_02_03.robot} | 0 .../EntityAttributes/{003.robot => 010_03.robot} | 2 +- .../EntityAttributes/{004.robot => 011_01.robot} | 8 ++++---- .../EntityAttributes/{005.robot => 011_02.robot} | 4 ++-- .../{005_03.robot => 011_02_03.robot} | 0 .../EntityAttributes/{006.robot => 011_04.robot} | 2 +- .../EntityAttributes/{007.robot => 012_01.robot} | 4 ++-- .../EntityAttributes/{008.robot => 012_02.robot} | 12 ++++++------ .../EntityAttributes/{009.robot => 012_03.robot} | 11 +++++------ .../EntityAttributes/{010.robot => 013_01.robot} | 14 +++++++------- .../EntityAttributes/{011.robot => 013_02.robot} | 14 +++++++------- .../EntityAttributes/{012.robot => 013_03.robot} | 12 ++++++------ .../{001_01.robot => 033_01_01.robot} | 0 .../{001_02.robot => 033_01_02.robot} | 0 .../{001_03.robot => 033_01_03.robot} | 0 .../{002.robot => 033_02.robot} | 4 ++-- .../{002_01.robot => 033_02_01.robot} | 0 .../{003.robot => 033_03.robot} | 0 .../{007.robot => 035_01.robot} | 0 .../{008.robot => 035_02.robot} | 4 ++-- .../{009.robot => 035_03.robot} | 0 .../{004.robot => 034_01.robot} | 4 ++-- .../{005.robot => 034_02.robot} | 8 ++++---- .../{005_05.robot => 034_02_05.robot} | 2 +- .../{006.robot => 034_03.robot} | 2 +- ...hicle-two-datasetid-attributes-sample-01.jsonld | 1 - ...hicle-two-datasetid-attributes-sample-02.jsonld | 1 - ...hicle-two-datasetid-attributes-sample-03.jsonld | 1 - ...hicle-two-datasetid-attributes-sample-04.jsonld | 1 - .../vehicle-two-datasetid-attributes-sample.jsonld | 4 +--- resources/ApiUtils.resource | 8 ++------ 65 files changed, 101 insertions(+), 112 deletions(-) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{001_01.robot => 018_01_01.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{001_02.robot => 018_01_02.robot} (96%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{001_03.robot => 018_01_03.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{002.robot => 018_02.robot} (74%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{003_01.robot => 018_03_01.robot} (89%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{003_02.robot => 018_03_02.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{004.robot => 018_04.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{005.robot => 018_05.robot} (94%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{006_01.robot => 019_01_01.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{006_02.robot => 019_01_02.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{006_03.robot => 019_01_03.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{006_04.robot => 019_01_04.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{006_05.robot => 019_01_05.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{007_01.robot => 019_02_01.robot} (94%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{007_02.robot => 019_02_02.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{007_03.robot => 019_02_03.robot} (96%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{007_04.robot => 019_02_04.robot} (96%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{007_05.robot => 019_02_05.robot} (96%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{008_01.robot => 019_03_01.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{008_02.robot => 019_03_02.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{008_03.robot => 019_03_03.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{008_04.robot => 019_03_04.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{008_05.robot => 019_03_05.robot} (97%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{009.robot => 019_04.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{010.robot => 019_05.robot} (94%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{011.robot => 019_06.robot} (95%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/{001.robot => 001_01.robot} (58%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/{002.robot => 001_02.robot} (75%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/{003.robot => 001_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/{004.robot => 002_01.robot} (97%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/{005.robot => 002_02.robot} (76%) rename TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/{006.robot => 002_03_.robot} (91%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{001.robot => 010_01.robot} (69%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{002.robot => 010_02.robot} (88%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{002_03.robot => 010_02_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{003.robot => 010_03.robot} (93%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{004.robot => 011_01.robot} (65%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{005.robot => 011_02.robot} (87%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{005_03.robot => 011_02_03.robot} (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{006.robot => 011_04.robot} (93%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{007.robot => 012_01.robot} (79%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{008.robot => 012_02.robot} (61%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{009.robot => 012_03.robot} (68%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{010.robot => 013_01.robot} (64%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{011.robot => 013_02.robot} (62%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{012.robot => 013_03.robot} (62%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{001_01.robot => 033_01_01.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{001_02.robot => 033_01_02.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{001_03.robot => 033_01_03.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{002.robot => 033_02.robot} (77%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{002_01.robot => 033_02_01.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/{003.robot => 033_03.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/{007.robot => 035_01.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/{008.robot => 035_02.robot} (88%) rename TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/{009.robot => 035_03.robot} (100%) rename TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/{004.robot => 034_01.robot} (83%) rename TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/{005.robot => 034_02.robot} (70%) rename TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/{005_05.robot => 034_02_05.robot} (95%) rename TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/{006.robot => 034_03.robot} (93%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot index f6aeac9c..381f3b60 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot @@ -10,7 +10,7 @@ ${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld *** Test Cases *** -001_01_Get an entity by id +018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 8b97f073..d73cf3a1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -12,7 +12,7 @@ ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityL ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** -001_02_Query some attributes from an entity +018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot index 76f6b0ed..8ccd23fa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot @@ -11,7 +11,7 @@ ${expectation_filename}= building-location-attribute-sample-expectation-query-g ${geometry_property}= location *** Test Cases *** -001_03_Query the geometry property from an entity +018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot similarity index 74% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index 282a9b00..f91428d6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Get Entity With Invalid/Missing Id *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -002_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +018_02_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +018_02_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Get Entity With Invalid/Missing Id diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot similarity index 89% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 59647fef..3349a57a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** -003_01_Get an entity if the Entity Id is not known to the system +Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index fd207890..164e4581 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -10,7 +10,7 @@ ${filename}= building-simple-attributes-sample.jsonld ${attribute_not_known}= property_not_found *** Test Cases *** -003_02_Get an entity if an atris not known to the system +Get an entity if an atris not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index b74f19dd..ce5a82b2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -11,7 +11,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation-simplifi ${options_parameter}= keyValues *** Test Cases *** -004_Get an entity in a simplified representation +Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot similarity index 94% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index c81cc37a..8ee32f94 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/005.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -12,7 +12,7 @@ ${options_parameter}= keyValues ${accept_header}= application/geo+json *** Test Cases *** -005_Get an entity by id that can be returned in a geoJSON format +Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 441ef1eb..075a6e08 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -11,7 +11,7 @@ ${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** -006_01_Query several entities based on ids +Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index be7e684a..a32ec395 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -18,7 +18,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** -006_02_Query several entities based on the entities types +Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index 7f1ef6db..f97279c1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** -006_03_Query several entities based on the given id pattern +Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index 18f59109..afb3db77 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -13,7 +13,7 @@ ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityL ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** -006_04_Query several entities based on attribute names +Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index f4c4ac63..07cfb0ff 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/006_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location *** Test Cases *** -006_05_Query several entities based on a list of properties +Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot similarity index 94% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index b18df22b..6d6f8cb1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -11,7 +11,7 @@ ${expectation_filename}= building-minimal-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** -007_01_Query several entities via POST Interaction based on ids +Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index 6f404862..c9717c56 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -18,7 +18,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** -007_02_Query several entities via POST Interaction based on the entities types +Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index fa7d2d66..32e200c0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** -007_03_Query several entities via POST Interaction based on the given id pattern +Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 60e03dda..82b7a91e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -13,7 +13,7 @@ ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityL ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** -006_04_Query several entities via POST Interaction based on attribute names +Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index a7ec401a..79e1ce2c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/007_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location *** Test Cases *** -006_05_Query several entities via POST Interaction based on a list of properties +Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index 569d2723..f1f322cb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -12,7 +12,7 @@ ${entity_invalid_id_one}= thisisaninvaliduri1 ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** -008_01_Query entities based on incorrect ids +Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index c598a04d..fbe5ef33 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -14,7 +14,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** -008_02_Query entities based on incorrect entity types +Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 999e6a45..87739e2b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -11,7 +11,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** -008_03_Query several entities based on incorrect id pattern +Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index 86368ca9..bceffdaf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -12,7 +12,7 @@ ${invalid_attribute_one}= invalid_attribute_one ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** -008_04_Query several entities based on incorrect attribute names +Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index b29b3ffc..a89e2924 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/008_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -11,7 +11,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** -008_05_Query several entities based on a list of properties +Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index a5ec04bd..4deb4252 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/009.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -12,7 +12,7 @@ ${options_parameter}= keyValues ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** -009_Query entities in a simplified representation +Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot similarity index 94% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index c9df1913..6c07b580 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/010.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${accept_header}= application/geo+json *** Test Cases *** -010_Get an entity by id that can be returned in a geoJSON format +Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index 0c84970a..d9659dd3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/011.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -12,7 +12,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${limit}= 2 *** Test Cases *** -011_Query entities specifying a maximum number of results +Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot similarity index 58% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 6fa0cd12..2dc442b9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -10,11 +10,11 @@ Test Template Create Entity Scenarios ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME CONTENT_TYPE -001_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json -001_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json -001_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -001_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json -001_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json +001_01_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json +001_01_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json +001_01_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json +001_01_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json +001_01_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json *** Keywords *** Create Entity Scenarios diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot similarity index 75% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index e552177c..afcaa3c1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/002.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -6,9 +6,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios *** Test Cases *** FILENAME -002_01_InvalidJson invalid-json-sample.jsonld -002_02_EmptyJson empty-sample.jsonld -002_03_EntityWithNoContext building-minimal-without-context-sample.jsonld +001_02_01_InvalidJson invalid-json-sample.jsonld +001_02_02_EmptyJson empty-sample.jsonld +001_02_03_EntityWithNoContext building-minimal-without-context-sample.jsonld *** Keywords *** Create Entity With Invalid Request Scenarios diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index ca6c0422..a476e0f0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** -004_Delete an entity +Delete an entity [Documentation] Check that you can delete an entity by id [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot similarity index 76% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 1a0ee934..758ed56a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -11,8 +11,8 @@ ${entity_id_empty}= ${entity_id_not_valid}= thisisaninvaliduri *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -005_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -005_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03_.robot similarity index 91% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03_.robot index b71875cf..1c29651d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03_.robot @@ -9,7 +9,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${expected_status_code}= 404 *** Test Case *** -006_Delete an entity with an id not known to the system +Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot similarity index 69% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index d6c2eaff..3991a51a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/001.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -11,10 +11,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME -001_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld ${EMPTY} -001_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld -001_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} -001_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} +010_01_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld ${EMPTY} +010_01_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld +010_01_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} +010_01_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} *** Keywords *** Append Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot similarity index 88% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 66fa4348..2e059f80 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -13,8 +13,8 @@ ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld ${status_code}= 400 *** Test Cases *** ENTITY_INVALID_ID -002_01_Append entity attributes if the entity Id is not present ${EMPTY} -002_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri +010_02_01_Append entity attributes if the entity Id is not present ${EMPTY} +010_02_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri *** Keywords *** Append Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/002_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot similarity index 93% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 7553785b..155aa02c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/003.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -9,7 +9,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld *** Test Cases *** -003_Append entity attributes when the entity id is not known to the system +Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system [Tags] mandatory failing diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot similarity index 65% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index 196c26bc..58c836c2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/004.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -11,10 +11,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME -004_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld ${EMPTY} -004_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld ${EMPTY} -004_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld -004_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld ${EMPTY} +011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld ${EMPTY} +011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld ${EMPTY} +011_01_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld +011_01_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld ${EMPTY} *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot similarity index 87% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index c3ca676d..851ec9ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -12,8 +12,8 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld *** Test Cases *** STATUS_CODE ENTITY_INVALID_ID -005_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} -005_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri +011_02_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} +011_02_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/005_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot similarity index 93% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot index 6b1bea6a..e8816488 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/006.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot @@ -9,7 +9,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld *** Test Cases *** -006_Update entity attributes when the entity id is not known to the system +Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot similarity index 79% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index ea2fb14a..6c379833 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/007.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -13,8 +13,8 @@ ${attribute_id}= speed ${status_code}= 204 *** Test Cases *** FRAGMENT_FILENAME -007_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld -007_02_CCheck that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld +012_01_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot similarity index 61% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index 8f9f0238..e9e74050 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/008.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -13,12 +13,12 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${status_code}= 400 *** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -008_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-fragment-equal-datasetid-sample.jsonld -008_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-fragment-equal-datasetid-sample.jsonld -008_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-fragment-attribute-name-missing-sample.jsonld -008_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-fragment-equal-datasetid-sample.jsonld -008_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-fragment-equal-datasetid-different-type-sample.jsonld -008_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed vehicle-fragment-all-empty-sample.jsonld +012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-fragment-equal-datasetid-sample.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-fragment-equal-datasetid-sample.jsonld +012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-fragment-attribute-name-missing-sample.jsonld +012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-fragment-equal-datasetid-sample.jsonld +012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-fragment-equal-datasetid-different-type-sample.jsonld +012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed vehicle-fragment-all-empty-sample.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot similarity index 68% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index 807efc9d..e69df34a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/009.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -10,15 +10,14 @@ Test Template Partial Update Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld ${status_code}= 404 ${attribute_id}= speed -*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME -009_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-fragment-same-datasetid-sample.jsonld -009_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-fragment-invalid-datasetid-sample.jsonld -009_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-fragment-empty-datasetid-sample.jsonld -009_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-fragment-attribute-name-missing-sample.jsonld +*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME +012_03_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-fragment-same-datasetid-sample.jsonld +012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-fragment-invalid-datasetid-sample.jsonld +012_03_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-fragment-empty-datasetid-sample.jsonld +012_03_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-fragment-attribute-name-missing-sample.jsonld *** Keywords *** Partial Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot similarity index 64% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 069230f5..9ce044b2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -10,12 +10,12 @@ Test Template Delete Attributes ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${status_code}= 204 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${attribute_id}= 'https://uri.fiware.org/ns/data-models#speed' +${attribute_id}= speed -*** Test Cases *** DATASETID DELETEALL -010_01_delete an attribute with the id ${EMPTY} False -010_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed False -010_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed True +*** Test Cases *** DATASETID DELETEALL +013_01_01_delete an attribute with the id ${EMPTY} false +013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false +013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true *** Keywords *** Delete Attributes @@ -26,8 +26,8 @@ Delete Attributes ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot similarity index 62% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot index 0fe427c1..be253f2f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot @@ -12,10 +12,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${status_code}= 400 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -011_01_delete an attribute if the Entity Id is not present ${EMPTY} speed -011_02_delete an attribute if the Entity Id is not a valid URI thisIsAnInvalidURI speed -011_03_delete an attribute if the Attribute Name is not present ${valid_entity_id} ${EMPTY} +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +013_02_01_delete an attribute if the Entity Id is not present ${EMPTY} speed +013_02_02_delete an attribute if the Entity Id is not a valid URI thisIsAnInvalidURI speed +013_02_03_delete an attribute if the Attribute Name is not present ${valid_entity_id} ${EMPTY} *** Keywords *** Delete Attributes @@ -23,13 +23,13 @@ Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] mandatory failing - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} ${EMPTY} + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot similarity index 62% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot index de8dde45..7f527c1e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot @@ -12,10 +12,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${status_code}= 404 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID -012_01_delete an attribute when the Entity Id is not known to the system ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed -012_02_delete an attribute when the Entity does not contain the target attribute id ${valid_entity_id} notFound ${EMPTY} -012_03_delete an attribute when the Entity does not contain the target attribute with same datasetId ${valid_entity_id} speed urn:ngsi-ld:Property:notFound +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID +013_03_01_delete an attribute when the Entity Id is not known to the system ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +013_03_02_delete an attribute when the Entity does not contain the target attribute id ${valid_entity_id} notFound ${EMPTY} +013_03_03_delete an attribute when the Entity does not contain the target attribute with same datasetId ${valid_entity_id} speed urn:ngsi-ld:Property:notFound *** Keywords *** Delete Attributes @@ -23,10 +23,10 @@ Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] mandatory failing - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${EMPTY} + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_01.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_02.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/001_03.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot similarity index 77% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index a5d629f6..bd9a79ff 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -11,8 +11,8 @@ Test Template Create Context Source With Invalid Content ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME -002_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld -002_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld +033_02_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld +033_02_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/002_01.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/003.robot rename to TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot rename to TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot similarity index 88% rename from TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot rename to TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index e6ec0f24..479a314a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -11,8 +11,8 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld *** Test Case *** INVALID_REGISTRATION_ID -008_01_Delete a Context Source Registration if the Id is not present ${EMPTY} -008_02_Delete a Context Source Registration if the Id is not a valid URI invalidURI +035_02_01_Delete a Context Source Registration if the Id is not present ${EMPTY} +035_02_02_Delete a Context Source Registration if the Id is not a valid URI invalidURI *** Keywords *** Delete Context Source diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot rename to TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot similarity index 83% rename from TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot rename to TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index e78cef49..26c54f63 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/004.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -10,8 +10,8 @@ Test Template Update Context Source ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Case *** FILENAME UPDATE_FILENAME -004_01_Update a context source registration by id registration-sample.jsonld registration-with-expiration-sample.jsonld -004_02_Update a context source registration to never expire registration-with-expiration-sample.jsonld registration-sample.jsonld +034_01_01_Update a context source registration by id registration-sample.jsonld registration-with-expiration-sample.jsonld +034_01_02_Update a context source registration to never expire registration-with-expiration-sample.jsonld registration-sample.jsonld *** Keywords *** Update Context Source diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot similarity index 70% rename from TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot rename to TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index d6c7cc0b..1068f5b2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -12,10 +12,10 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld *** Test Case *** REGISTRATION_ID FRAGMENT_FILENAME -005_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld -005_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld -005_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld -005_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld +034_02_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld +034_02_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld +034_02_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld +034_02_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld *** Keywords *** Update Context Source diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot similarity index 95% rename from TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot rename to TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot index 21cfb6f6..0d986b93 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/005_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot @@ -10,7 +10,7 @@ ${filename}= registration-sample.jsonld ${registration_payload_file_path}= registration-invalid-sample.jsonld *** Test Case *** -005_04_Update a context source registration if the request body is invalid +Update a context source registration if the request body is invalid [Documentation] Check that you cannot update a context source registration if the request body is invalid [Tags] mandatory ${registration_id}= Generate Random Entity Id ${registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot similarity index 93% rename from TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot rename to TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 87ba775a..9bdb1b5c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -9,7 +9,7 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld *** Test Case *** -006_Update a context source registration by id if the id is not known to the system +Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system [Tags] mandatory ${registration_id}= Generate Random Entity Id ${registration_id_prefix} diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld index 115393ad..f8455144 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld @@ -17,7 +17,6 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld index 5a0ece28..e108e52c 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld @@ -19,7 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld index b18c7a96..17a6c11d 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld @@ -19,7 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld index a906bcc3..e442fe0d 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld @@ -19,7 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 7e83ea23..334902b0 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -21,8 +21,7 @@ "source": { "type": "Property", "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + } }, { "type": "Property", @@ -34,7 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://fiware.github.io/data-models/context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index d3fdfa44..ca87fce1 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -158,12 +158,8 @@ Update Entity Attributes [return] ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} - &{headers}= Create Dictionary Content-Type=${content_type} - &{params}= Create Dictionary - Run Keyword If '${datasetId}'!='' Set To Dictionary ${params} datasetId=${datasetId} - Run Keyword If '${deleteAll}'!='' Set To Dictionary ${params} deletelAll=${deleteAll} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}/?datasetId='${datasetId}' headers=${headers} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} Output request Output response [return] ${response} -- GitLab From f2deb0890290084384b167b9775d1c6043564bc7 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 4 Feb 2021 09:09:31 +0100 Subject: [PATCH 104/442] feat: add tps for retrieve context source registration subscription --- .../034_01.robot | 34 +++++++++++++++++++ .../034_02.robot | 16 +++++++++ .../034_03.robot | 16 +++++++++ libraries/assertionUtils.py | 4 +-- resources/ApiUtils.resource | 6 ++-- resources/AssertionUtils.resource | 22 ++++++++++-- 6 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot new file mode 100644 index 00000000..065e4771 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you can retrieve a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscription +Suite Teardown Delete Created Context Source Registration Subscription + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Case *** +Retrieve Context Source Registration Subscription + [Documentation] Check that you can retrieve a context source registration subscription + [Tags] mandatory + + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + +*** Keywords *** +Setup Initial Context Source Registration Subscription + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Context Source Registration Subscription ${subscription_payload} + + Set Suite Variable ${subscription_id} + +Delete Created Context Source Registration Subscription + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot new file mode 100644 index 00000000..f256820e --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve Context Source Registration Subscription With An Invalid Id + [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised + [Tags] mandatory + + Retrieve Context Source Registration Subscription invalidUri + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot new file mode 100644 index 00000000..d48f640a --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve Unknown Context Source Registration Subscription + [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised + [Tags] mandatory + + Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py index 87a56863..fb7e614e 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -4,8 +4,8 @@ def compare_dictionaries_ignoring_keys(dict1, dict2, exclude_regex_paths): """Function exposed as a keyword to compare two dictionaries :param dict1: actual dictionary :param dict2: expected dictionary - :param exclude_regex_paths: regex path of keys to be ignored + :param exclude_regex_paths: list of regex paths of keys to be ignored """ - res = DeepDiff(dict1, dict2, exclude_regex_paths=[exclude_regex_paths], ignore_order=True) + res = DeepDiff(dict1, dict2, exclude_regex_paths=exclude_regex_paths, ignore_order=True) print(res) return not res diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ca87fce1..9925f19f 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -410,9 +410,11 @@ Update Context Source Registration Subscription Set Test Variable ${response} Retrieve Context Source Registration Subscription - [Arguments] ${subscription_id} + [Arguments] ${subscription_id} ${context}=${EMPTY} - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + &{headers}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} Output request Output response diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 415a2d02..25c5f6fc 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -4,6 +4,8 @@ Library ${EXECDIR}/libraries/assertionUtils.py *** Variable *** ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] +${context_regex_expr}= root\\['@context'\\] +${status_regex_expr}= root\\['status'\\] *** Keywords *** Check Response Status Code @@ -36,13 +38,21 @@ Check Response Body Content ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=Entity Comparaison Failed +# Since Http headers names are case-insensitive (from Http specification) +# We check both Location and location headers Check Response Headers Containing URI set to [Arguments] ${expected_path} ${expected_entity_id} ${response} - Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + Run Keyword If 'Location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['Location']} ignore_order=True + Run Keyword If 'location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + +# Since Http headers names are case-insensitive (from Http specification) +# We check both Location and location headers Check Response Headers ID Not Empty [Arguments] ${response} - ${id}= Fetch From Right ${response['headers']['location']} / + + ${location_header}= Set Variable If 'Location' in ${response['headers']} ${response['headers']['Location']} ${response['headers']['location']} + ${id}= Fetch From Right ${location_header} / Should Not Be Empty ${id} [return] ${id} @@ -104,6 +114,14 @@ Check Response Body Containing List Containing EntityTemporal elements ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed +Check Response Body Containing Subscription element + [Arguments] ${expectation_filename} ${subscription_id} + ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${ignored_keys}= Create List ${status_regex_expr} ${context_regex_expr} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} + Should Be True ${comparaison_result} msg=Subscription Comparaison Failed + Check Response Body Type When Using Session Request [Arguments] ${response} ${type} Should Be Equal ${response['type']} ${type} -- GitLab From 74f59bbeff5386052087c3279c89216f4b15f5ea Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 4 Feb 2021 14:37:12 +0100 Subject: [PATCH 105/442] feat: implement tps for query context source registration subscriptions --- .../035_01.robot | 42 +++++++++++++++ .../035_02.robot | 54 +++++++++++++++++++ .../035_03.robot | 54 +++++++++++++++++++ .../035_04.robot | 25 +++++++++ .../subscriptions-035-01-expectation.json | 40 ++++++++++++++ resources/ApiUtils.resource | 15 ++++++ resources/AssertionUtils.resource | 34 ++++++++++++ 7 files changed, 264 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot create mode 100644 TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot create mode 100644 data/csourceSubscriptions/expectations/subscriptions-035-01-expectation.json diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot new file mode 100644 index 00000000..2c2d24c3 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you can query context source registration subscriptions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json + +*** Test Case *** +Query Context Source Registration Subscriptions + [Documentation] Check that you can query context source registration subscriptions + [Tags] mandatory + + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} + + @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + +*** Keywords *** +Setup Initial Context Source Registration Subscriptions + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot new file mode 100644 index 00000000..2a250414 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Subscriptions With Limit Parameter +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json + +*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER +Query One Subscription ${1} ${1} +Query Two Subscription ${2} ${2} +Query All Subscriptions ${15} ${3} + +*** Keywords *** +Query Context Source Registration Subscriptions With Limit Parameter + [Arguments] ${limit} ${expectation_subscription_number} + + [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + [Tags] mandatory + + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} + + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + +Setup Initial Context Source Registration Subscriptions + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + Create Context Source Registration Subscription ${third_subscription_payload} + + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} + Delete Context Source Registration Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot new file mode 100644 index 00000000..86147fd5 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld + +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} +Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + +*** Keywords *** +Query Context Source Registration Subscriptions With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + + [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination + [Tags] mandatory + + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} + +Setup Initial Context Source Registration Subscriptions + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + Create Context Source Registration Subscription ${third_subscription_payload} + + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} + +Delete Created Context Source Registration Subscriptions + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} + Delete Context Source Registration Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot new file mode 100644 index 00000000..136ff6fd --- /dev/null +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters + +*** Test Cases *** LIMIT PAGE +Invalid Limit ${-5} ${2} +Invalid Page ${2} ${-3} +Invalid Limit And Page ${0} ${0} + +*** Keywords *** +Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters + [Arguments] ${limit} ${page} + + [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters + [Tags] mandatory + + Query Context Source Registration Subscriptions limit=${limit} page=${page} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/csourceSubscriptions/expectations/subscriptions-035-01-expectation.json b/data/csourceSubscriptions/expectations/subscriptions-035-01-expectation.json new file mode 100644 index 00000000..731b679f --- /dev/null +++ b/data/csourceSubscriptions/expectations/subscriptions-035-01-expectation.json @@ -0,0 +1,40 @@ +[ + { + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "active" + }, + { + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "watchedAttributes":[ + "name", + "subCategory" + ], + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "active" + } +] diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 9925f19f..5a5c0ad7 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -420,6 +420,21 @@ Retrieve Context Source Registration Subscription Set Test Variable ${response} +Query Context Source Registration Subscriptions + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} + Delete Context Source Registration Subscription [Arguments] ${subscription_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 25c5f6fc..c4a8c7a9 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -122,6 +122,33 @@ Check Response Body Containing Subscription element ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} Should Be True ${comparaison_result} msg=Subscription Comparaison Failed +Check Response Body Containing List Containing Subscription elements + [Arguments] ${expectation_file_path} ${subscription_ids} + ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + ${index}= Set Variable 0 + FOR ${subscription_id} IN @{subscription_ids} + ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} + ${index}= Evaluate ${index} + 1 + END + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} + Should Be True ${comparaison_result} msg=Subscription Comparaison Failed + +# Since response body can be a json object if it contains one subscription +# A check on the response body type is needed +Check Response Body Containing Number Of Entities + [Arguments] ${expected_entity_type} ${expected_length} + + ${response_body_length}= Get Length ${response['body']} + ${is_list}= Run Keyword Evaluate type(${response['body']})==list + + Run Keyword If ${is_list} Should Be Equal ${response_body_length} ${expected_length} + Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} + + FOR ${index} IN RANGE ${expected_length} + Run Keyword If ${is_list} Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + END + Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} + Check Response Body Type When Using Session Request [Arguments] ${response} ${type} Should Be Equal ${response['type']} ${type} @@ -189,3 +216,10 @@ Check NotificationParams FOR ${expected_additional_member} IN @{expected_additional_members} Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} END + +Check Pagination Prev And Next Headers + [Arguments] ${prev_link} ${next_link} + ${expected_links}= Create List ${prev_link} ${next_link} + Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link']} ${expected_links} ignore_order=True + Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} + Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} -- GitLab From 2256fe16874c3b7ea6359c9cd8e775ca657e8d26 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 7 Feb 2021 17:42:45 +0100 Subject: [PATCH 106/442] fix: name of expectation file in 037_06 --- .../RegistrationSubscription/NotificationBehaviour/037_06.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot index 187bde84..594793d5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot @@ -13,7 +13,7 @@ ${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/0-timesSent-failed.json +${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json *** Test Case *** If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated -- GitLab From 619013ba51a8431f85ce41ef481f2f56532a6dbc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 7 Feb 2021 17:59:58 +0100 Subject: [PATCH 107/442] doc: add notes about configuration of the test suite --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2fe03b68..f5e60d8a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ ```$ git clone git@forge.etsi.org:cim/ngsi-ld-test-suite.git``` +## Configure the environment + +In the `resources/variables.py` file, configure the following: +* URL of the context broker under test (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1) +* Notification server host and port (an address accessible from the context broker) + ## Install the project requirements Browse the base project root folder and execute the following command: -- GitLab From 588914ea5e1b3599534c23306b81e4cd5b6ba573 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 8 Feb 2021 11:57:57 +0000 Subject: [PATCH 108/442] added some common behaviours tests --- TP/NGSI-LD/CommonBehaviours/044_01.robot | 47 ---------------- TP/NGSI-LD/CommonBehaviours/044_01_01.robot | 23 ++++++++ TP/NGSI-LD/CommonBehaviours/044_01_02.robot | 24 ++++++++ TP/NGSI-LD/CommonBehaviours/044_01_03.robot | 23 ++++++++ TP/NGSI-LD/CommonBehaviours/044_01_04.robot | 27 +++++++++ TP/NGSI-LD/CommonBehaviours/044_01_05.robot | 25 +++++++++ TP/NGSI-LD/CommonBehaviours/044_01_06.robot | 27 +++++++++ .../034_01.robot | 2 +- .../034_02.robot | 2 +- .../034_03.robot | 2 +- ...t-source-registration-update-sample.jsonld | 6 ++ .../subscription-update-sample.jsonld | 10 ++++ .../vehicle-fragment-brandname-sample.jsonld | 7 +++ ...cle-fragment-equal-datasetid-sample.jsonld | 3 +- .../vehicle-simple-attributes-sample.jsonld | 5 +- ...cle-two-datasetid-attributes-sample.jsonld | 4 +- ...le-temporal-representation-fragment.jsonld | 10 ++++ ...icle-temporal-representation-sample.jsonld | 15 +---- resources/ApiUtils.resource | 56 ++++++++++++++++++- 19 files changed, 243 insertions(+), 75 deletions(-) delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_01.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_02.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_03.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_04.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_05.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_06.robot create mode 100644 data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld create mode 100644 data/csourceSubscriptions/fragments/subscription-update-sample.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot deleted file mode 100644 index 440d958a..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ /dev/null @@ -1,47 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids -Test Template Throw 503 LDContextNotAvaliable error - -*** Variable *** -${expected_status_code}= 503 -${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: - -*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH -044_01_01_endpoint /entities/{entityId}/attrs/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH}{entityId}/attrs/ entities/building-minimal-without-context-sample.jsonld -044_01_02_endpoint /entities/{entityId}/attrs/{attrId} ${csourceRegistration_id} ${csourceRegistration_id} /entities/{entityId}/attrs/{attrId} csourceRegistrations/context-source-registration-without-context-sample.jsonld -044_01_03_endpoint /subscriptions/{subscriptionId} ${subscription_id} ${subscription_id} /subscriptions/{subscriptionId} csourceSubscriptions/subscription-without-context-sample.jsonld -044_01_04_endpoint /csourceRegistrations/{registrationId} ${csourceSubscription_id} ${csourceSubscription_id} /csourceRegistrations/{registrationId} csourceSubscriptions/subscription-without-context-sample.jsonld -044_01_05_endpoint /csourceSubscriptions/{subscriptionId} ${temporal_entity_id} ${temporal_entity_id} /csourceSubscriptions/{subscriptionId} temporalEntities/bus-temporal-representation-without-context-sample.jsonld -044_01_06_endpoint /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} - -*** Keywords *** -PATCH HTTP requests via "application/merge-patch+json" - [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - - ${response}= Merge Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} - -Generate Random Ids - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} - ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${entity_id} - Set Suite Variable ${temporal_entity_id} - Set Suite Variable ${csourceRegistration_id} - Set Suite Variable ${csourceSubscription_id} - Set Suite Variable ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01_01.robot new file mode 100644 index 00000000..fc0274bd --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_01.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld + +*** Test Cases *** +044_01_01_endpoint /entities/{entityId}/attrs/ + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_02.robot b/TP/NGSI-LD/CommonBehaviours/044_01_02.robot new file mode 100644 index 00000000..35dc5c35 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_02.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-simple-attributes-sample.jsonld +${fragment_filename}= vehicle-fragment-brandname-sample.jsonld +${attribute_id}= brandName + +*** Test Cases *** +044_01_02_endpoint /entities/{entityId}/attrs/{attrId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_03.robot b/TP/NGSI-LD/CommonBehaviours/044_01_03.robot new file mode 100644 index 00000000..1960878b --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_03.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${filename_path}= csourceSubscriptions/subscription-sample.jsonld +${fragment_filename_path}= csourceSubscriptions/fragments/subscription-update-sample.jsonld + +*** Test Cases *** +044_01_03_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscription_id} ${filename_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Subscription ${subscription_id} ${fragment_filename_path} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_04.robot b/TP/NGSI-LD/CommonBehaviours/044_01_04.robot new file mode 100644 index 00000000..83877508 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_04.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-sample.jsonld +${fragment_filename_path}= context-source-registration-update-sample.jsonld + +*** Test Cases *** +044_01_04_endpoint /csourceRegistrations/{registrationId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/fragments/${fragment_filename_path} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_05.robot b/TP/NGSI-LD/CommonBehaviours/044_01_05.robot new file mode 100644 index 00000000..a2986056 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_05.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + +*** Test Cases *** +044_01_05_endpoint /csourceSubscriptions/{subscriptionId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + + ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} + ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_06.robot b/TP/NGSI-LD/CommonBehaviours/044_01_06.robot new file mode 100644 index 00000000..d5249424 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01_06.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${temporal_entity_filename}= vehicle-temporal-representation-sample.jsonld +${temporal_entity_fragment_file_path}= vehicle-temporal-representation-fragment.jsonld +${attribute_id}= speed + +*** Test Cases *** +044_01_06_endpoint /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_id} ${temporal_entity_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_id} ${CONTENT_TYPE_LD_JSON} + ${instance_id}= Set Variable ${response["body"]["speed"][0]["instanceId"]} + + ${response}= Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_id} ${attribute_id} ${instance_id} ${temporal_entity_fragment_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 26c54f63..75d2a924 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -26,7 +26,7 @@ Update Context Source ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 1068f5b2..d60abd5f 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -29,7 +29,7 @@ Update Context Source ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 9bdb1b5c..58d14bad 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -15,7 +15,7 @@ Update a context source registration by id if the id is not known to the system ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld b/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld new file mode 100644 index 00000000..795d209e --- /dev/null +++ b/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld @@ -0,0 +1,6 @@ +{ + "endpoint":"http://my.new.csource.org:1026", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld b/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld new file mode 100644 index 00000000..f721ed26 --- /dev/null +++ b/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld @@ -0,0 +1,10 @@ +{ + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.second.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld new file mode 100644 index 00000000..cf7ce5ac --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld @@ -0,0 +1,7 @@ +{ + "brandName": { + "type": "Property", + "value": "BMW" + }, + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld index 9b220bf4..11dd4a9b 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld @@ -8,6 +8,5 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, - "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 2da4522d..1c9a0d20 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -14,8 +14,5 @@ "object": "urn:ngsi-ld:Person:Bob" } }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 334902b0..3c575a10 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -32,7 +32,5 @@ }, "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld new file mode 100644 index 00000000..44298dd4 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld @@ -0,0 +1,10 @@ +{ + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + } + ], + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 4f095bf1..e03f01be 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -17,11 +17,6 @@ "type":"Property", "value":80, "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" } ], "fuelLevel":[ @@ -34,15 +29,7 @@ "type":"Property", "value":53, "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" } ], - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 14b75348..d4a0ee21 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -22,6 +22,7 @@ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscript ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json +${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json ${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData ${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest @@ -193,8 +194,8 @@ Create Context Source Registration Using Session [return] ${response} Update Context Source Registration With Return - [Arguments] ${registration_id} ${fragment} - &{headers}= Create Dictionary Content-Type=application/ld+json + [Arguments] ${registration_id} ${fragment} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} ${request}= Output request Output response @@ -263,6 +264,24 @@ Create Temporal Representation Of Entity Selecting Content Type Output response [return] ${response} +Update Temporal Representation Of Entity Selecting Content Type + [Arguments] ${temporal_entity_representation_id} ${attrId} ${instanceId} ${fragment_filename} ${content_type} + ${temporal_entity_fragment}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} body=${temporal_entity_fragment} headers=${headers} + Output request + Output response + [return] ${response} + +Get Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} ${accept}=${CONTENT_TYPE_LD_JSON} + ${headers}= Create Dictionary + &{headers}= Create Dictionary Accept ${accept} + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} + Output request + Output response + [return] ${response} + Batch Create Entities [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary @@ -461,3 +480,36 @@ Update Context Source Registration Subscription From File Create Session CsrsUpdateRequest ${url} ${response}= PATCH On Session CsrsUpdateRequest ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} data=${file_content} expected_status=any Set Test Variable ${response} + +Create Subscription + [Arguments] ${subscription_id} ${filename_path} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} + ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} + ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} + Output response + [return] ${response} + +Update Subscription + [Arguments] ${subscription_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} + ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Subscription + [Arguments] ${subscription_id} + ${response}= DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + Output request + Output response + [return] ${response} + +Update Context Source Registration Subscription By Selecting Content Type + [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} + Output request + Output response + [return] ${response} \ No newline at end of file -- GitLab From 55210e40a17cc2e8be48c82c79854c1c83405b35 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 9 Feb 2021 10:20:46 +0100 Subject: [PATCH 109/442] fix: add keyword to load subscriptions with reachable endpoint --- .../NotificationBehaviour/037_01.robot | 2 +- .../NotificationBehaviour/037_02.robot | 2 +- .../NotificationBehaviour/037_03.robot | 2 +- .../NotificationBehaviour/037_04.robot | 2 +- .../NotificationBehaviour/037_05.robot | 2 +- .../NotificationBehaviour/037_07.robot | 2 +- .../NotificationBehaviour/037_08.robot | 2 +- .../NotificationBehaviour/037_09.robot | 2 +- .../NotificationBehaviour/037_10.robot | 2 +- .../NotificationBehaviour/037_11.robot | 2 +- .../NotificationBehaviour/037_12.robot | 2 +- .../NotificationBehaviour/037_13.robot | 2 +- .../NotificationBehaviour/037_14.robot | 2 +- .../NotificationBehaviour/037_15.robot | 2 +- .../NotificationBehaviour/037_16.robot | 2 +- resources/AssertionUtils.resource | 4 +++- resources/JsonUtils.resource | 10 ++++++++++ resources/NotificationUtils.resource | 2 +- 18 files changed, 29 insertions(+), 17 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot index 80b336d4..09b5e1f6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot @@ -20,7 +20,7 @@ Receive cSourceNotification Periodically And Initially On Subscription [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot index 4846a9f5..04e6f2ac 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot @@ -21,7 +21,7 @@ Receive cSourceNotification Initially On Subscription And Whenever There Is A Ch [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot index 7ad2693f..8531a45f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot @@ -35,7 +35,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot index aac6a6c3..c61dd058 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot index f562b613..61af8f1d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot @@ -37,7 +37,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot index 09c91737..6b244861 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot @@ -41,7 +41,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot index 800f0a9f..16b9cb92 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registrations And Subscriptions ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration ${context_source_registration_payload} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot index bd0794af..834ab1ae 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registrations And Subscriptions ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration ${context_source_registration_payload} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot index 37f11385..6d2d3a1b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot index 81487f69..64dca133 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot @@ -25,7 +25,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot index 5c63941f..995a53c9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot index 3da7df0c..3317b4f6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot index e269b57d..bb978005 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot index 9527579f..ae8bc477 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot @@ -33,7 +33,7 @@ Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot index 8c5b3f15..cc397045 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot @@ -39,7 +39,7 @@ Setup Initial Context Source Registrations And Subscriptions ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c4a8c7a9..8665b91a 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -4,6 +4,7 @@ Library ${EXECDIR}/libraries/assertionUtils.py *** Variable *** ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] +${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] ${context_regex_expr}= root\\['@context'\\] ${status_regex_expr}= root\\['status'\\] @@ -210,7 +211,8 @@ Check NotificationParams [Arguments] ${filename} ${expected_additional_members} ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${notification_timestamps_regex_expr} + ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${ignored_keys} Should Be True ${comparaison_result} msg=NotificationParams Comparaison Failed FOR ${expected_additional_member} IN @{expected_additional_members} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 78c7d74d..c0827f79 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -5,6 +5,8 @@ Library JSONLibrary *** Variable *** ${date_format}= %Y-%m-%dT%H:%M:%SZ +${notification_server_url}= http://${notification_server_host}:${notification_server_port}/notify + *** Keywords *** Load Entity [Arguments] ${entity_file_name} ${entity_id} @@ -24,6 +26,14 @@ Load Test Sample [return] ${test_sample} +Load Subscription Sample With Reachable Endpoint + [Arguments] ${subscription_file_path} ${subscription_id}=${EMPTY} ${notification_endpoint_uri}=${notification_server_url} + + ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} + ${subscription}= Update Value To Json ${subscription_payload} $..notification['endpoint']['uri'] ${notification_endpoint_uri} + + [return] ${subscription} + Remove Entity Type [Arguments] ${entity} diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index e9749abb..fffcde35 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -13,7 +13,7 @@ ${date_format}= %Y-%m-%dT%H:%M:%SZ *** Keywords *** Start Local Server #Initialize HTTP Client And Server - Start Server ${notification_server_host} ${notification_server_port} + Start Server 0.0.0.0 8085 Wait for notification [Arguments] ${timeout}=${5} -- GitLab From a31f9d96e051800bf6b4333223242dddc56f769b Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 10 Feb 2021 09:27:09 +0100 Subject: [PATCH 110/442] feat: add tps for retrieve context source registration --- .../036_01.robot | 25 +++++++++++++ .../036_02.robot | 16 +++++++++ .../036_03.robot | 35 +++++++++++++++++++ .../036_04.robot | 35 +++++++++++++++++++ ...t-source-registration-expanded-format.json | 14 ++++++++ .../context-source-registration.json | 14 ++++++++ resources/ApiUtils.resource | 19 +++++++--- resources/AssertionUtils.resource | 8 +++++ 8 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot create mode 100644 data/csourceRegistrations/expectations/context-source-registration-expanded-format.json create mode 100644 data/csourceRegistrations/expectations/context-source-registration.json diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot new file mode 100644 index 00000000..41981066 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id + +*** Test Cases *** ID +Not Present Id ${EMPTY} +Invalid Id invalidUri + +*** Keywords *** + +Retrieve Context Source Registration With A Not Present Or Invalid Id + [Arguments] ${id} + + [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI + [Tags] mandatory + + Retrieve Context Source Registration ${id} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot new file mode 100644 index 00000000..bdc90d76 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve Unknown Context Source Registration + [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent + [Tags] mandatory + + Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot new file mode 100644 index 00000000..c1fc4b2e --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + +*** Test Case *** +Retrieve Context Source Registration With Default Core Context + [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. + [Tags] mandatory + + Retrieve Context Source Registration ${context_source_registration_id} + + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + +*** Keywords *** +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot new file mode 100644 index 00000000..3577a1e7 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you can retrieve a Context Source Registration +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json + +*** Test Case *** +Retrieve Context Source Registration + [Documentation] Check that you can retrieve a Context Source Registration + [Tags] mandatory + + Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + +*** Keywords *** +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json new file mode 100644 index 00000000..f96e148a --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json @@ -0,0 +1,14 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"https://ngsi-ld-test-suite/context#Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" +} \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registration.json b/data/csourceRegistrations/expectations/context-source-registration.json new file mode 100644 index 00000000..b4a6b06e --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registration.json @@ -0,0 +1,14 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5a5c0ad7..bb305360 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -22,10 +22,10 @@ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscript ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json -${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists ${response} @@ -389,6 +389,17 @@ Delete Context Source Registration Set Suite Variable ${response} +Retrieve Context Source Registration + [Arguments] ${context_source_registration_id} ${context}=${EMPTY} + + &{headers}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} + Output request + Output response + + Set Test Variable ${response} + Create Context Source Registration Subscription [Arguments] ${subscription_payload} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 8665b91a..48242e48 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -150,6 +150,14 @@ Check Response Body Containing Number Of Entities END Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} +Check Response Body Containing Context Source Registration element + [Arguments] ${expectation_filename} ${context_source_registration_id} + ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${context_source_registration} ${ignored_keys} + Should Be True ${comparaison_result} msg=Context Source Registration Comparaison Failed + Check Response Body Type When Using Session Request [Arguments] ${response} ${type} Should Be Equal ${response['type']} ${type} -- GitLab From 6602b16bbe2065601b416ccd4ac7433b8334b8e7 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 10 Feb 2021 10:16:51 +0100 Subject: [PATCH 111/442] fix: rename tps of context source registration subscription as in test structure --- .../{032_01.robot => 038_01.robot} | 0 .../{032_02.robot => 038_02.robot} | 0 .../{032_03.robot => 038_03.robot} | 0 .../{032_04.robot => 038_04.robot} | 0 .../{032_05.robot => 038_05.robot} | 0 .../{032_06.robot => 038_06.robot} | 0 .../{032_07.robot => 038_07.robot} | 0 .../{032_08.robot => 038_08.robot} | 0 .../{032_09.robot => 038_09.robot} | 0 .../{036_01.robot => 042_01.robot} | 0 .../{036_02.robot => 042_02.robot} | 0 .../{036_03.robot => 042_03.robot} | 0 .../NotificationBehaviour/{037_01.robot => 047_01.robot} | 0 .../NotificationBehaviour/{037_02.robot => 047_02.robot} | 0 .../NotificationBehaviour/{037_03.robot => 047_03.robot} | 0 .../NotificationBehaviour/{037_04.robot => 047_04.robot} | 0 .../NotificationBehaviour/{037_05.robot => 047_05.robot} | 0 .../NotificationBehaviour/{037_06.robot => 047_06.robot} | 0 .../NotificationBehaviour/{037_07.robot => 047_07.robot} | 0 .../NotificationBehaviour/{037_08.robot => 047_08.robot} | 0 .../NotificationBehaviour/{037_09.robot => 047_09.robot} | 0 .../NotificationBehaviour/{037_10.robot => 047_10.robot} | 0 .../NotificationBehaviour/{037_11.robot => 047_11.robot} | 0 .../NotificationBehaviour/{037_12.robot => 047_12.robot} | 0 .../NotificationBehaviour/{037_13.robot => 047_13.robot} | 0 .../NotificationBehaviour/{037_14.robot => 047_14.robot} | 0 .../NotificationBehaviour/{037_15.robot => 047_15.robot} | 0 .../NotificationBehaviour/{037_16.robot => 047_16.robot} | 0 .../{035_01.robot => 041_01.robot} | 0 .../{035_02.robot => 041_02.robot} | 0 .../{035_03.robot => 041_03.robot} | 0 .../{035_04.robot => 041_04.robot} | 0 .../{034_01.robot => 040_01.robot} | 0 .../{034_02.robot => 040_02.robot} | 0 .../{034_03.robot => 040_03.robot} | 0 .../{033_01.robot => 039_01.robot} | 0 .../{033_02.robot => 039_02.robot} | 0 .../{033_03.robot => 039_03.robot} | 0 .../{033_04.robot => 039_04.robot} | 0 .../{033_05.robot => 039_05.robot} | 0 40 files changed, 0 insertions(+), 0 deletions(-) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_01.robot => 038_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_02.robot => 038_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_03.robot => 038_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_04.robot => 038_04.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_05.robot => 038_05.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_06.robot => 038_06.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_07.robot => 038_07.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_08.robot => 038_08.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/{032_09.robot => 038_09.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/{036_01.robot => 042_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/{036_02.robot => 042_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/{036_03.robot => 042_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_01.robot => 047_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_02.robot => 047_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_03.robot => 047_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_04.robot => 047_04.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_05.robot => 047_05.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_06.robot => 047_06.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_07.robot => 047_07.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_08.robot => 047_08.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_09.robot => 047_09.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_10.robot => 047_10.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_11.robot => 047_11.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_12.robot => 047_12.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_13.robot => 047_13.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_14.robot => 047_14.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_15.robot => 047_15.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/{037_16.robot => 047_16.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/{035_01.robot => 041_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/{035_02.robot => 041_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/{035_03.robot => 041_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/{035_04.robot => 041_04.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/{034_01.robot => 040_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/{034_02.robot => 040_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/{034_03.robot => 040_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/{033_01.robot => 039_01.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/{033_02.robot => 039_02.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/{033_03.robot => 039_03.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/{033_04.robot => 039_04.robot} (100%) rename TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/{033_05.robot => 039_05.robot} (100%) diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_04.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_05.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_06.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_07.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_08.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/032_09.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/036_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_04.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_05.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_06.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_07.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_08.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_09.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_10.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_11.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_12.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_13.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_14.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_15.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/037_16.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/035_04.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/034_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_01.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_02.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_03.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_04.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot similarity index 100% rename from TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/033_05.robot rename to TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot -- GitLab From f5b0d8e3812b68944192086ddf3bcfec0d19f5fb Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 11 Feb 2021 10:17:47 +0100 Subject: [PATCH 112/442] feat: add tps for context information consumption discovery --- .../027_01_01.robot | 34 ++++++++++ .../027_01_02.robot | 34 ++++++++++ .../RetrieveAvailableAttributes/025_01.robot | 38 +++++++++++ .../024_01_01.robot | 38 +++++++++++ .../024_01_02.robot | 38 +++++++++++ .../RetrieveAvailableEntityTypes/022_01.robot | 44 ++++++++++++ .../026_01.robot | 38 +++++++++++ .../023_01.robot | 44 ++++++++++++ .../vehicle-simple-attributes-sample.json | 13 ++++ .../attribute-026-01-01-expectation.json | 50 ++++++++++++++ .../attribute-026-01-02-expectation.json | 50 ++++++++++++++ .../attribute-027-01-expectation.json | 12 ++++ .../attribute-list-025-01-01-expectation.json | 10 +++ .../attribute-list-025-01-02-expectation.json | 10 +++ .../entity-type-023-01-01-expectation.json | 22 ++++++ .../entity-type-023-01-02-expectation.json | 22 ++++++ .../entity-type-info-024-01-expectation.json | 40 +++++++++++ ...ntity-type-list-022-01-01-expectation.json | 8 +++ ...ntity-type-list-022-01-02-expectation.json | 8 +++ resources/ApiUtils.resource | 53 ++++++++++++++- resources/AssertionUtils.resource | 68 ++++++++++++++----- 21 files changed, 657 insertions(+), 17 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot create mode 100644 data/entities/vehicle-simple-attributes-sample.json create mode 100644 data/types/expectations/attribute-026-01-01-expectation.json create mode 100644 data/types/expectations/attribute-026-01-02-expectation.json create mode 100644 data/types/expectations/attribute-027-01-expectation.json create mode 100644 data/types/expectations/attribute-list-025-01-01-expectation.json create mode 100644 data/types/expectations/attribute-list-025-01-02-expectation.json create mode 100644 data/types/expectations/entity-type-023-01-01-expectation.json create mode 100644 data/types/expectations/entity-type-023-01-02-expectation.json create mode 100644 data/types/expectations/entity-type-info-024-01-expectation.json create mode 100644 data/types/expectations/entity-type-list-022-01-01-expectation.json create mode 100644 data/types/expectations/entity-type-list-022-01-02-expectation.json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot new file mode 100644 index 00000000..8a474bff --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Case *** +Retrieve Detailed Representation Of Available Attribute Without Context + [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute + [Tags] mandatory + + Retrieve Attribute attribute_name=airQualityLevel + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Entities + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot new file mode 100644 index 00000000..9540d0e0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/attribute-027-01-expectation.json + +*** Test Case *** +Retrieve Detailed Representation Of Available Attribute + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + [Tags] mandatory + + Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing Attribute element ${expectation_file} + +*** Keywords *** +Setup Initial Entities + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot new file mode 100644 index 00000000..1ac097d1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can retrieve a list of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Available Attributes +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json + +*** Keywords *** +Retrieve Available Attributes + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list of NGSI-LD attributes + [Tags] mandatory + + Retrieve Attributes ${context} + + Check Response Status Code Set To 200 + Check Response Body Containing AttributeList element ${expectation_file} + +Setup Initial Entities + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot new file mode 100644 index 00000000..24e0143b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Case *** +Retrieve Detailed Representation Of Available Entity Type Without Context + [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type + [Tags] mandatory + + Retrieve Entity Type type=Building + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot new file mode 100644 index 00000000..7b0c3efe --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json + +*** Test Case *** +Retrieve Detailed Representation Of Available Entity Type + [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type + [Tags] mandatory + + Retrieve Entity Type type=Building context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeInfo element ${expectation_file} + +*** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot new file mode 100644 index 00000000..3fd3571d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can retrieve a list of NGSI-LD entity types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Available Entity Types +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json + +*** Keywords *** +Retrieve Available Entity Types + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list of NGSI-LD entity types + [Tags] mandatory + + Retrieve Entity Types ${context} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeList element ${expectation_file} + +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot new file mode 100644 index 00000000..b0660b73 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Details Of Available Attributes +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext ${EMPTY} types/expectations/attribute-026-01-01-expectation.json +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json + +*** Keywords *** +Retrieve Details Of Available Attributes + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + [Tags] mandatory + + Retrieve Attributes context=${context} details=${TRUE} + + Check Response Status Code Set To 200 + Check Response Body Containing Attribute element ${expectation_file} + +Setup Initial Entities + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot new file mode 100644 index 00000000..4fa7b912 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Details Of Available Entity Types +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json + +*** Keywords *** +Retrieve Details Of Available Entity Types + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + [Tags] mandatory + + Retrieve Entity Types context=${context} details=${TRUE} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityType element ${expectation_file} + +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.json b/data/entities/vehicle-simple-attributes-sample.json new file mode 100644 index 00000000..9825fa9f --- /dev/null +++ b/data/entities/vehicle-simple-attributes-sample.json @@ -0,0 +1,13 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + } +} \ No newline at end of file diff --git a/data/types/expectations/attribute-026-01-01-expectation.json b/data/types/expectations/attribute-026-01-01-expectation.json new file mode 100644 index 00000000..67799b93 --- /dev/null +++ b/data/types/expectations/attribute-026-01-01-expectation.json @@ -0,0 +1,50 @@ +[ + { + "id":"https://uri.etsi.org/ngsi-ld/name", + "type":"Attribute", + "attributeName":"name", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "https://ngsi-ld-test-suite/context#Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#subCategory", + "type":"Attribute", + "attributeName":"https://ngsi-ld-test-suite/context#subCategory", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "https://ngsi-ld-test-suite/context#Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#airQualityLevel", + "type":"Attribute", + "attributeName":"https://ngsi-ld-test-suite/context#airQualityLevel", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "https://ngsi-ld-test-suite/context#Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#almostFull", + "type":"Attribute", + "attributeName":"https://ngsi-ld-test-suite/context#almostFull", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "https://ngsi-ld-test-suite/context#Building" + ] + } +] \ No newline at end of file diff --git a/data/types/expectations/attribute-026-01-02-expectation.json b/data/types/expectations/attribute-026-01-02-expectation.json new file mode 100644 index 00000000..17ba9dba --- /dev/null +++ b/data/types/expectations/attribute-026-01-02-expectation.json @@ -0,0 +1,50 @@ +[ + { + "id":"https://uri.etsi.org/ngsi-ld/name", + "type":"Attribute", + "attributeName":"name", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#subCategory", + "type":"Attribute", + "attributeName":"subCategory", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#airQualityLevel", + "type":"Attribute", + "attributeName":"airQualityLevel", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "Building" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#almostFull", + "type":"Attribute", + "attributeName":"almostFull", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "Building" + ] + } +] \ No newline at end of file diff --git a/data/types/expectations/attribute-027-01-expectation.json b/data/types/expectations/attribute-027-01-expectation.json new file mode 100644 index 00000000..0453d27f --- /dev/null +++ b/data/types/expectations/attribute-027-01-expectation.json @@ -0,0 +1,12 @@ +{ + "id":"https://ngsi-ld-test-suite/context#airQualityLevel", + "type":"Attribute", + "attributeName":"airQualityLevel", + "attributeCount":1, + "attributeTypes":[ + "Property" + ], + "typeNames":[ + "Building" + ] +} \ No newline at end of file diff --git a/data/types/expectations/attribute-list-025-01-01-expectation.json b/data/types/expectations/attribute-list-025-01-01-expectation.json new file mode 100644 index 00000000..d8c015fd --- /dev/null +++ b/data/types/expectations/attribute-list-025-01-01-expectation.json @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:AttributeList:randomUUID", + "type": "AttributeList", + "attributeList": [ + "name", + "https://ngsi-ld-test-suite/context#subCategory", + "https://ngsi-ld-test-suite/context#airQualityLevel", + "https://ngsi-ld-test-suite/context#almostFull" + ] +} \ No newline at end of file diff --git a/data/types/expectations/attribute-list-025-01-02-expectation.json b/data/types/expectations/attribute-list-025-01-02-expectation.json new file mode 100644 index 00000000..b1d946b4 --- /dev/null +++ b/data/types/expectations/attribute-list-025-01-02-expectation.json @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:AttributeList:randomUUID", + "type": "AttributeList", + "attributeList": [ + "name", + "subCategory", + "airQualityLevel", + "almostFull" + ] +} \ No newline at end of file diff --git a/data/types/expectations/entity-type-023-01-01-expectation.json b/data/types/expectations/entity-type-023-01-01-expectation.json new file mode 100644 index 00000000..313f19dd --- /dev/null +++ b/data/types/expectations/entity-type-023-01-01-expectation.json @@ -0,0 +1,22 @@ +[ + { + "id":"https://ngsi-ld-test-suite/context#Building", + "type":"EntityType", + "typeName":"https://ngsi-ld-test-suite/context#Building", + "attributeNames":[ + "name", + "https://ngsi-ld-test-suite/context#subCategory", + "https://ngsi-ld-test-suite/context#airQualityLevel", + "https://ngsi-ld-test-suite/context#almostFull" + ] + }, + { + "id":"https://uri.etsi.org/ngsi-ld/default-context/Vehicle", + "type":"EntityType", + "typeName":"Vehicle", + "attributeNames":[ + "https://ngsi-ld-test-suite/context#brandName", + "isParked" + ] + } +] \ No newline at end of file diff --git a/data/types/expectations/entity-type-023-01-02-expectation.json b/data/types/expectations/entity-type-023-01-02-expectation.json new file mode 100644 index 00000000..a268dc81 --- /dev/null +++ b/data/types/expectations/entity-type-023-01-02-expectation.json @@ -0,0 +1,22 @@ +[ + { + "id":"https://ngsi-ld-test-suite/context#Building", + "type":"EntityType", + "typeName":"Building", + "attributeNames":[ + "name", + "subCategory", + "airQualityLevel", + "almostFull" + ] + }, + { + "id":"https://uri.etsi.org/ngsi-ld/default-context/Vehicle", + "type":"EntityType", + "typeName":"Vehicle", + "attributeNames":[ + "brandName", + "isParked" + ] + } +] \ No newline at end of file diff --git a/data/types/expectations/entity-type-info-024-01-expectation.json b/data/types/expectations/entity-type-info-024-01-expectation.json new file mode 100644 index 00000000..3c78c649 --- /dev/null +++ b/data/types/expectations/entity-type-info-024-01-expectation.json @@ -0,0 +1,40 @@ +{ + "id":"https://ngsi-ld-test-suite/context#Building", + "type":"EntityTypeInfo", + "typeName":"Building", + "entityCount":2, + "attributeDetails":[ + { + "id":"https://uri.etsi.org/ngsi-ld/name", + "type":"Attribute", + "attributeName":"name", + "attributeTypes":[ + "Property" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#subCategory", + "type":"Attribute", + "attributeName":"subCategory", + "attributeTypes":[ + "Property" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#airQualityLevel", + "type":"Attribute", + "attributeName":"airQualityLevel", + "attributeTypes":[ + "Property" + ] + }, + { + "id":"https://ngsi-ld-test-suite/context#almostFull", + "type":"Attribute", + "attributeName":"almostFull", + "attributeTypes":[ + "Property" + ] + } + ] +} \ No newline at end of file diff --git a/data/types/expectations/entity-type-list-022-01-01-expectation.json b/data/types/expectations/entity-type-list-022-01-01-expectation.json new file mode 100644 index 00000000..f1069708 --- /dev/null +++ b/data/types/expectations/entity-type-list-022-01-01-expectation.json @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:EntityTypeList:randomUUID", + "type": "EntityTypeList", + "typeList": [ + "https://ngsi-ld-test-suite/context#Building", + "Vehicle" + ] +} \ No newline at end of file diff --git a/data/types/expectations/entity-type-list-022-01-02-expectation.json b/data/types/expectations/entity-type-list-022-01-02-expectation.json new file mode 100644 index 00000000..c68c4bce --- /dev/null +++ b/data/types/expectations/entity-type-list-022-01-02-expectation.json @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:EntityTypeList:randomUUID", + "type": "EntityTypeList", + "typeList": [ + "Building", + "Vehicle" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index bb305360..66c2f958 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -13,6 +13,8 @@ ${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update ${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete &{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} ${ENTITIES_ENDPOINT_PATH} entities/ +${ENTITIES_TYPES_ENDPOINT_PATH} types +${ATTRIBUTES_ENDPOINT_PATH} attributes ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations @@ -112,10 +114,11 @@ Retrieve Entity by Id Set Test Variable ${response} Create Entity Selecting Content Type - [Arguments] ${filename} ${entity_id} ${content_type} + [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${content_type}'=='${CONTENT_TYPE_JSON}' and '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} ${request}= Output request Output response @@ -173,6 +176,54 @@ Partial Update Entity Attributes Output response [return] ${response} +Retrieve Entity Types + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${details} Set To Dictionary ${params} details=${details} + ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} + +Retrieve Entity Type + [Arguments] ${type} ${context}=${EMPTY} + + &{headers}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response + + Set Test Variable ${response} + +Retrieve Attributes + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${details} Set To Dictionary ${params} details=${details} + ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} + +Retrieve Attribute + [Arguments] ${attribute_name} ${context}=${EMPTY} + + &{headers}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response + + Set Test Variable ${response} + Create Context Source Registration With Return [Arguments] ${payload} &{headers}= Create Dictionary Content-Type=application/ld+json diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 48242e48..2116fcfb 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -2,6 +2,7 @@ Library ${EXECDIR}/libraries/assertionUtils.py *** Variable *** +${id_regex_expr}= root\\['@context'\\] ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] @@ -36,8 +37,8 @@ Check Response Body Content ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} Output ${response_body} Output ${entity_payload} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} - Should Be True ${comparaison_result} msg=Entity Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=Entity Comparison Failed # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers @@ -86,8 +87,8 @@ Check Response Body Containing Entity element [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} - Should Be True ${comparaison_result} msg=Entity Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=Entity Comparison Failed Check Response Body Containing List Containing Entity Elements [Arguments] ${expectation_filename} ${entities_ids} ${response_body} @@ -101,8 +102,8 @@ Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} - Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=EntityTemporal Comparison Failed Check Response Body Containing List Containing EntityTemporal elements [Arguments] ${filename} ${temporal_entities_representation_ids} @@ -112,16 +113,16 @@ Check Response Body Containing List Containing EntityTemporal elements ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} - Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=EntityTemporal List Comparison Failed Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} ${ignored_keys}= Create List ${status_regex_expr} ${context_regex_expr} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} - Should Be True ${comparaison_result} msg=Subscription Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} + Should Be True ${comparison_result} msg=Subscription Comparison Failed Check Response Body Containing List Containing Subscription elements [Arguments] ${expectation_file_path} ${subscription_ids} @@ -131,8 +132,8 @@ Check Response Body Containing List Containing Subscription elements ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} - Should Be True ${comparaison_result} msg=Subscription Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} + Should Be True ${comparison_result} msg=Subscription Comparison Failed # Since response body can be a json object if it contains one subscription # A check on the response body type is needed @@ -155,8 +156,43 @@ Check Response Body Containing Context Source Registration element ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} ${ignored_keys}= Create List ${context_regex_expr} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${context_source_registration} ${ignored_keys} - Should Be True ${comparaison_result} msg=Context Source Registration Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${context_source_registration} ${ignored_keys} + Should Be True ${comparison_result} msg=Context Source Registration Comparison Failed + +Check Response Body Containing EntityTypeList element + [Arguments] ${expectation_filename} + ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_list_payload} ${ignored_keys} + Should Be True ${comparison_result} msg=EntityTypeList Comparison Failed + +Check Response Body Containing EntityType element + [Arguments] ${expectation_filename} + ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_payload} ${ignored_keys} + Should Be True ${comparison_result} msg=EntityType Comparison Failed + +Check Response Body Containing EntityTypeInfo element + [Arguments] ${expectation_filename} + ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_info_payload} ${ignored_keys} + Should Be True ${comparison_result} msg=EntityTypeInfo Comparison Failed + +Check Response Body Containing AttributeList element + [Arguments] ${expectation_filename} + ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${attribute_list_payload} ${ignored_keys} + Should Be True ${comparison_result} msg=AttributeList Comparison Failed + +Check Response Body Containing Attribute element + [Arguments] ${expectation_filename} + ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${attribute_payload} ${ignored_keys} + Should Be True ${comparison_result} msg=Attribute Comparison Failed Check Response Body Type When Using Session Request [Arguments] ${response} ${type} @@ -220,8 +256,8 @@ Check NotificationParams ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${ignored_keys} - Should Be True ${comparaison_result} msg=NotificationParams Comparaison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${ignored_keys} + Should Be True ${comparison_result} msg=NotificationParams Comparison Failed FOR ${expected_additional_member} IN @{expected_additional_members} Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} -- GitLab From c0ca24704a85b36c59fc84a74b8c0fc2c96e3902 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 13 Feb 2021 15:24:57 +0100 Subject: [PATCH 113/442] fix: switch to same specific @context for the whole suite and use 1.3 version of the core @context --- .../Consumption/Entity/018_01_02.robot | 4 ++-- .../Consumption/Entity/019_01_01.robot | 2 +- .../Consumption/Entity/019_01_02.robot | 6 +++--- .../Consumption/Entity/019_01_03.robot | 2 +- .../Consumption/Entity/019_01_04.robot | 6 +++--- .../Consumption/Entity/019_01_05.robot | 2 +- .../Consumption/Entity/019_02_01.robot | 2 +- .../Consumption/Entity/019_02_02.robot | 6 +++--- .../Consumption/Entity/019_02_03.robot | 2 +- .../Consumption/Entity/019_02_04.robot | 6 +++--- .../Consumption/Entity/019_02_05.robot | 2 +- .../Consumption/Entity/019_03_01.robot | 2 +- .../Consumption/Entity/019_03_03.robot | 2 +- .../Consumption/Entity/019_03_04.robot | 2 +- .../Consumption/Entity/019_03_05.robot | 2 +- .../ContextInformation/Consumption/Entity/019_04.robot | 2 +- .../ContextInformation/Consumption/Entity/019_05.robot | 2 +- .../ContextInformation/Consumption/Entity/019_06.robot | 2 +- ...egistration-building-and-bus-entities-sample.jsonld | 2 +- ...text-source-registration-bus-entities-sample.jsonld | 2 +- ...rce-registration-detailed-information-sample.jsonld | 2 +- .../context-source-registration-location-sample.jsonld | 2 +- ...ource-registration-managementInterval-sample.jsonld | 2 +- ...urce-registration-observationInterval-sample.jsonld | 2 +- .../context-source-registration-sample.jsonld | 2 +- ...-source-registration-vehicle-entities-sample.jsonld | 2 +- .../subscription-empty-watchedAttributes-sample.jsonld | 2 +- .../subscription-expired-sample.jsonld | 2 +- .../subscription-expiresAt-sample.jsonld | 2 +- .../subscription-geoQ-sample.jsonld | 2 +- ...subscription-geoQ-without-geoproperty-sample.jsonld | 2 +- .../subscription-inactive-sample.jsonld | 2 +- .../subscription-invalid-query-sample.jsonld | 2 +- .../subscription-invalid-type-sample.jsonld | 2 +- data/csourceSubscriptions/subscription-sample.jsonld | 2 +- .../subscription-temporalQ-createdAt-sample.jsonld | 2 +- .../subscription-temporalQ-modifiedAt-sample.jsonld | 2 +- .../subscription-temporalQ-observedAt-sample.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 2 +- .../subscription-unreachable-endpoint-sample.jsonld | 2 +- .../subscription-watchedAttributes-sample.jsonld | 2 +- .../subscription-without-notification-sample.jsonld | 2 +- data/entities/batch/invalid-json-ld-sample.jsonld | 4 ++-- data/entities/batch/invalid-json-sample.jsonld | 4 ++-- .../entities/building-location-attribute-sample.jsonld | 4 ++-- data/entities/building-location-attribute.jsonld | 4 ++-- data/entities/building-minimal-sample.jsonld | 4 ++-- data/entities/building-minimal.jsonld | 4 ++-- .../building-relationship-of-property-sample.jsonld | 4 ++-- data/entities/building-relationship-sample.jsonld | 4 ++-- data/entities/building-relationship.jsonld | 4 ++-- data/entities/building-simple-attributes-sample.jsonld | 4 ++-- ...tribute-sample-expectation-query-geoproperty.jsonld | 6 +++--- ...ilding-location-attribute-sample-expectation.jsonld | 6 +++--- .../building-minimal-sample-expectation.jsonld | 4 ++-- ...tributes-sample-expectation-query-attributes.jsonld | 8 ++++---- ...ple-attributes-sample-expectation-simplified.jsonld | 10 +++++----- ...uilding-simple-attributes-sample-expectation.jsonld | 10 +++++----- ...o-datasetid-attributes-sample-expectation-03.jsonld | 4 ++-- .../invalid-vehicle-fragment-datasetid-sample.jsonld | 4 ++-- ...hicle-fragment-attribute-name-missing-sample.jsonld | 2 +- .../vehicle-fragment-different-datasetid-sample.jsonld | 4 ++-- .../vehicle-fragment-empty-datasetid-sample.jsonld | 4 ++-- ...agment-equal-datasetid-different-type-sample.jsonld | 2 +- .../vehicle-fragment-equal-datasetid-sample.jsonld | 2 +- .../vehicle-fragment-invalid-datasetid-sample.jsonld | 4 ++-- .../vehicle-fragment-same-datasetid-sample.jsonld | 4 ++-- .../vehicle-two-datasetid-attributes-sample-01.jsonld | 2 +- .../vehicle-two-datasetid-attributes-sample-02.jsonld | 2 +- .../vehicle-two-datasetid-attributes-sample-03.jsonld | 2 +- .../vehicle-two-datasetid-attributes-sample-04.jsonld | 2 +- data/entities/invalid-json-sample.jsonld | 4 ++-- data/entities/parking-simple-attributes-sample.jsonld | 4 ++-- .../vehicle-datasetid-attributes-sample.jsonld | 4 ++-- data/entities/vehicle-simple-attributes-sample.jsonld | 4 ++-- .../vehicle-two-datasetid-attributes-sample.jsonld | 2 +- .../2020-08-bus-temporal-representation-sample.jsonld | 2 +- ...ral-representation-multiple-instances-sample.jsonld | 2 +- ...0-08-vehicule-temporal-representation-sample.jsonld | 2 +- ...0-09-vehicule-temporal-representation-sample.jsonld | 2 +- ...temporal-representation-with-location-sample.jsonld | 2 +- .../entity-operations-after-query.jsonld | 2 +- .../entity-operations-before-query.jsonld | 2 +- ...e-temporal-representation-020-01-expectation.jsonld | 2 +- ...le-simplified-temporal-representation-sample.jsonld | 2 +- .../vehicle-temporal-representation-sample.jsonld | 2 +- 86 files changed, 131 insertions(+), 131 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index d73cf3a1..4fe17c79 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-sample-expectation-query-attributes.jsonld -${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel -${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 075a6e08..51685438 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities based on ids diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index a32ec395..93b9a80c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -12,9 +12,9 @@ ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= vehicle-parking-sample-expectation.jsonld -${building_entity_type}= https://uri.fiware.org/ns/data-models#Building -${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle -${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking +${building_entity_type}= https://ngsi-ld-test-suite/context#Building +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index f97279c1..83c5e708 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index afb3db77..4646d5e8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -8,9 +8,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building -${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel -${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index 07cfb0ff..f04a4d40 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 6d6f8cb1..3da48255 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index c9717c56..a98e1b62 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -12,9 +12,9 @@ ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= vehicle-parking-sample-expectation.jsonld -${building_entity_type}= https://uri.fiware.org/ns/data-models#Building -${vehicle_entity_type}= https://uri.fiware.org/ns/data-models#Vehicle -${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking +${building_entity_type}= https://ngsi-ld-test-suite/context#Building +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 32e200c0..835a8d93 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 82b7a91e..9e2f0661 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -8,9 +8,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building -${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel -${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 79e1ce2c..48d63ac5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index f1f322cb..d0ef11d2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_invalid_id_one}= thisisaninvaliduri1 ${entity_invalid_id_two}= thisisaninvaliduri2 diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 87739e2b..ec7b5736 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index bceffdaf..292c4f75 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${invalid_attribute_one}= invalid_attribute_one ${invalid_attribute_two}= invalid_attribute_two diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index a89e2924..cbc20c9a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 4deb4252..3ba5242e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -9,7 +9,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld ${options_parameter}= keyValues -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query entities in a simplified representation diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 6c07b580..bed3071a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${accept_header}= application/geo+json *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index d9659dd3..5f0b4f29 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${limit}= 2 *** Test Cases *** diff --git a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld index ce7e8b3a..7338e9e6 100644 --- a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld @@ -20,6 +20,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld index fccc6705..bd68cde6 100644 --- a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld @@ -13,6 +13,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld index 90753052..52e88ab7 100644 --- a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld @@ -15,6 +15,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld index 3d4599ec..d9637a17 100644 --- a/data/csourceRegistrations/context-source-registration-location-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -20,6 +20,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld index a3785ed2..5ad182c9 100644 --- a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld @@ -17,6 +17,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld index e08c3fbe..37db9bed 100644 --- a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld @@ -17,6 +17,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld index aee82568..9ca43fc1 100644 --- a/data/csourceRegistrations/context-source-registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -13,6 +13,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld index 177d2319..c6be20b4 100644 --- a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld @@ -13,6 +13,6 @@ "endpoint":"http://my.csource.org:1026", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld index a63a1891..f0a34969 100644 --- a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expired-sample.jsonld b/data/csourceSubscriptions/subscription-expired-sample.jsonld index 6666dc7a..92496316 100644 --- a/data/csourceSubscriptions/subscription-expired-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expired-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld index 72c0f7b8..235310ea 100644 --- a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld index 3dd0bc74..aaa7e064 100644 --- a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld @@ -21,6 +21,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld index 0e664bd6..5056e3e0 100644 --- a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld @@ -20,6 +20,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-inactive-sample.jsonld b/data/csourceSubscriptions/subscription-inactive-sample.jsonld index cadb9bea..2a0d91a7 100644 --- a/data/csourceSubscriptions/subscription-inactive-sample.jsonld +++ b/data/csourceSubscriptions/subscription-inactive-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld index b4c202a7..05121c6a 100644 --- a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld index 087b9fc2..16295647 100644 --- a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld @@ -15,6 +15,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-sample.jsonld b/data/csourceSubscriptions/subscription-sample.jsonld index 7ca438fd..99d55511 100644 --- a/data/csourceSubscriptions/subscription-sample.jsonld +++ b/data/csourceSubscriptions/subscription-sample.jsonld @@ -15,6 +15,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld index 7265fc1d..32326b2c 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld @@ -20,6 +20,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld index ef21a2b1..dae65cf1 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld @@ -20,6 +20,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld index 87a23d6f..8677f292 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld @@ -20,6 +20,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld index 1e5eff51..9f67f71d 100644 --- a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld +++ b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld index aac999b6..f70c6b27 100644 --- a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +++ b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld @@ -15,6 +15,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld index 1bca0769..6792f61b 100644 --- a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld @@ -16,6 +16,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld index 36bf7833..056087a7 100644 --- a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld +++ b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld @@ -8,6 +8,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/batch/invalid-json-ld-sample.jsonld b/data/entities/batch/invalid-json-ld-sample.jsonld index 1efd7f18..ec4c5389 100644 --- a/data/entities/batch/invalid-json-ld-sample.jsonld +++ b/data/entities/batch/invalid-json-ld-sample.jsonld @@ -7,8 +7,8 @@ "value":null }, "@context":[ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } ] \ No newline at end of file diff --git a/data/entities/batch/invalid-json-sample.jsonld b/data/entities/batch/invalid-json-sample.jsonld index dcbdb010..f1a5b876 100644 --- a/data/entities/batch/invalid-json-sample.jsonld +++ b/data/entities/batch/invalid-json-sample.jsonld @@ -3,8 +3,8 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } ] \ No newline at end of file diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index ffb69e92..72f7b220 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -17,7 +17,7 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld index 864d122e..0bb447e8 100644 --- a/data/entities/building-location-attribute.jsonld +++ b/data/entities/building-location-attribute.jsonld @@ -17,7 +17,7 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld index 7034854b..2af764ed 100644 --- a/data/entities/building-minimal-sample.jsonld +++ b/data/entities/building-minimal-sample.jsonld @@ -2,7 +2,7 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal.jsonld b/data/entities/building-minimal.jsonld index 23fadf8a..d39157ac 100644 --- a/data/entities/building-minimal.jsonld +++ b/data/entities/building-minimal.jsonld @@ -2,7 +2,7 @@ "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building", "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 2becbdb4..2cca72ea 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -24,7 +24,7 @@ "value": false }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-sample.jsonld b/data/entities/building-relationship-sample.jsonld index 5c6a1480..e55a2a40 100644 --- a/data/entities/building-relationship-sample.jsonld +++ b/data/entities/building-relationship-sample.jsonld @@ -6,7 +6,7 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship.jsonld b/data/entities/building-relationship.jsonld index ec4bb68b..34c28e02 100644 --- a/data/entities/building-relationship.jsonld +++ b/data/entities/building-relationship.jsonld @@ -6,7 +6,7 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 4d88363d..e4394e7c 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -20,7 +20,7 @@ "value": false }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld index d023d039..85a97476 100644 --- a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld +++ b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld @@ -1,6 +1,6 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", + "type": "https://ngsi-ld-test-suite/context#Building", "location": { "type": "GeoProperty", "value": { @@ -15,11 +15,11 @@ "type": "Property", "value": "Eiffel Tower" }, - "https://uri.fiware.org/ns/data-models#subCategory": { + "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-location-attribute-sample-expectation.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation.jsonld index 8e67b86e..b4f0f8b2 100644 --- a/data/entities/expectations/building-location-attribute-sample-expectation.jsonld +++ b/data/entities/expectations/building-location-attribute-sample-expectation.jsonld @@ -1,11 +1,11 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", + "type": "https://ngsi-ld-test-suite/context#Building", "name": { "type": "Property", "value": "Eiffel Tower" }, - "https://uri.fiware.org/ns/data-models#subCategory": { + "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": ["tourism"] }, @@ -17,6 +17,6 @@ } }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-sample-expectation.jsonld b/data/entities/expectations/building-minimal-sample-expectation.jsonld index 266cb229..d29ee00f 100644 --- a/data/entities/expectations/building-minimal-sample-expectation.jsonld +++ b/data/entities/expectations/building-minimal-sample-expectation.jsonld @@ -1,7 +1,7 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", + "type": "https://ngsi-ld-test-suite/context#Building", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld index 7a2623f6..93f2fb86 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld @@ -1,17 +1,17 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", - "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "https://ngsi-ld-test-suite/context#Building", + "https://ngsi-ld-test-suite/context#airQualityLevel": { "type": "Property", "value": 4, "observedAt": "2020-09-09T16:40:00.000Z", "unitCode": "C62" }, - "https://uri.fiware.org/ns/data-models#subCategory": { + "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld index e4abf08e..046ce109 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld @@ -1,11 +1,11 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", + "type": "https://ngsi-ld-test-suite/context#Building", "name": "Eiffel Tower", - "https://uri.fiware.org/ns/data-models#airQualityLevel": 4, - "https://uri.fiware.org/ns/data-models#almostFull": false, - "https://uri.fiware.org/ns/data-models#subCategory": "tourism", + "https://ngsi-ld-test-suite/context#airQualityLevel": 4, + "https://ngsi-ld-test-suite/context#almostFull": false, + "https://ngsi-ld-test-suite/context#subCategory": "tourism", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld index 74d575bf..35862406 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld @@ -1,25 +1,25 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", + "type": "https://ngsi-ld-test-suite/context#Building", "name": { "type": "Property", "value": "Eiffel Tower" }, - "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "https://ngsi-ld-test-suite/context#airQualityLevel": { "type": "Property", "value": 4, "observedAt": "2020-09-09T16:40:00.000Z", "unitCode": "C62" }, - "https://uri.fiware.org/ns/data-models#almostFull": { + "https://ngsi-ld-test-suite/context#almostFull": { "type": "Property", "value": false }, - "https://uri.fiware.org/ns/data-models#subCategory": { + "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld index 23254a3e..8d27d4a2 100644 --- a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld +++ b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld @@ -1,12 +1,12 @@ { - "https://uri.fiware.org/ns/data-models#speed": [ + "https://ngsi-ld-test-suite/context#speed": [ { "https://uri.etsi.org/ngsi-ld/datasetId": [ { "@id": "urn:ngsi-ld:Property:speedometerA4567-speed" } ], - "https://uri.fiware.org/ns/data-models#source": [ + "https://ngsi-ld-test-suite/context#source": [ { "@type": [ "https://uri.etsi.org/ngsi-ld/Property" diff --git a/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld b/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld index c4a970b3..00a0cd6b 100644 --- a/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld @@ -13,7 +13,7 @@ "value": "BMW" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld index 76037606..1e48b1af 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld @@ -13,5 +13,5 @@ "value": "BMW" }, "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld index 43e60c4c..f32c9912 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld @@ -13,7 +13,7 @@ "value": 23 }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld index 2d30b46e..af875bdd 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld @@ -8,7 +8,7 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld index bb28f7b3..e104e4d0 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld @@ -9,5 +9,5 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld index 9b220bf4..6fdcfbda 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld @@ -9,5 +9,5 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld index b3776989..efdff7ad 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld @@ -9,7 +9,7 @@ "datasetId": "" }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld index 86872a11..62f3ac6c 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld @@ -13,7 +13,7 @@ "value": 23 }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld index f8455144..2b414e02 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld @@ -17,6 +17,6 @@ } }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld index e108e52c..749042fd 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld index 17a6c11d..d070c1b7 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld index e442fe0d..b16aa20e 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/invalid-json-sample.jsonld b/data/entities/invalid-json-sample.jsonld index dcbdb010..f1a5b876 100644 --- a/data/entities/invalid-json-sample.jsonld +++ b/data/entities/invalid-json-sample.jsonld @@ -3,8 +3,8 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } ] \ No newline at end of file diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld index 841177ea..385f1929 100644 --- a/data/entities/parking-simple-attributes-sample.jsonld +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -30,7 +30,7 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-datasetid-attributes-sample.jsonld b/data/entities/vehicle-datasetid-attributes-sample.jsonld index 1654928a..c5298899 100644 --- a/data/entities/vehicle-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-datasetid-attributes-sample.jsonld @@ -33,7 +33,7 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 2da4522d..556d5af4 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -15,7 +15,7 @@ } }, "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 334902b0..ec44774f 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld index 22efffc5..f7454808 100644 --- a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -43,6 +43,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 23e1fff4..403c9652 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -178,6 +178,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index 070d566b..5631b82e 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -43,6 +43,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index 4f095bf1..c19d6c70 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -43,6 +43,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index e88e09d5..3920c63c 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -61,6 +61,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-after-query.jsonld b/data/temporalEntities/entity-operations-after-query.jsonld index 494f7062..e2ccd031 100644 --- a/data/temporalEntities/entity-operations-after-query.jsonld +++ b/data/temporalEntities/entity-operations-after-query.jsonld @@ -4,6 +4,6 @@ "timeAt":"2020-08-02T12:05:00Z", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-before-query.jsonld b/data/temporalEntities/entity-operations-before-query.jsonld index 9a5ab48f..46761194 100644 --- a/data/temporalEntities/entity-operations-before-query.jsonld +++ b/data/temporalEntities/entity-operations-before-query.jsonld @@ -4,6 +4,6 @@ "timeAt":"2020-08-02T12:05:00Z", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld index b632d1c6..0cef750a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld @@ -1,6 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", + "type":"https://ngsi-ld-test-suite/context#Vehicle", "https://ngsi-ld-test-suite/context#brandName":{ "type":"Property", "value":"Volvo" diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld index a0f6fe04..0cba7d94 100644 --- a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld @@ -17,6 +17,6 @@ }, "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 4f095bf1..c19d6c70 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -43,6 +43,6 @@ ], "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file -- GitLab From 2ef8f217137779c9432cf99d62b40eb875720f49 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 15 Feb 2021 10:47:13 +0100 Subject: [PATCH 114/442] feat: add TCs for JSON-LD context resolution in create and retrieve entity endpoints --- .../Consumption/Entity/018_06.robot | 39 +++++++++++++++++++ .../Entities/CreateEntity/001_04.robot | 28 +++++++++++++ .../Entities/CreateEntity/001_05.robot | 28 +++++++++++++ .../Entities/CreateEntity/001_06.robot | 22 +++++++++++ .../Entities/CreateEntity/001_07.robot | 28 +++++++++++++ .../Entities/CreateEntity/001_08.robot | 22 +++++++++++ .../Entities/CreateEntity/001_09.robot | 22 +++++++++++ ...ributes-sample-compacted-expectation.json} | 10 ++--- ...ttributes-sample-expanded-expectation.json | 22 +++++++++++ resources/ApiUtils.resource | 2 +- 10 files changed, 215 insertions(+), 8 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot rename data/entities/{building-simple-attributes.jsonld => expectations/building-simple-attributes-sample-compacted-expectation.json} (59%) create mode 100644 data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot new file mode 100644 index 00000000..48e921f2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entity +Suite Teardown Delete Created Entity + +Test Template Check Json-LD Resolution When retrieving an entity + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json +${creation_jsonld_expectation_filename}= building-simple-attributes-sample-compacted-expectation.json + +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext ${EMPTY} ${empty_jsonld_expectation_filename} +CreationTimeJsonLdContext ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} + +*** Keywords *** +Check Json-LD Resolution When retrieving an entity + [Arguments] ${context} ${expected_payload} + [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Tags] mandatory + + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} + +Setup Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + + Set Suite Variable ${entity_id} + +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot new file mode 100644 index 00000000..1491771a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Case *** +Create one entity using a provided Link header with JSON content type + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + # Attribute should be compacted as we used the same context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} + # Attribute should not be compacted as we did not provide a context containing this term + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot new file mode 100644 index 00000000..61060456 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Case *** +Create one entity using the default context with JSON content type + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + + Retrieve Entity by Id ${entity_id} + # Attribute should be compacted as we used the same default context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + # Attribute should not be compacted as we did not provide a context containing this term + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull + + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot new file mode 100644 index 00000000..1cbed680 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + +*** Test Case *** +Create one entity containing a JSON-LD @context with a JSON content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot new file mode 100644 index 00000000..4126526c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + +*** Test Case *** +Create one entity using a JSON-LD @context obtained from the request payload + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + # Attribute should be compacted as we used the same context as provided when creating the entity + Check Response Body Containing an Attribute set to almostFull + + Retrieve Entity by Id ${entity_id} + # Attribute should not be compacted as we did not provide a context containing this term + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot new file mode 100644 index 00000000..e0e609f4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Case *** +Create one entity not containing a JSON-LD @context with a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot new file mode 100644 index 00000000..aa738d4c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + +*** Test Case *** +Create one entity with a Link header and a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/entities/building-simple-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-compacted-expectation.json similarity index 59% rename from data/entities/building-simple-attributes.jsonld rename to data/entities/expectations/building-simple-attributes-sample-compacted-expectation.json index bc3dd795..7b86aadd 100644 --- a/data/entities/building-simple-attributes.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-compacted-expectation.json @@ -1,5 +1,5 @@ { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "id": "RandomUuidToBeReplaced", "type": "Building", "name": { "type": "Property", @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", @@ -18,9 +18,5 @@ "almostFull": { "type": "Property", "value": false - }, - "@context": [ - "https://fiware.github.io/data-models/context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] + } } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json new file mode 100644 index 00000000..134f7221 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "https://ngsi-ld-test-suite/context#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://ngsi-ld-test-suite/context#almostFull": { + "type": "Property", + "value": false + }, + "https://ngsi-ld-test-suite/context#subCategory": { + "type": "Property", + "value": "tourism" + } +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 66c2f958..6246a666 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -118,7 +118,7 @@ Create Entity Selecting Content Type ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${content_type}'=='${CONTENT_TYPE_JSON}' and '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} ${request}= Output request Output response -- GitLab From a5ac1502ad8b2780379c86e057ad9f86bad97bb8 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 15 Feb 2021 11:02:16 +0100 Subject: [PATCH 115/442] fix: remove core context in sample payloads to prevent from recursive context inclusion bug in JSON-LD lib --- ...source-registration-building-and-bus-entities-sample.jsonld | 3 +-- .../context-source-registration-bus-entities-sample.jsonld | 3 +-- ...text-source-registration-detailed-information-sample.jsonld | 3 +-- .../context-source-registration-location-sample.jsonld | 3 +-- ...ontext-source-registration-managementInterval-sample.jsonld | 3 +-- ...ntext-source-registration-observationInterval-sample.jsonld | 3 +-- .../context-source-registration-sample.jsonld | 3 +-- .../context-source-registration-vehicle-entities-sample.jsonld | 3 +-- .../subscription-empty-watchedAttributes-sample.jsonld | 3 +-- data/csourceSubscriptions/subscription-expired-sample.jsonld | 3 +-- data/csourceSubscriptions/subscription-expiresAt-sample.jsonld | 3 +-- data/csourceSubscriptions/subscription-geoQ-sample.jsonld | 3 +-- .../subscription-geoQ-without-geoproperty-sample.jsonld | 3 +-- data/csourceSubscriptions/subscription-inactive-sample.jsonld | 3 +-- .../subscription-invalid-query-sample.jsonld | 3 +-- .../subscription-invalid-type-sample.jsonld | 3 +-- data/csourceSubscriptions/subscription-sample.jsonld | 3 +-- .../subscription-temporalQ-createdAt-sample.jsonld | 3 +-- .../subscription-temporalQ-modifiedAt-sample.jsonld | 3 +-- .../subscription-temporalQ-observedAt-sample.jsonld | 3 +-- .../subscription-timeInterval-sample.jsonld | 3 +-- .../subscription-unreachable-endpoint-sample.jsonld | 3 +-- .../subscription-watchedAttributes-sample.jsonld | 3 +-- .../subscription-without-notification-sample.jsonld | 3 +-- .../2020-08-bus-temporal-representation-sample.jsonld | 3 +-- ...le-temporal-representation-multiple-instances-sample.jsonld | 3 +-- .../2020-08-vehicule-temporal-representation-sample.jsonld | 3 +-- .../2020-09-vehicule-temporal-representation-sample.jsonld | 3 +-- ...ehicule-temporal-representation-with-location-sample.jsonld | 3 +-- data/temporalEntities/entity-operations-after-query.jsonld | 3 +-- data/temporalEntities/entity-operations-before-query.jsonld | 3 +-- .../vehicle-simplified-temporal-representation-sample.jsonld | 3 +-- .../vehicle-temporal-representation-sample.jsonld | 3 +-- 33 files changed, 33 insertions(+), 66 deletions(-) diff --git a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld index 7338e9e6..d28b41ee 100644 --- a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld @@ -19,7 +19,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld index bd68cde6..ae6cd094 100644 --- a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld @@ -12,7 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld index 52e88ab7..d9a9649d 100644 --- a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld @@ -14,7 +14,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld index d9637a17..bc8a7d24 100644 --- a/data/csourceRegistrations/context-source-registration-location-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -19,7 +19,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld index 5ad182c9..cd35ed5b 100644 --- a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld @@ -16,7 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld index 37db9bed..b6bbf43b 100644 --- a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld @@ -16,7 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld index 9ca43fc1..2c8aeeae 100644 --- a/data/csourceRegistrations/context-source-registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -12,7 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld index c6be20b4..374df635 100644 --- a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld @@ -12,7 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld index f0a34969..fd71c4c4 100644 --- a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expired-sample.jsonld b/data/csourceSubscriptions/subscription-expired-sample.jsonld index 92496316..4f4ff095 100644 --- a/data/csourceSubscriptions/subscription-expired-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expired-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld index 235310ea..6d6dfe31 100644 --- a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld index aaa7e064..75b92efe 100644 --- a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld @@ -20,7 +20,6 @@ "geoproperty": "location" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld index 5056e3e0..fce0f6ec 100644 --- a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld @@ -19,7 +19,6 @@ "coordinates":[-8.52,41.2] }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-inactive-sample.jsonld b/data/csourceSubscriptions/subscription-inactive-sample.jsonld index 2a0d91a7..a00ea736 100644 --- a/data/csourceSubscriptions/subscription-inactive-sample.jsonld +++ b/data/csourceSubscriptions/subscription-inactive-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld index 05121c6a..9c155c72 100644 --- a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld index 16295647..e8a08488 100644 --- a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld @@ -14,7 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-sample.jsonld b/data/csourceSubscriptions/subscription-sample.jsonld index 99d55511..fd713519 100644 --- a/data/csourceSubscriptions/subscription-sample.jsonld +++ b/data/csourceSubscriptions/subscription-sample.jsonld @@ -14,7 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld index 32326b2c..1878b634 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld @@ -19,7 +19,6 @@ "timeproperty": "createdAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld index dae65cf1..287dc996 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld @@ -19,7 +19,6 @@ "timeproperty": "modifiedAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld index 8677f292..dfd410e7 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld @@ -19,7 +19,6 @@ "timeproperty": "observedAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld index 9f67f71d..15fffffe 100644 --- a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld +++ b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld index f70c6b27..39e5322f 100644 --- a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +++ b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld @@ -14,7 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld index 6792f61b..de343a44 100644 --- a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld index 056087a7..671be89d 100644 --- a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld +++ b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld @@ -7,7 +7,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld index f7454808..4ce85a57 100644 --- a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -42,7 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 403c9652..0049e966 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -177,7 +177,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index 5631b82e..e294b218 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -42,7 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index c19d6c70..65c4053a 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -42,7 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index 3920c63c..41201040 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -60,7 +60,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-after-query.jsonld b/data/temporalEntities/entity-operations-after-query.jsonld index e2ccd031..c561155c 100644 --- a/data/temporalEntities/entity-operations-after-query.jsonld +++ b/data/temporalEntities/entity-operations-after-query.jsonld @@ -3,7 +3,6 @@ "timerel":"after", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-before-query.jsonld b/data/temporalEntities/entity-operations-before-query.jsonld index 46761194..f4fba3d9 100644 --- a/data/temporalEntities/entity-operations-before-query.jsonld +++ b/data/temporalEntities/entity-operations-before-query.jsonld @@ -3,7 +3,6 @@ "timerel":"before", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld index 0cba7d94..ee96728f 100644 --- a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld @@ -16,7 +16,6 @@ ] }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index c19d6c70..65c4053a 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -42,7 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file -- GitLab From 0047a1e0f9aba4f213bb868edb70c52c15da85e2 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 15 Feb 2021 18:45:03 +0100 Subject: [PATCH 116/442] doc: add an example to run an individual test case --- scripts/run_tests.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index d403cf62..a5cf2f64 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -12,10 +12,12 @@ robot --critical mandatory --outputdir ./results . # run by specific tag(s) robot --include mandatory --outputdir ./results . -# run specific test suite +# run all the tests for context information robot --outputdir ./results ./TP/NGSI-LD/ContextInformation -robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot -robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot + +# run a specific test case +robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +robot --outputdir ./results --suite 001_01 . # run specific test case robot --outputdir ./results -t "SuccessCases_MinimalEntity" -- GitLab From 381225ce157ce6c7a32a71603d707debd6826da8 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 16 Feb 2021 10:01:39 +0100 Subject: [PATCH 117/442] feat: add tps for query context source registrations --- .../037_01.robot | 45 ++++++++++++++++ .../037_02.robot | 16 ++++++ .../037_03.robot | 25 +++++++++ .../037_04.robot | 36 +++++++++++++ .../037_05.robot | 33 ++++++++++++ .../037_06.robot | 41 ++++++++++++++ .../037_07.robot | 41 ++++++++++++++ .../037_08.robot | 36 +++++++++++++ .../037_09.robot | 39 ++++++++++++++ .../037_11.robot | 53 +++++++++++++++++++ ...-only-properties-information-sample.jsonld | 14 +++++ ...urce-registrations-037-01-expectation.json | 37 +++++++++++++ ...urce-registrations-037-04-expectation.json | 16 ++++++ ...e-registrations-037-05-01-expectation.json | 16 ++++++ ...e-registrations-037-05-02-expectation.json | 12 +++++ ...urce-registrations-037-06-expectation.json | 18 +++++++ ...urce-registrations-037-07-expectation.json | 26 +++++++++ ...urce-registrations-037-08-expectation.json | 16 ++++++ ...e-registrations-037-09-01-expectation.json | 20 +++++++ ...e-registrations-037-09-02-expectation.json | 20 +++++++ resources/ApiUtils.resource | 26 +++++++++ resources/AssertionUtils.resource | 11 ++++ 22 files changed, 597 insertions(+) create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot create mode 100644 data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot new file mode 100644 index 00000000..6f13b972 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of entity types type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} +With list of attribute names attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} + +*** Keywords *** +Query Context Source Registration + [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +Setup Initial Context Source Registrations + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot new file mode 100644 index 00000000..99bee923 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Query Context Source Registrations Without Entity Types and Attribute Names + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot new file mode 100644 index 00000000..8199b09f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration With Invalid Query Param + +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE +Invalid URI id invalidUri +Invalid Query q invalidQuery +Invalid GeoQuery georel within +Invalid Temporal Query timerel before + +*** Keywords *** +Query Context Source Registration With Invalid Query Param + [Arguments] ${query_param_name} ${query_param_value} + [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot new file mode 100644 index 00000000..78dadc23 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json + +*** Test Case *** +Query Context Source Registrations Without Context + [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context + [Tags] mandatory + + Query Context Source Registrations id=${context_source_registration_id} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +*** Keywords *** +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot new file mode 100644 index 00000000..399fa003 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: + +*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH +Registration With EntityInfo Matching The Query csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json +Registration Without EntityInfo csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json + +*** Keywords *** +Query Context Source Registration Matching EntityInfo of RegistrationInfo + [Arguments] ${registration_file_path} ${expectation_file_path} + [Documentation] Check that you can query context source registrations matching EntityInfo of RegistrationInfo + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${registration_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + + [Teardown] Delete Context Source Registration ${context_source_registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot new file mode 100644 index 00000000..97f25291 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH +Query With Matching Properties And Relationships name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json +Query Without Properties And Relationships ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + +*** Keywords *** +Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo + [Arguments] ${attrs_value} ${expectation_file_path} + [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +*** Keywords *** +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot new file mode 100644 index 00000000..efcd3952 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching Geoquery +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH +Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} +Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} + +*** Keywords *** +Query Context Source Registration Matching Geoquery + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} + [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot new file mode 100644 index 00000000..256d3393 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json + +*** Test Case *** +Query Context Source Registration Without Temporal Query + [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +*** Keywords *** +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot new file mode 100644 index 00000000..8b0f1f10 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching Temporal Query + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json +${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json + +*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH +Observation Interval With observedAt ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} +Observation Interval Without timeproperty ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} +Mqnagement Interval With createdAt ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} +Mqnagement Interval With modifiedAt ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} + +*** Keywords *** +Query Context Source Registration Matching Temporal Query + [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} + [Documentation] Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval + [Tags] mandatory + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building timeproperty=${timeproperty} timerel=before timeAt=2021-08-01T22:00:00Z + + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + + [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot new file mode 100644 index 00000000..ee83a7d7 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration With Limit And Page Parameters +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} +Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + +*** Keywords *** +Query Context Source Registration With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} + [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} + + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} + +Setup Initial Context Source Registrations + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Create Context Source Registration ${third_context_source_registration_payload} + + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + Set Suite Variable ${third_context_source_registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration ${third_context_source_registration_id} diff --git a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld new file mode 100644 index 00000000..71583c35 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld @@ -0,0 +1,14 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "propertyNames":["name", "subCategory"] + } + ], + "endpoint":"http://my.csource.org:1026", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json new file mode 100644 index 00000000..b8d0242e --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json @@ -0,0 +1,37 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + }, + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ], + "propertyNames":[ + "name", + "subCategory" + ], + "relationshipNames":[ + "locatedAt" + ] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json new file mode 100644 index 00000000..46ec3a76 --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json @@ -0,0 +1,16 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"https://ngsi-ld-test-suite/context#Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json new file mode 100644 index 00000000..0ddd335c --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json @@ -0,0 +1,16 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json new file mode 100644 index 00000000..51faeabc --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json @@ -0,0 +1,12 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "propertyNames":["name", "subCategory"] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json new file mode 100644 index 00000000..baa1c66e --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json @@ -0,0 +1,18 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ], + "propertyNames":["name", "subCategory"], + "relationshipNames":["locatedAt"] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json new file mode 100644 index 00000000..51487e5a --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json @@ -0,0 +1,26 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"GeoProperty", + "value":{ + "type":"Point", + "coordinates":[ + -8.521, + 41.2 + ] + } + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json new file mode 100644 index 00000000..0ddd335c --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json @@ -0,0 +1,16 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json new file mode 100644 index 00000000..1312004a --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json @@ -0,0 +1,20 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "observationInterval":{ + "startAt":"2020-08-01T22:07:00Z", + "endAt":"2021-08-01T21:07:00Z" + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json new file mode 100644 index 00000000..cb0ab1fe --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json @@ -0,0 +1,20 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "managementInterval":{ + "startAt":"2020-08-01T22:07:00Z", + "endAt":"2021-08-01T21:07:00Z" + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 6246a666..15cc86db 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -431,6 +431,32 @@ Update Context Source Registration Set Test Variable ${response} +Query Context Source Registrations + [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} + Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} + Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} + Delete Context Source Registration [Arguments] ${context_source_registration_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 2116fcfb..c75596b9 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -194,6 +194,17 @@ Check Response Body Containing Attribute element ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${attribute_payload} ${ignored_keys} Should Be True ${comparison_result} msg=Attribute Comparison Failed +Check Response Body Containing List Containing Context Source Registrations elements + [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} + ${expected_context_source_registrations_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + ${index}= Set Variable 0 + FOR ${expected_context_source_registration_id} IN @{expected_context_source_registrations_ids} + ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} + ${index}= Evaluate ${index} + 1 + END + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${expected_context_source_registrations_payload} ${EMPTY} + Should Be True ${comparaison_result} msg=Context Source Registration Comparaison Failed + Check Response Body Type When Using Session Request [Arguments] ${response} ${type} Should Be Equal ${response['type']} ${type} -- GitLab From 81fb776ddc77d353f65872be81070e2d91d6d626 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 16 Feb 2021 10:07:06 +0100 Subject: [PATCH 118/442] feat: add TCs JSON-LD @context resolution on context source registrations --- .../033_04.robot | 29 +++++++++++++ .../033_05.robot | 29 +++++++++++++ .../033_06.robot | 24 +++++++++++ .../033_07.robot | 29 +++++++++++++ .../033_08.robot | 24 +++++++++++ .../033_09.robot | 24 +++++++++++ .../036_05.robot | 42 +++++++++++++++++++ .../context-source-registration-sample.json | 14 +++++++ resources/ApiUtils.resource | 5 ++- resources/AssertionUtils.resource | 14 ++----- 10 files changed, 221 insertions(+), 13 deletions(-) create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot create mode 100644 TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot create mode 100644 data/csourceRegistrations/context-source-registration-sample.json diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot new file mode 100644 index 00000000..c03dae1e --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + +*** Test Case *** +Create one context source registration using a provided Link header with JSON content type + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code 201 ${response['status']} + + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot new file mode 100644 index 00000000..3d0410e9 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + +*** Test Case *** +Create one context source registration using the default context with JSON content type + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response['status']} + + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building + + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot new file mode 100644 index 00000000..c79245ee --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld + +*** Test Case *** +Create one context source registration containing a JSON-LD @context with a JSON content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot new file mode 100644 index 00000000..17057c04 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -0,0 +1,29 @@ +*** Settings *** +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld + +*** Test Case *** +Create one context source registration using a JSON-LD @context obtained from the request payload + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot new file mode 100644 index 00000000..f09aaf23 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + +*** Test Case *** +Create one context source registration not containing a JSON-LD @context with a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot new file mode 100644 index 00000000..1c6c0058 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld + +*** Test Case *** +Create one context source registration with a Link header and a JSON-LD content type + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} ${ngsild_test_suite_context} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot new file mode 100644 index 00000000..368f6259 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + +Test Template Check JSON-LD resolution when retrieving a context source registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json +${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext ${EMPTY} ${expectation_file_path_expanded} +CreationTimeJsonLdContext ${ngsild_test_suite_context} ${expectation_file_path_compacted} + +*** Keywords *** +Check JSON-LD resolution when retrieving a context source registration + [Arguments] ${context} ${expected_payload} + [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Tags] mandatory + + Retrieve Context Source Registration ${context_source_registration_id} context=${context} + + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expected_payload} ${context_source_registration_id} + +Setup Initial Context Source Registration + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/data/csourceRegistrations/context-source-registration-sample.json b/data/csourceRegistrations/context-source-registration-sample.json new file mode 100644 index 00000000..b4a6b06e --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-sample.json @@ -0,0 +1,14 @@ +{ + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 15cc86db..1a69029a 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -225,8 +225,9 @@ Retrieve Attribute Set Test Variable ${response} Create Context Source Registration With Return - [Arguments] ${payload} - &{headers}= Create Dictionary Content-Type=application/ld+json + [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} ${request}= Output request Output response diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c75596b9..0349eb62 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -250,17 +250,9 @@ Check HTTP Response Body Json Schema Is Validate Json ${schema} ${response['body']} Log Json Schema Validation OK -Should Be Present In Json List - [Arguments] ${expr} ${json_field} ${json_value} - Log Check if ${json_field} is present in ${expr} with the value ${jsonvalue} - :FOR ${item} IN @{expr} - \ Exit For Loop If "${item['${json_field}']}" == "${json_value}" - Log Item found ${item} - [return] ${item} - -Check Result Contains - [Arguments] ${source} ${parameter} ${value} - Should Be Present In Json List ${source} ${parameter} ${value} +Check JSON Value In Response Body + [Arguments] ${json_path_expr} ${value_to_check} + Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} Check NotificationParams [Arguments] ${filename} ${expected_additional_members} -- GitLab From fbc43f39c5674bd6a016db58a5e119650475d8e5 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 16 Feb 2021 10:43:56 +0100 Subject: [PATCH 119/442] fix: expand Vehicule type with the ngsild test suite context --- .../types/expectations/entity-type-023-01-01-expectation.json | 4 ++-- .../types/expectations/entity-type-023-01-02-expectation.json | 2 +- .../expectations/entity-type-list-022-01-01-expectation.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/types/expectations/entity-type-023-01-01-expectation.json b/data/types/expectations/entity-type-023-01-01-expectation.json index 313f19dd..e938df4f 100644 --- a/data/types/expectations/entity-type-023-01-01-expectation.json +++ b/data/types/expectations/entity-type-023-01-01-expectation.json @@ -11,9 +11,9 @@ ] }, { - "id":"https://uri.etsi.org/ngsi-ld/default-context/Vehicle", + "id":"https://ngsi-ld-test-suite/context#Vehicle", "type":"EntityType", - "typeName":"Vehicle", + "typeName":"https://ngsi-ld-test-suite/context#Vehicle", "attributeNames":[ "https://ngsi-ld-test-suite/context#brandName", "isParked" diff --git a/data/types/expectations/entity-type-023-01-02-expectation.json b/data/types/expectations/entity-type-023-01-02-expectation.json index a268dc81..8ccb9903 100644 --- a/data/types/expectations/entity-type-023-01-02-expectation.json +++ b/data/types/expectations/entity-type-023-01-02-expectation.json @@ -11,7 +11,7 @@ ] }, { - "id":"https://uri.etsi.org/ngsi-ld/default-context/Vehicle", + "id":"https://ngsi-ld-test-suite/context#Vehicle", "type":"EntityType", "typeName":"Vehicle", "attributeNames":[ diff --git a/data/types/expectations/entity-type-list-022-01-01-expectation.json b/data/types/expectations/entity-type-list-022-01-01-expectation.json index f1069708..9b60d3bb 100644 --- a/data/types/expectations/entity-type-list-022-01-01-expectation.json +++ b/data/types/expectations/entity-type-list-022-01-01-expectation.json @@ -3,6 +3,6 @@ "type": "EntityTypeList", "typeList": [ "https://ngsi-ld-test-suite/context#Building", - "Vehicle" + "https://ngsi-ld-test-suite/context#Vehicle" ] } \ No newline at end of file -- GitLab From 8499bf104845020daeb53611badba1e8c391e695 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 19 Feb 2021 11:32:53 +0100 Subject: [PATCH 120/442] feat: add missing tp in query temporal evolution of entities --- .../021_10.robot | 42 +++++++++++++++++++ resources/ApiUtils.resource | 3 +- resources/AssertionUtils.resource | 2 +- resources/JsonUtils.resource | 9 ++++ resources/MockServerUtils.resource | 21 ++++++++++ resources/variables.py | 4 +- 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot create mode 100644 resources/MockServerUtils.resource diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot new file mode 100644 index 00000000..05bdf75f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Suite Setup Create Initial Context Source Registration +Suite Teardown Delete Initial Context Source Registration + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_url}= http://${context_source_host}:${context_source_port} + +*** Test Case *** +Query the temporal evolution of entities matching the given NGSI-LD context source filter + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Building + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + Wait for redirected request + Check Response Status Code Set To 200 + +*** Keywords *** +Create Initial Context Source Registration + Start Context Source Mock Server + + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload_file_path} ${context_source_registration_id} + + Create Context Source Registration ${context_source_registration_payload} + + Set Suite Variable ${context_source_registration_id} + +Delete Initial Context Source Registration + Stop Context Source Mock Server + + Delete Context Source Registration ${context_source_registration_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 1a69029a..7a31f554 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -369,7 +369,7 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} @@ -384,6 +384,7 @@ Query Temporal Representation Of Entities Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} + Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 0349eb62..cda0beb8 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -135,7 +135,7 @@ Check Response Body Containing List Containing Subscription elements ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} Should Be True ${comparison_result} msg=Subscription Comparison Failed -# Since response body can be a json object if it contains one subscription +# Since response body can be a json object if it contains one element # A check on the response body type is needed Check Response Body Containing Number Of Entities [Arguments] ${expected_entity_type} ${expected_length} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index c0827f79..07767d1d 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -6,6 +6,7 @@ Library JSONLibrary *** Variable *** ${date_format}= %Y-%m-%dT%H:%M:%SZ ${notification_server_url}= http://${notification_server_host}:${notification_server_port}/notify +${context_source_url}= http://${context_source_host}:${context_source_port} *** Keywords *** Load Entity @@ -34,6 +35,14 @@ Load Subscription Sample With Reachable Endpoint [return] ${subscription} +Load Context Source Registration Sample With Reachable Context Source + [Arguments] ${context_source_registration_file_path} ${context_source_registration_id}=${EMPTY} ${context_source_endpoint_uri}=${context_source_url} + + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_file_path} ${context_source_registration_id} + ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..endpoint ${context_source_endpoint_uri} + + [return] ${context_source_registration} + Remove Entity Type [Arguments] ${entity} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource new file mode 100644 index 00000000..9aa766e2 --- /dev/null +++ b/resources/MockServerUtils.resource @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Mock http server for context sources +Library HttpCtrl.Server + +*** Keywords *** +Start Context Source Mock Server + #Initialize HTTP Client And Server + Start Server 0.0.0.0 8086 + +Wait for redirected request + [Arguments] ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + +Stop Context Source Mock Server + #Terminate HTTP Server + Stop Server diff --git a/resources/variables.py b/resources/variables.py index 8cbd37d4..4890d76b 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -3,7 +3,9 @@ def get_variables(arg=None): 'url': 'https://broker-ngsi-ld.demeter.ubiwhere.com/ngsi-ld/v1', 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', 'notification_server_host': '0.0.0.0', - 'notification_server_port': 8085 + 'notification_server_port': 8085, + 'context_source_host': '0.0.0.0', + 'context_source_port': 8086 } return variables \ No newline at end of file -- GitLab From 1a620d5664908a660861d88e393301b28ab81932 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 23 Feb 2021 15:50:23 +0000 Subject: [PATCH 121/442] added entity attributes and fixed bugs --- .../Consumption/Entity/018_02.robot | 2 +- .../Consumption/Entity/018_03_01.robot | 2 +- .../Consumption/Entity/018_03_02.robot | 2 +- .../Consumption/Entity/018_04.robot | 2 +- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 8 +- .../Consumption/Entity/019_01_02.robot | 9 +- .../Consumption/Entity/019_01_03.robot | 6 +- .../Consumption/Entity/019_01_04.robot | 13 +-- .../Consumption/Entity/019_01_05.robot | 6 +- .../Consumption/Entity/019_02_01.robot | 2 +- .../Consumption/Entity/019_02_02.robot | 2 +- .../Consumption/Entity/019_02_03.robot | 2 +- .../Consumption/Entity/019_02_04.robot | 2 +- .../Consumption/Entity/019_02_05.robot | 2 +- .../Consumption/Entity/019_03_01.robot | 2 +- .../Consumption/Entity/019_03_02.robot | 2 +- .../Consumption/Entity/019_03_03.robot | 2 +- .../Consumption/Entity/019_03_04.robot | 2 +- .../Consumption/Entity/019_03_05.robot | 2 +- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- .../Consumption/Entity/019_06.robot | 2 +- .../Provision/EntityAttributes/010_02.robot | 30 +++++-- .../EntityAttributes/010_02_03.robot | 26 ------ .../Provision/EntityAttributes/010_03.robot | 2 +- .../Provision/EntityAttributes/011_01.robot | 2 +- .../Provision/EntityAttributes/011_02.robot | 36 +++++--- .../EntityAttributes/011_02_03.robot | 26 ------ .../{011_04.robot => 011_03.robot} | 0 .../Provision/EntityAttributes/012_01.robot | 2 +- .../Provision/EntityAttributes/012_02.robot | 2 +- .../Provision/EntityAttributes/012_03.robot | 2 +- .../Provision/EntityAttributes/013_01.robot | 2 +- .../Provision/EntityAttributes/013_02.robot | 2 +- .../Provision/EntityAttributes/013_03.robot | 2 +- .../Provision/TemporalEntity/001.robot | 27 ------ .../Provision/TemporalEntity/007_01.robot | 26 ++++++ .../Provision/TemporalEntity/007_02.robot | 42 ++++++++++ .../Provision/TemporalEntity/008_01.robot | 25 ++++++ .../Provision/TemporalEntity/009_01.robot | 21 +++++ .../Provision/TemporalEntity/009_02.robot | 25 ++++++ .../Provision/TemporalEntity/009_03.robot | 21 +++++ .../Provision/TemporalEntity/014_01.robot | 24 ++++++ .../Provision/TemporalEntity/014_02.robot | 53 ++++++++++++ .../Provision/TemporalEntity/014_03.robot | 26 ++++++ .../Provision/TemporalEntity/015_01.robot | 33 ++++++++ .../Provision/TemporalEntity/015_02.robot | 40 +++++++++ .../Provision/TemporalEntity/015_03.robot | 39 +++++++++ .../Provision/TemporalEntity/016_01.robot | 40 +++++++++ .../Provision/TemporalEntity/016_02.robot | 43 ++++++++++ .../Provision/TemporalEntity/016_03.robot | 42 ++++++++++ .../Provision/TemporalEntity/017_01.robot | 28 +++++++ .../Provision/TemporalEntity/017_02.robot | 42 ++++++++++ .../Provision/TemporalEntity/017_03.robot | 41 ++++++++++ .../033_02.robot | 26 ++++-- .../033_02_01.robot | 22 ----- .../034_02.robot | 35 ++++++-- .../034_02_05.robot | 27 ------ ...attributes-query-sample-expectation.jsonld | 18 ++++ .../vehicle-parking-sample-expectation.jsonld | 60 ++++++++++++++ ...oral-representation-fragment-sample.jsonld | 14 ++++ ...le-temporal-intanceid-update-sample.jsonld | 12 +++ ...-representation-empty-json-fragment.jsonld | 0 ...oral-representation-fragment-sample.jsonld | 22 +++++ ...epresentation-invalid-json-fragment.jsonld | 47 +++++++++++ ...ion-without-context-fragment-sample.jsonld | 19 +++++ ...cle-temporal-invalid-context-sample.jsonld | 47 +++++++++++ ...al-representation-empty-json-sample.jsonld | 0 ...-representation-invalid-json-sample.jsonld | 47 +++++++++++ ...icle-temporal-representation-sample.jsonld | 4 +- ...mporal-representation-update-sample.jsonld | 47 +++++++++++ ...resentation-without-context-sample.jsonld} | 0 ...al-representation-without-id-sample.jsonld | 48 +++++++++++ resources/ApiUtils.resource | 82 +++++++++++++++++-- resources/AssertionUtils.resource | 15 ++++ 76 files changed, 1233 insertions(+), 209 deletions(-) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{011_04.robot => 011_03.robot} (100%) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot delete mode 100644 TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot delete mode 100644 TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot create mode 100644 data/entities/expectations/building-attributes-query-sample-expectation.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld create mode 100644 data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld rename data/temporalEntities/{vehicle-temporal-representation-withou-context-sample.jsonld => vehicle-temporal-representation-without-context-sample.jsonld} (100%) create mode 100644 data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index f91428d6..548f50ed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] mandatory failing + [Tags] mandatory ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 3349a57a..5bad223c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 164e4581..534477a0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an atris not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index ce5a82b2..366e2126 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index 8ee32f94..d7e60109 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 075a6e08..8811972f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -25,11 +25,13 @@ Query several entities based on ids ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index a32ec395..4c93e4cc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -32,11 +32,12 @@ Query several entities based on the entities types ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + #@{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} + Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index f97279c1..859d1364 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} @@ -23,11 +23,11 @@ Query several entities based on the given id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} + @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index afb3db77..acde9947 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -6,8 +6,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-sample-expectation.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory @@ -15,17 +16,17 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index 07cfb0ff..e50cd66c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -6,15 +6,15 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld ${entity_type}= https://uri.fiware.org/ns/data-models#Building ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 6d6f8cb1..cc5212af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index c9717c56..48f23f49 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://uri.fiware.org/ns/data-models#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 32e200c0..d165add1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 82b7a91e..8c185147 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -15,7 +15,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 79e1ce2c..e9428400 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index f1f322cb..2498e50b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index fbe5ef33..79fb8608 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] mandatory failing + [Tags] mandatory ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 87739e2b..8f1764d6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index bceffdaf..f2a2da7b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -14,7 +14,7 @@ ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index a89e2924..3a578342 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -13,7 +13,7 @@ ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 4deb4252..4a3f8ff1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://uri.fiware.org/ns/data-models#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 6c07b580..6e7d5a01 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index d9659dd3..f705469d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] mandatory failing + [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 2e059f80..17a1ceac 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -4,23 +4,26 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Append Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld ${status_code}= 400 +${invalid_fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld -*** Test Cases *** ENTITY_INVALID_ID -010_02_01_Append entity attributes if the entity Id is not present ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI thisisaninvaliduri +*** Test Cases *** +010_02_01_Append entity attributes if the entity Id is not present + Append Attributes ${EMPTY} +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri +010_02_03_Append entity attributes with invalid entity fragments + Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -31,4 +34,19 @@ Append Attributes Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Append entity attributes with invalid entity fragments + [Documentation] Check that you cannot append entity attributes with invalid entity fragments + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot deleted file mode 100644 index 864d9dbb..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot append entity attributes with invalid entity fragments -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Append entity attributes with invalid entity fragments - [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 155aa02c..e84799b5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index 58c836c2..f7bc5eef 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -20,7 +20,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index 851ec9ca..2bcc4482 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -4,30 +4,46 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld -*** Test Cases *** STATUS_CODE ENTITY_INVALID_ID -011_02_01_Update an attribute if the Entity Id is not present 400 ${EMPTY} -011_02_02_Update an attribute if the Entity Id is not a valid URI 400 thisisaninvaliduri +*** Test Cases *** +011_02_01_Update an attribute if the Entity Id is not present + Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_02_Update an attribute if the Entity Id is not a valid URI + Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld +011_02_03_Update entity attributes with invalid entity fragments + Update entity attributes with invalid entity fragments vehicle-datasetid-attributes-sample.jsonld invalid-vehicle-fragment-datasetid-sample.jsonld *** Keywords *** Update Attributes - [Arguments] ${status_code} ${entity_invalid_id} + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Update entity attributes with invalid entity fragments + [Arguments] ${filename} ${fragment_filename} + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] mandatory + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Output ${fragment_filename} + ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + #Check Response Status Code ${response} + #Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + #Check Response Body Title When Using Session Request ${response.json()} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot deleted file mode 100644 index b64ac927..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02_03.robot +++ /dev/null @@ -1,26 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update an attribute if the entity fragment is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld - -*** Test Cases *** -Update entity attributes with invalid entity fragments - [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] mandatory failing - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_04.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 6c379833..442c7273 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -20,7 +20,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index e9e74050..9204ca02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index e69df34a..07858243 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 9ce044b2..8b00f797 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} [Documentation] Check that you can delete an attribute from an entity - [Tags] mandatory failing + [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot index be253f2f..5ee5aaa5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot index 7f527c1e..889e2450 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory failing + [Tags] mandatory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot deleted file mode 100644 index b0743d7f..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/001.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: - -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_Create a temporal representation of an entity with simplified temporal representation of an Entity vehicle-simplified-temporal-representation-sample.jsonld application/json -001_02_Create a temporal representation of an entity with simple temporal properties vehicle-temporal-representation-sample.jsonld application/ld+json -001_03_Create an temporal entity with no context vehicle-temporal-representation-withou-context-sample.jsonld application/ld+json - -*** Keywords *** -Create Temporal Entity - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create a temporal representation of an entity - [Tags] mandatory - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} - Check Response Status Code 201 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot new file mode 100644 index 00000000..7c05ccbb --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you can create a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity vehicle-temporal-representation-sample.jsonld application/ld+json +007_01_02_Create a temporal entity with no context vehicle-temporal-representation-without-context-sample.jsonld application/json + +*** Keywords *** +Create Temporal Entity + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + Check Response Status Code 201 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot new file mode 100644 index 00000000..15e94366 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${status_code}= 400 + +*** Test Cases *** +007_02_01_Create a temporal entity with an invalid json + Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld + +007_02_02_Create a temporal entity with an empty json + Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld + +007_02_03_Create a temporal entity with missing id + Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld + +007_02_04_Create a temporal invalid URI + Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + +*** Keywords *** +Create Temporal Entity From File + [Arguments] ${filename} + [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id + [Tags] mandatory + + ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + +Create Temporal Entity + [Arguments] ${entity_id} ${filename} + [Documentation] Check that you cannot create a temporal entity with an invalid @context + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot new file mode 100644 index 00000000..68dd8cf8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that you can update a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld + +*** Test Cases *** +008_01_Update a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot new file mode 100644 index 00000000..2f87e8dd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** +Delete a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Check Response Status Code 204 ${response['status']} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot new file mode 100644 index 00000000..4c713c74 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE ID +009_02_01_Delete a temporal representation of an entity with an empty entity id 400 ${EMPTY} +009_02_02 Delete a temporal representation of an entity with an invalid entity id 400 invalidId + +*** Keywords *** +Delete Temporal Entity + [Arguments] ${status_code} ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Tags] mandatory + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot new file mode 100644 index 00000000..c3a1e041 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot @@ -0,0 +1,21 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 + +*** Test Cases *** +009_03 Delete a temporal representation of an entity with a unknown entity id + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot new file mode 100644 index 00000000..e30995ff --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld + +*** Test Cases *** +014_01_02_Add an attribute to a temporal entity with simple temporal properties + [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot new file mode 100644 index 00000000..7eb7acc9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 400 + +*** Test Cases *** +014_02_01_Add an attribute to a temporal representation of an entity with invalid content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld + +014_02_02_Add an attribute to a temporal representation of an entity with empty content + Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld + +014_02_03_Add an attribute to a temporal representation of an entity with an empty entity id + Fail To Add Attribute To Temporal Entity ${EMPTY} + +014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id + Fail To Add Attribute To Temporal Entity thisIsAninvalidId + +*** Keywords *** +Add an Attribute To a Temporal Entity + [Arguments] ${update_filename} + [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Fail To Add Attribute To Temporal Entity + [Arguments] ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot new file mode 100644 index 00000000..1ca7648a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with not found EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${status_code}= 404 + +*** Test Cases *** +Add Attribute To Temporal Entity + [Documentation] Check that an error is raised if you delete a temporal enitity with not found EnityId EnityId + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot new file mode 100644 index 00000000..aeb72a1b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attribute From A Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel + +*** Test Cases *** DELETEALL DATASETID +015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel +015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel + +*** Keywords *** +Delete Attribute From A Temporal Entity + [Arguments] ${deleteAll} ${datasetId} + [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot new file mode 100644 index 00000000..f6ca104a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute from temporal entity with unknow entity/attribute id + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId +015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalidName + +*** Keywords *** +Delete attribute from temporal entity with unknow entity/attribute id + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot new file mode 100644 index 00000000..7623acb4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist ${unknown_temporal_entity_id} fuelLevel +015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute ${valid_temporal_entity_id} notExistingAttribute + +*** Keywords *** +Delete Attribute + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Tags] mandatory + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} + +Create Id + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} + Set Suite Variable ${unknown_temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot new file mode 100644 index 00000000..a27641f8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can partially update an attribute instance of a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +016_01_Partially update an attribute instance of a temporal representation of an entity + [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + Should Be Equal As Strings ${createdAt_before_update} ${modifiedAt_before_update} + Should Be Equal As Strings ${createdAt_before_update} ${createdAt_after_update} + ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch + ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch + Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot new file mode 100644 index 00000000..99d5d0f7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot new file mode 100644 index 00000000..60debbb9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot new file mode 100644 index 00000000..b6b727c8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you can delete an attribute instance in temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed + +*** Test Cases *** +017_01_Delete an attribute instance in temporal representation of an entity + [Documentation] Check that you can delete an attribute instance in temporal representation of an entity + [Tags] mandatory + + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot new file mode 100644 index 00000000..c9818876 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete attribute instance + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId +017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Delete attribute instance + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot new file mode 100644 index 00000000..e0cbd05b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Partially Update Temporal Entity + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} +017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] mandatory + + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Create Id + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index bd9a79ff..29742cca 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -4,15 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Context Source With Invalid Content - - *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Cases *** FILENAME -033_02_02_Create a context source registration with a different data structure than CsourRegistration data type csourceRegistrations/registration-invalid-structure-sample.jsonld -033_02_03_Create a context source registration with a date in the past csourceRegistrations/registration-past-expiration-sample.jsonld +*** Test Cases *** +033_02_01_Create a context source registration with invalid JSON file + Create a context source registration with invalid JSON file +033_02_02_Create a context source registration with a different data structure than CsourRegistration data type + Create Context Source With Invalid Content csourceRegistrations/registration-invalid-structure-sample.jsonld +033_02_03_Create a context source registration with a date in the past + Create Context Source With Invalid Content csourceRegistrations/registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content @@ -28,3 +30,15 @@ Create Context Source With Invalid Content Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} [Teardown] Delete Context Source Registration ${registration_id} + +Create a context source registration with invalid JSON file + [Documentation] Create a context source registration with invalid JSON file + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot deleted file mode 100644 index b89f36b0..00000000 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02_01.robot +++ /dev/null @@ -1,22 +0,0 @@ -*** Settings *** -Documentation Create a context source registration with invalid JSON file -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Cases *** -Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 1068f5b2..08e3a176 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -5,17 +5,23 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities -Test Template Update Context Source *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: ${filename}= registration-sample.jsonld +${registration_payload_file_path}= registration-invalid-sample.jsonld -*** Test Case *** REGISTRATION_ID FRAGMENT_FILENAME -034_02_01_Update a context source registration by id if the Id is not present ${EMPTY} registration-with-expiration-sample.jsonld -034_02_02_Update a context source registration by id if the Id is not a valid URI invalidURI registration-with-expiration-sample.jsonld -034_02_03_Update a context source registration if the request body is not of the same data type ${valid_registration_id} registration-different-type-sample.jsonld -034_02_04_Update a context source registration if you attempt to remove a mandatory property ${valid_registration_id} registration-invalid-structure-sample.jsonld +*** Test Case *** +034_02_01_Update a context source registration by id if the Id is not present + Update Context Source ${EMPTY} registration-with-expiration-sample.jsonld +034_02_02_Update a context source registration by id if the Id is not a valid URI + Update Context Source invalidURI registration-with-expiration-sample.jsonld +034_02_03_Update a context source registration if the request body is not of the same data type + Update Context Source ${valid_registration_id} registration-different-type-sample.jsonld +034_02_04_Update a context source registration if you attempt to remove a mandatory property + Update Context Source ${valid_registration_id} registration-invalid-structure-sample.jsonld +034_02_05_Update a context source registration if the request body is invalid + Update a context source registration if the request body is invalid *** Keywords *** Update Context Source @@ -35,6 +41,23 @@ Update Context Source [Teardown] Delete Context Source Registration ${valid_registration_id} +Update a context source registration if the request body is invalid + [Documentation] Check that you cannot update a context source registration if the request body is invalid + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} + + [Teardown] Delete Context Source Registration ${registration_id} + + Setup Initial Entities ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${valid_registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot deleted file mode 100644 index 0d986b93..00000000 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02_05.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Check that you cannot update a context source registration if the request body is invalid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld -${registration_payload_file_path}= registration-invalid-sample.jsonld - -*** Test Case *** -Update a context source registration if the request body is invalid - [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld new file mode 100644 index 00000000..332addc2 --- /dev/null +++ b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld @@ -0,0 +1,18 @@ + + { + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://uri.fiware.org/ns/data-models#Building", + "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://uri.fiware.org/ns/data-models#subCategory": { + "type": "Property", + "value": "tourism" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld index e69de29b..3eb294f5 100644 --- a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld +++ b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld @@ -0,0 +1,60 @@ +[ + { + "id": "urn:ngsi-ld:OffStreetParking:1149507078845158", + "type": "https://uri.fiware.org/ns/data-models#OffStreetParking", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.5, + 41.2 + ] + } + }, + "name": { + "type": "Property", + "value": "Downtown One" + }, + "https://uri.fiware.org/ns/data-models#availableSpotNumber": { + "type": "Property", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + }, + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "https://uri.fiware.org/ns/data-models#reliability": { + "type": "Property", + "value": 0.7 + } + }, + "https://uri.fiware.org/ns/data-models#totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + { + "id": "urn:ngsi-ld:Vehicle:8601152883544931", + "type": "https://uri.fiware.org/ns/data-models#Vehicle", + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "https://uri.fiware.org/ns/data-models#brandName": { + "type": "Property", + "value": "Mercedes" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld new file mode 100644 index 00000000..28242dc7 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,14 @@ +{ + "added_attribute": { + "type": "Property", + "values": [ + [121,"2018-08-01T12:03:00Z"], + [80,"2018-08-01T12:05:00Z"], + [100,"2018-08-01T12:07:00Z"] + ] + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld new file mode 100644 index 00000000..60e19dde --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld @@ -0,0 +1,12 @@ +{ + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-empty-json-fragment.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld new file mode 100644 index 00000000..985d962a --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld @@ -0,0 +1,22 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld new file mode 100644 index 00000000..95b7174f --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld new file mode 100644 index 00000000..922b0d31 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld @@ -0,0 +1,19 @@ +{ + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld new file mode 100644 index 00000000..9f8f2dd8 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "invalidcontext" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-empty-json-sample.jsonld new file mode 100644 index 00000000..e69de29b diff --git a/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld new file mode 100644 index 00000000..95b7174f --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:8313926113148778",, + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 4f095bf1..47075f58 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -38,11 +38,11 @@ { "type":"Property", "value":40, - "observedAt":"2020-09-01T14:07:00Z" + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld new file mode 100644 index 00000000..67e57257 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -0,0 +1,47 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":121, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld similarity index 100% rename from data/temporalEntities/vehicle-temporal-representation-withou-context-sample.jsonld rename to data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld diff --git a/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld new file mode 100644 index 00000000..e803e2f9 --- /dev/null +++ b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ca87fce1..22b11db6 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -140,7 +140,7 @@ Append Entity Attributes Using Session [return] ${response} Update Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} @@ -158,7 +158,7 @@ Update Entity Attributes [return] ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} Output request Output response @@ -204,7 +204,7 @@ Update Context Source Registration Using Session Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any - ${request}= Output request + Output request Output response [return] ${response} @@ -224,13 +224,83 @@ Create Entity Output request Output response -Create Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} +Create Or Update Temporal Representation Of Entity Selecting Content Type + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} + Output request + Output response + [return] ${response} +Create Temporal Representation Of Entity Selecting Content Type Using Session + [Arguments] ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} + Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Append Attribute To Temporal Entity Using Session + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + Create Session OneRequest ${url} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} + Output request + Output response + [return] ${response} + +Partial Update Attribute From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Attribute From Temporal Entity + [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} headers=${headers} + Output request + Output response + [return] ${response} + +Delete Temporal Representation Of Entity With Returning Response + [Arguments] ${temporal_entity_representation_id} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response + [return] ${response} + +Get Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} ${content_type} ${options}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + &{params}= Create Dictionary + ${options_length} = Get Length ${options} + Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + +Delete Attribute Instance From Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} Output request Output response [return] ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 415a2d02..4381f713 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -75,6 +75,8 @@ Check Response Body Containing Entity element [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + Log ${entity} + Log ${response_body} ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=Entity Comparaison Failed @@ -86,6 +88,19 @@ Check Response Body Containing List Containing Entity Elements ${index}= Evaluate ${index} + 1 END +Check Response Body Containing List Containing Entity Elements With Different Types + [Arguments] ${filename} ${entities_representation_ids} ${response_body} + ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} + ${index}= Set Variable 1 + FOR ${entity_representation_id} IN @{entities_representation_ids} + ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} + ${index}= Evaluate ${index} - 1 + END + Log ${response_body} + Log ${entities_representation_payload} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=Entity List Comparaison Failed + Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} -- GitLab From a9520625fa16fc75f64c43f5a96adc6c632a1c70 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 4 Mar 2021 21:01:55 +0000 Subject: [PATCH 122/442] added common behaviours --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 255 ++++++++++++--- TP/NGSI-LD/CommonBehaviours/044_03.robot | 297 +++++++++++++++--- TP/NGSI-LD/CommonBehaviours/044_04.robot | 212 ++++++++++--- TP/NGSI-LD/CommonBehaviours/044_05.robot | 144 ++++++--- .../Consumption/Entity/019_01_02.robot | 2 +- ...on-with-expiration-expectation-sample.json | 60 ++++ .../subscription-sample-expectation.json | 16 + data/entities/building-minimal-sample.jsonld | 3 +- .../building-simple-attributes-sample.jsonld | 3 +- ...sample-expectation-query-attributes.jsonld | 2 +- ...-simple-attributes-sample-expectation.json | 22 ++ ...imple-attributes-sample-expectation.jsonld | 2 +- .../vehicle-parking-sample-expectation.json | 54 ++++ .../vehicle-parking-sample-expectation.jsonld | 4 +- ...cle-fragment-empty-datasetid-sample.jsonld | 3 +- .../parking-simple-attributes-sample.jsonld | 3 +- ...vehicle-datasetid-attributes-sample.jsonld | 3 +- .../vehicle-simple-attributes-sample.jsonld | 3 +- ...e-temporal-representation-expectation.json | 44 +++ ...le-temporal-intanceid-update-sample.jsonld | 2 +- resources/ApiUtils.resource | 178 ++++++++--- resources/AssertionUtils.resource | 14 + 22 files changed, 1126 insertions(+), 200 deletions(-) create mode 100644 data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json create mode 100644 data/csourceSubscriptions/expectations/subscription-sample-expectation.json create mode 100644 data/entities/expectations/building-simple-attributes-sample-expectation.json create mode 100644 data/entities/expectations/vehicle-parking-sample-expectation.json create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 0db0694c..bccd74d2 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -1,46 +1,229 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids -Test Template Throw 503 LDContextNotAvaliable error - *** Variable *** -${expected_status_code}= 503 ${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-simple-attributes-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.json +${building_expectation}= building-simple-attributes-sample-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building + ${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_expectation}= subscription-sample-expectation.json + +${types_expectation}= types/expectations/entity-type-list-022-01-01-expectation.json +${type_expectation}= types/expectations/entity-type-info-024-01-expectation.json + +${attributes_expectation}= types/expectations/attribute-list-025-01-01-expectation.json +${attribute_expectation}= types/expectations/attribute-027-01-expectation.json + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/registration-with-expiration-sample.jsonld +${registration_expectation}= registration-with-expiration-expectation-sample.json +${registration_type}= Vehicle + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${tea_expectation}= vehicle-temporal-representation-expectation.json +${teatype}= Vehicle + + +*** Test Cases *** +044_02_01_endpoint /entities/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/) + ${id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_compared}= Create List ${id} + ${entities_ids_to_be_retrieved}= Set Variable ${id} + + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing List Containing Entity elements ${building_expectation} ${entities_ids_to_be_compared} ${response['body']} + + [Teardown] Delete Entity by Id Returning Response ${id} + +044_02_02_endpoint /entities/{entityId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) + ${id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Entity ${id} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} + + [Teardown] Delete Entity by Id Returning Response ${id} + +044_02_03_endpoint /subscriptions/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Subscriptions + Check Response Status Code 200 ${response['status']} + Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} + + [Teardown] Delete Subscription ${id} + +044_02_04_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Retrieve Subscription ${id} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} + + [Teardown] Delete Subscription ${id} + +044_02_05_endpoint /types/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/types/) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + + Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${vehicle_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + + Retrieve Entity Types context=${EMPTY} accept=${EMPTY} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeList element ${types_expectation} + + [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + +044_02_06_endpoint /types/{type} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/types/{type}) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + + Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} -*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld - -*** Keywords *** -Throw 503 LDContextNotAvaliable error - [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved - [Tags] mandatory - - ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + + Retrieve Entity Type type=Building context=${EMPTY} accept=${EMPTY} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeInfo element ${type_expectation} + + [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + +044_02_07_endpoint /attributes/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/attributes/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Retrieve Attributes context=${EMPTY} accept=${EMPTY} + Check Response Status Code Set To 200 + Check Response Body Containing AttributeList element ${attributes_expectation} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_02_08_endpoint /attributes/{attrId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/attributes/{attrId}) - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} - -Generate Random Ids - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} - ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${entity_id} - Set Suite Variable ${temporal_entity_id} - Set Suite Variable ${csourceRegistration_id} - Set Suite Variable ${csourceSubscription_id} - Set Suite Variable ${subscription_id} \ No newline at end of file + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + + Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} accept=${EMPTY} + Check Response Status Code Set To 200 + Check Response Body Containing Attribute element ${attribute_expectation} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_02_09_endpoint /csourceRegistrations/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + Query Context Source Registrations id=${registration_id} type=${registration_type} + Check Response Status Code Set To 200 + Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} + + [Teardown] Delete Context Source Registration ${registration_id} + +044_02_10_endpoint /csourceRegistrations/{registrationId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/{registrationId}) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + Retrieve Context Source Registration ${registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} + + [Teardown] Delete Context Source Registration ${registration_id} + +044_02_11_endpoint /csourceSubscriptions/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceSubscriptions/) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Query Context Source Registration Subscriptions + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${subscription_expectation} ${subscription_id} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +044_02_12_endpoint /csourceSubscriptions/{subscriptionId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceSubscriptions/{subscriptionId}) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Retrieve Context Source Registration Subscription ${subscription_id} + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${subscription_expectation} ${subscription_id} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +044_02_13_endpoint /temporal/entities + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + + Query Temporal Representation Of Entities entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +044_02_14_endpoint /temporal/entities/{entityId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities/{entityId}) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index 0db0694c..02bdff5f 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -1,46 +1,269 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids -Test Template Throw 503 LDContextNotAvaliable error - *** Variable *** -${expected_status_code}= 503 -${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld +${vehicle_attribute}= speed +${vehicle_fragment}= vehicle-fragment-empty-datasetid-sample.jsonld + ${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/registration-sample.jsonld +${registration_fragment}= csourceRegistrations/registration-with-expiration-sample.jsonld + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${tea_fragment}= vehicle-temporal-intanceid-update-sample.jsonld +${tea_attribute}= speed +${tea_first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${tea_second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building + +*** Test Cases *** +044_03_01_endpoint patch /entities/{entityId}/attrs/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/) + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Entity Attributes ${entity_id} ${vehicle_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_03_02_endpoint patch /entities/{entityId}/attrs/{attrId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_03_03_endpoint patch /subscriptions/{subscriptionId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Subscription ${id} ${subscription_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Subscription ${id} -*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld - -*** Keywords *** -Throw 503 LDContextNotAvaliable error - [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved - [Tags] mandatory - - ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} +044_03_04_endpoint patch /csourceRegistrations/{registrationId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /csourceRegistrations/{registrationId}) - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} - -Generate Random Ids - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} - ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${entity_id} - Set Suite Variable ${temporal_entity_id} - Set Suite Variable ${csourceRegistration_id} - Set Suite Variable ${csourceSubscription_id} - Set Suite Variable ${subscription_id} \ No newline at end of file + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Context Source Registration With Return ${registration_id} ${registration_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} + +044_03_05_endpoint patch /csourceSubscriptions/{subscriptionId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /csourceSubscriptions/{subscriptionId}) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + ${subscription_update_fragment}= Load Test Sample ${subscription_fragment} + ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + + +044_03_06_endpoint patch /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /temporal/entities/{entityId}/attrs/{attrId}/{instanceId}) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${instanceId}= Set Variable ${response['body']['https://ngsi-ld-test-suite/context#speed'][0]['instanceId']} + + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${tea_attribute} ${instanceId} ${tea_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +044_03_07_endpoint post /entities/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} + +044_03_08_endpoint post /entities/{entityId}/attrs/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/{entityId}/attrs/) + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes ${entity_id} ${vehicle_fragment} ${EMPTY} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_03_09_endpoint post /subscriptions/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) + + ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Subscription ${subscriptions_id} + +044_03_10_endpoint post /csourceRegistrations/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /csourceRegistrations/) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} content_type=${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} + +044_03_11_endpoint post /csourceSubscriptions/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /csourceSubscriptions/) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + ${request} ${response}= Create Context Source Registration Subscription With Return ${subscription_payload} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +044_03_12_endpoint post /entityOperations/create + + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} content_type=${EMPTY} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 415 + + [Teardown] Batch Delete Entities @{expected_entities_ids} + + +044_03_13_endpoint post /entityOperations/upsert + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/upsert) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + + Batch Upsert Entities By Selecting Content Type @{entities_to_be_upserted} ${EMPTY} + Check Response Status Code Set To 415 + + [Teardown] Batch Delete Entities @{expected_entities_ids} + +044_03_14_endpoint post /entityOperations/update + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/update) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + + Batch Update Entities @{entities_to_be_updated} ${EMPTY} + Check Response Status Code Set To 415 + + [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + + +044_03_15_endpoint post /entityOperations/delete + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/delete) + + ${first_entity_id}= Generate Random Entity Id ${id_prefix} + ${second_entity_id}= Generate Random Entity Id ${id_prefix} + Create Entity ${building_filename} ${first_entity_id} + Create Entity ${building_filename} ${second_entity_id} + + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities By Selecting Content Type @{entities_ids_to_be_deleted} ${EMPTY} + Check Response Status Code Set To 415 + +044_03_16_endpoint post /entityOperations/query + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/query) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Query Entity ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} content_type=${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + +044_03_17_endpoint post /temporal/entities/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +044_03_18_endpoint post /temporal/entityOperations/query + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entityOperations/query) + + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${tea_second_vehicle_payload_file} ${second_temporal_entity_representation_id} + @{temporal_entity_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + + Query Temporal Representation Of Entities Via Post entity-operations-after-query.jsonld ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Several Temporal Representations Of Entities @{temporal_entity_representation_ids} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 0db0694c..aa010577 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -1,46 +1,184 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids -Test Template Throw 503 LDContextNotAvaliable error - *** Variable *** -${expected_status_code}= 503 +${accept}= application/xml +${status_code}= 406 + ${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: +${building_filename}= building-simple-attributes-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building + ${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/registration-sample.jsonld + +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld +${vehicle_attribute}= speed + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** +044_04_01_endpoint get /entities/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + + +044_04_02_endpoint get /entities/{entityId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Entity ${entity_id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_03_endpoint get /subscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Query Subscriptions accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +044_04_04_endpoint get /subscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +044_04_05_endpoint get /types/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /types/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Retrieve Entity Types With Return ${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_06_endpoint get /types/{type} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /types/{type}) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Retrieve Entity Type With Return ${entity_type} ${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_07_endpoint get /attributes/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /attributes/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + ${response}= Retrieve Attributes With Return ${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_08_endpoint get /attributes/{attrId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /attributes/{attrId}) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Attribute With Return airQualityLevel ${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_09_endpoint get /csourceRegistrations/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) + + Query Context Source Registrations type=Building accept=${accept} + Check Response Status Code Set To ${status_code} + + +044_04_10_endpoint get /csourceRegistrations/{registrationId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/{registrationId}) + + ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${registration_filename} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + + + Retrieve Context Source Registration ${context_source_registration_id} accept=${accept} + Check Response Status Code Set To ${status_code} + + [Teardown] Delete Context Source Registration ${context_source_registration_id} + + +044_04_11_endpoint get /csourceSubscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) + + Query Context Source Registration Subscriptions accept=${accept} + Check Response Status Code Set To ${status_code} + +044_04_12_endpoint get /csourceSubscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/{subscriptionId}) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + Retrieve Context Source Registration Subscription ${subscription_id} accept=${accept} + Check Response Status Code Set To ${status_code} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +044_04_13_endpoint get /temporal/entities + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + + @{entity_types_to_be_retrieved}= Create List Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Check Response Status Code Set To ${status_code} + +044_04_14_endpoint get /temporal/entities/{entityId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities/{entityId}) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} accept=${accept} + Check Response Status Code Set To ${status_code} -*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld - -*** Keywords *** -Throw 503 LDContextNotAvaliable error - [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved - [Tags] mandatory - - ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} - -Generate Random Ids - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} - ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${entity_id} - Set Suite Variable ${temporal_entity_id} - Set Suite Variable ${csourceRegistration_id} - Set Suite Variable ${csourceSubscription_id} - Set Suite Variable ${subscription_id} \ No newline at end of file + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index 0db0694c..de22aa7c 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -1,46 +1,116 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids -Test Template Throw 503 LDContextNotAvaliable error - *** Variable *** -${expected_status_code}= 503 +${accept}= application/geo+json +${status_code}= 406 + ${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: +${building_filename}= building-simple-attributes-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building + ${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= registration-sample.jsonld +${registration_fragment}= registration-with-expiration-sample.jsonld + +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld +${vehicle_attribute}= speed + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld + +*** comment *** +044_05_01_endpoint /subscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/subscriptions/) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +044_05_02_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + + ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +#044_05_03_endpoint /types/ +# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/types/) + +#044_05_04_endpoint /types/{type} +# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/types/{type}) + +#044_05_05_endpoint /attributes/ +# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/attributes/) + + +#044_05_06_endpoint /attributes/{attrId} +# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/attributes/{attrId}) + +044_05_07_endpoint /csourceRegistrations/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceRegistrations/) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} + + + +044_05_08_endpoint /csourceRegistrations/{registrationId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceRegistrations/{registrationId}) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_fragment} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} + + +044_05_09_endpoint /csourceSubscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceSubscriptions/) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} accept=${accept} + Check Response Status Code Set To ${status_code} + + [Teardown] Delete Context Source Registration Subscription ${subscription_id} + +*** Test Cases *** +044_05_10_endpoint /csourceSubscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceSubscriptions/{subscriptionId}) + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + + ${subscription_update_fragment}= Load Test Sample ${subscription_fragment} + ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${CONTENT_TYPE_LD_JSON} #accept=${accept} + Check Response Status Code ${status_code} ${response['status']} -*** Test Cases *** ID DELETE_ID ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${entity_id} ${entity_id} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -043_02_endpoint /csourceRegistrations/ ${csourceRegistration_id} ${csourceRegistration_id} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -043_03_endpoint /subscriptions/ ${subscription_id} ${subscription_id} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_04_endpoint /csourceSubscriptions/ ${csourceSubscription_id} /${csourceSubscription_id} ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_05_endpoint /temporal/entities/ ${temporal_entity_id} /${temporal_entity_id} ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld - -*** Keywords *** -Throw 503 LDContextNotAvaliable error - [Arguments] ${id} ${delete_id} ${endpoint} ${filename_path} - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved - [Tags] mandatory - - ${response}= Create Request By Selecting Endpoint ${id} ${endpoint} ${filename_path} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} - -Generate Random Ids - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${temporal_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${csourceRegistration_id}= Generate Random Entity Id ${registration_id_prefix} - ${csourceSubscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${entity_id} - Set Suite Variable ${temporal_entity_id} - Set Suite Variable ${csourceRegistration_id} - Set Suite Variable ${csourceSubscription_id} - Set Suite Variable ${subscription_id} \ No newline at end of file + [Teardown] Delete Context Source Registration Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index a4cbc5f3..0ba110b1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -11,7 +11,7 @@ ${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld -${expectation_filename}= vehicle-parking-sample-expectation.jsonld +${expectation_filename}= vehicle-parking-sample-expectation.json ${building_entity_type}= https://ngsi-ld-test-suite/context#Building ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking diff --git a/data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json b/data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json new file mode 100644 index 00000000..ee6679e4 --- /dev/null +++ b/data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json @@ -0,0 +1,60 @@ + { + "id": "urn:ngsi-ld:Registration:randomUUID", + "type": "ContextSourceRegistration", + "timestamp": {}, + "endpoint": "http://my.csource.org:1026", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Registration:3911535208644330", + "type": "Vehicle" + } + ], + "ngsi-ld:properties": [], + "ngsi-ld:relationships": [] + }, + { + "entities": [ + { + "type": "OffStreetParking", + "idPattern": ".*downtown$" + }, + { + "type": "OffStreetParking", + "idPattern": ".*47$" + } + ], + "ngsi-ld:properties": [], + "ngsi-ld:relationships": [] + } + ], + "ngsi-ld:internal": false, + "location": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ] + } + } \ No newline at end of file diff --git a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json new file mode 100644 index 00000000..42d6c58f --- /dev/null +++ b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json @@ -0,0 +1,16 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type": "Subscription", + "entities": [ + { + "type": "https://ngsi-ld-test-suite/context#Building" + } + ], + "notification": { + "endpoint": { + "accept": "application/json", + "uri": "http://my.endpoint.org/notify" + }, + "format": "keyValues" + } +} \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld index 2af764ed..e49a2c9a 100644 --- a/data/entities/building-minimal-sample.jsonld +++ b/data/entities/building-minimal-sample.jsonld @@ -2,7 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index e4394e7c..821498e6 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -20,7 +20,6 @@ "value": false }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld index 93f2fb86..6f8083d0 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld @@ -12,6 +12,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expectation.json new file mode 100644 index 00000000..f23a0d02 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.json @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "https://ngsi-ld-test-suite/context#airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "unitCode": "C62" + }, + "https://ngsi-ld-test-suite/context#almostFull": { + "type": "Property", + "value": false + }, + "https://ngsi-ld-test-suite/context#subCategory": { + "type": "Property", + "value": "tourism" + } +} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld index 35862406..fb18f016 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld @@ -20,6 +20,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.json b/data/entities/expectations/vehicle-parking-sample-expectation.json new file mode 100644 index 00000000..0205a53f --- /dev/null +++ b/data/entities/expectations/vehicle-parking-sample-expectation.json @@ -0,0 +1,54 @@ +[ + { + "id": "urn:ngsi-ld:OffStreetParking:randomUUID", + "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "availableSpotNumber": { + "type": "Property", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Camera:C1" + }, + "reliability": { + "type": "Property", + "value": 0.7 + }, + "value": 121, + "observedAt": "2017-07-29T12:05:02Z" + }, + "totalSpotNumber": { + "type": "Property", + "value": 200 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.5, + 41.2 + ] + } + }, + "name": { + "type": "Property", + "value": "Downtown One" + } + }, + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Vehicle", + "https://ngsi-ld-test-suite/context#brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + } + } +] \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld index 3eb294f5..363e4eee 100644 --- a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld +++ b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld @@ -1,6 +1,6 @@ [ { - "id": "urn:ngsi-ld:OffStreetParking:1149507078845158", + "id": "urn:ngsi-ld:OffStreetParking:randomUUID", "type": "https://uri.fiware.org/ns/data-models#OffStreetParking", "location": { "type": "GeoProperty", @@ -38,7 +38,7 @@ ] }, { - "id": "urn:ngsi-ld:Vehicle:8601152883544931", + "id": "urn:ngsi-ld:Vehicle:randomUUID", "type": "https://uri.fiware.org/ns/data-models#Vehicle", "isParked": { "type": "Relationship", diff --git a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld index af875bdd..4cfc15e3 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld @@ -8,7 +8,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld index 385f1929..982cfb89 100644 --- a/data/entities/parking-simple-attributes-sample.jsonld +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -30,7 +30,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-datasetid-attributes-sample.jsonld b/data/entities/vehicle-datasetid-attributes-sample.jsonld index c5298899..6f0a34e5 100644 --- a/data/entities/vehicle-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-datasetid-attributes-sample.jsonld @@ -33,7 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 556d5af4..0553c272 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json b/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json new file mode 100644 index 00000000..7917df3c --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json @@ -0,0 +1,44 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Vehicle", + "https://ngsi-ld-test-suite/context#brandName": { + "type": "Property", + "value": "BMW", + "instanceId": "urn:ngsi-ld:76739600-3d5c-4cfd-939d-34742a13b52d" + }, + "https://ngsi-ld-test-suite/context#fuelLevel": [ + { + "type": "Property", + "datasetId": "urn:ngsi-ld:Vehicle:12345-fuel", + "value": 40, + "instanceId": "urn:ngsi-ld:0f6e7514-e3ed-46a6-9e9f-6bb02ff687bf", + "observedAt": "2020-09-01T14:07:00Z" + }, + { + "type": "Property", + "value": 53, + "instanceId": "urn:ngsi-ld:59ebe244-14d6-4428-87e1-cd313748125c", + "observedAt": "2020-09-01T13:05:00Z" + }, + { + "type": "Property", + "value": 67, + "instanceId": "urn:ngsi-ld:8bfeea42-8ed3-4d4e-a942-c389229bd6ff", + "observedAt": "2020-09-01T12:03:00Z" + } + ], + "https://ngsi-ld-test-suite/context#speed": [ + { + "type": "Property", + "value": 120, + "instanceId": "urn:ngsi-ld:ec47b86f-656e-4182-b1c2-fbe5af5b4862", + "observedAt": "2020-09-01T12:03:00Z" + }, + { + "type": "Property", + "value": 80, + "instanceId": "urn:ngsi-ld:f3ffc7ad-e562-4081-bd8a-5dda92ab0ffd", + "observedAt": "2020-09-01T12:05:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld index 60e19dde..d7433ad6 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld @@ -7,6 +7,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fdadc5cd..745a2d28 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -49,12 +49,13 @@ Delete Entity by Id Output response Query Entity - [Arguments] ${id} ${accept} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} + [Arguments] ${id} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${attrs_length} = Get Length ${attrs} + ${accept_length} = Get Length ${accept} ${options_length} = Get Length ${options} &{headers}= Create Dictionary &{params}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} + Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} @@ -66,14 +67,15 @@ Query Entity [return] ${response} Query Entities - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${CONTENT_TYPE_LD_JSON} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} + [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${attrs_length} = Get Length ${attrs} + ${accept_length} = Get Length ${accept} ${options_length} = Get Length ${options} ${entity_ids_length} = Get Length ${entity_ids} ${entity_types_length} = Get Length ${entity_types} &{headers}= Create Dictionary &{params}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} + Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} @@ -180,22 +182,24 @@ Partial Update Entity Attributes [return] ${response} Retrieve Entity Types - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} Output request Output response Set Test Variable ${response} Retrieve Entity Type - [Arguments] ${type} ${context}=${EMPTY} + [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} Output request @@ -204,10 +208,11 @@ Retrieve Entity Type Set Test Variable ${response} Retrieve Attributes - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${details} Set To Dictionary ${params} details=${details} ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} @@ -217,9 +222,10 @@ Retrieve Attributes Set Test Variable ${response} Retrieve Attribute - [Arguments] ${attribute_name} ${context}=${EMPTY} + [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} Output request @@ -228,8 +234,9 @@ Retrieve Attribute Set Test Variable ${response} Create Context Source Registration With Return - [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${context} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} ${request}= Output request @@ -246,8 +253,9 @@ Create Context Source Registration Using Session [return] ${response} Update Context Source Registration With Return - [Arguments] ${registration_id} ${fragment} ${content_type} + [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} ${request}= Output request Output response @@ -368,11 +376,18 @@ Delete Temporal Representation Of Entity With Returning Response Output response [return] ${response} +Delete Several Temporal Representations Of Entities + [Arguments] @{temporal_entity_representation_ids} + FOR ${temporal_entity_representation_id} IN @{temporal_entity_representation_ids} + Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + END + Get Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${content_type} ${options}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} + [Arguments] ${temporal_entity_representation_id} ${accept}=${EMPTY} ${options}=${EMPTY} + &{headers}= Create Dictionary &{params}= Create Dictionary ${options_length} = Get Length ${options} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request @@ -395,15 +410,6 @@ Update Temporal Representation Of Entity Selecting Content Type Output response [return] ${response} -Get Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${accept}=${CONTENT_TYPE_LD_JSON} - ${headers}= Create Dictionary - &{headers}= Create Dictionary Accept ${accept} - ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} - Output request - Output response - [return] ${response} - Batch Create Entities [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary @@ -466,12 +472,13 @@ Create Temporal Representation Of Entity Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} &{headers}= Create Dictionary &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} @@ -486,12 +493,13 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} @@ -514,9 +522,9 @@ Query Temporal Representation Of Entities Set Test Variable ${response} Query Temporal Representation Of Entities Via Post - [Arguments] ${query_file_name} + [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_LD_JSON} ${headers}= Create Dictionary - Set To Dictionary ${headers} Content-Type ${CONTENT_TYPE_LD_JSON} + Set To Dictionary ${headers} Content-Type ${content_type} ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} ${response}= POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} Output request @@ -551,11 +559,12 @@ Update Context Source Registration Set Test Variable ${response} Query Context Source Registrations - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} accept=${accept} Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} @@ -586,9 +595,10 @@ Delete Context Source Registration Set Suite Variable ${response} Retrieve Context Source Registration - [Arguments] ${context_source_registration_id} ${context}=${EMPTY} + [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} Output request @@ -597,9 +607,10 @@ Retrieve Context Source Registration Set Test Variable ${response} Create Context Source Registration Subscription - [Arguments] ${subscription_payload} + [Arguments] ${subscription_payload} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=application/ld+json + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} ${request}= Output request Output response @@ -617,9 +628,10 @@ Update Context Source Registration Subscription Set Test Variable ${response} Retrieve Context Source Registration Subscription - [Arguments] ${subscription_id} ${context}=${EMPTY} + [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} Output request @@ -628,10 +640,11 @@ Retrieve Context Source Registration Subscription Set Test Variable ${response} Query Context Source Registration Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} @@ -659,17 +672,20 @@ Update Context Source Registration Subscription From File Set Test Variable ${response} Create Subscription - [Arguments] ${subscription_id} ${filename_path} ${content_type} + [Arguments] ${subscription_id} ${filename_path} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} + Output request Output response [return] ${response} Update Subscription - [Arguments] ${subscription_id} ${fragment_filename} ${content_type} + [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request @@ -683,10 +699,102 @@ Delete Subscription Output response [return] ${response} +Query Subscriptions + [Arguments] ${limit}=${EMPTY} ${accept}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + [return] ${response} + +Retrieve Subscription + [Arguments] ${id} ${accept}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + + ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} + Output request + Output response + [return] ${response} + Update Context Source Registration Subscription By Selecting Content Type - [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} + [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response - [return] ${response} \ No newline at end of file + [return] ${response} + +Retrieve Entity Types With Return + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + [return] ${response} + +Retrieve Entity Type With Return + [Arguments] ${type} ${accept}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response + [return] ${response} + +Retrieve Attributes With Return + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + [return] ${response} + +Retrieve Attribute With Return + [Arguments] ${attribute_name} ${accept}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response + [return] ${response} + +Create Context Source Registration Subscription With Return + [Arguments] ${subscription_payload} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + ${request}= Output request + Output ${response} + [return] ${request} ${response} + +Batch Upsert Entities By Selecting Content Type + [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Update Entities By Selecting Content Type + [Arguments] @{entities_to_be_updated} ${content_type}=${CONTENT_TYPE_LD_JSON} ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Delete Entities By Selecting Content Type + [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} + Output request + Output response + Run Keyword If not ${teardown} Set Test Variable ${response} + Set Test Variable ${response} \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 60545bf1..ae045c3d 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -285,3 +285,17 @@ Check Pagination Prev And Next Headers Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link']} ${expected_links} ignore_order=True Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} + +Check Response Body Containing One Subscription element + [Arguments] ${expectation_filename} ${response_body} + ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} + ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${subscription} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=Entity Comparison Failed + +Check Response Body Containing One Registration element + [Arguments] ${expectation_filename} ${response_body} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} + ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${subscription} ${instance_id_regex_expr} + Should Be True ${comparison_result} msg=Entity Comparison Failed \ No newline at end of file -- GitLab From 260ddd918ed081ef50a698cd9bc944dde7bbde51 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 8 Mar 2021 09:34:41 +0000 Subject: [PATCH 123/442] reviewed test queries and files context --- .../Consumption/Entity/018_02.robot | 4 +- .../Consumption/Entity/018_03_02.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 2 +- .../Consumption/Entity/019_01_02.robot | 1 - .../Consumption/Entity/019_01_04.robot | 6 +- .../Consumption/Entity/019_01_05.robot | 2 +- .../Consumption/Entity/019_02_01.robot | 5 +- .../Consumption/Entity/019_02_02.robot | 5 +- .../Consumption/Entity/019_02_03.robot | 5 +- .../Consumption/Entity/019_02_04.robot | 3 +- .../Consumption/Entity/019_02_05.robot | 4 +- .../Consumption/Entity/019_03_01.robot | 2 +- .../Consumption/Entity/019_03_02.robot | 2 +- .../Consumption/Entity/019_03_04.robot | 3 +- .../Consumption/Entity/019_03_05.robot | 6 +- .../Consumption/Entity/019_04.robot | 6 +- .../Consumption/Entity/019_05.robot | 5 +- .../Consumption/Entity/019_06.robot | 2 +- .../Entities/CreateEntity/001_01.robot | 5 +- .../Entities/CreateEntity/001_02.robot | 2 +- .../Entities/DeleteEntity/002_02.robot | 9 +-- .../{002_03_.robot => 002_03.robot} | 0 .../Provision/EntityAttributes/010_01.robot | 2 +- .../Provision/EntityAttributes/010_02.robot | 8 +-- .../Provision/EntityAttributes/011_01.robot | 2 +- .../Provision/EntityAttributes/012_01.robot | 11 ++- .../Provision/EntityAttributes/012_03.robot | 4 +- .../Provision/EntityAttributes/013_01.robot | 2 +- .../building-location-attribute-sample.jsonld | 3 +- data/entities/building-minimal-sample.jsonld | 3 +- ...ing-relationship-of-property-sample.jsonld | 3 +- .../building-simple-attributes-sample.jsonld | 3 +- ...attributes-query-sample-expectation.jsonld | 8 +-- ...ample-expectation-query-geoproperty.jsonld | 2 +- ...building-minimal-sample-expectation.jsonld | 2 +- ...sample-expectation-query-attributes.jsonld | 2 +- ...butes-sample-expectation-simplified.jsonld | 2 +- ...imple-attributes-sample-expectation.jsonld | 2 +- .../vehicle-parking-sample-expectation.jsonld | 72 +++++++++---------- ...gment-attribute-name-missing-sample.jsonld | 4 +- ...fragment-different-datasetid-sample.jsonld | 3 +- ...cle-fragment-empty-datasetid-sample.jsonld | 21 +++--- ...cle-fragment-equal-datasetid-sample.jsonld | 8 +-- ...e-fragment-invalid-datasetid-sample.jsonld | 6 +- ...icle-fragment-same-datasetid-sample.jsonld | 6 +- ...-two-datasetid-attributes-sample-01.jsonld | 2 +- ...-two-datasetid-attributes-sample-02.jsonld | 2 +- ...-two-datasetid-attributes-sample-03.jsonld | 2 +- ...-two-datasetid-attributes-sample-04.jsonld | 2 +- .../parking-simple-attributes-sample.jsonld | 3 +- ...vehicle-datasetid-attributes-sample.jsonld | 5 +- .../vehicle-simple-attributes-sample.jsonld | 3 +- ...cle-two-datasetid-attributes-sample.jsonld | 2 +- resources/ApiUtils.resource | 5 +- resources/AssertionUtils.resource | 4 +- 55 files changed, 131 insertions(+), 159 deletions(-) rename TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/{002_03_.robot => 002_03.robot} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index 548f50ed..d7e6dd24 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Get Entity With Invalid/Missing Id *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -018_02_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +018_02_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +018_02_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Get Entity With Invalid/Missing Id diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 534477a0..024706b8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -10,7 +10,7 @@ ${filename}= building-simple-attributes-sample.jsonld ${attribute_not_known}= property_not_found *** Test Cases *** -Get an entity if an atris not known to the system +Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] mandatory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index f43a979b..d3f04514 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -29,7 +29,7 @@ Query several entities based on ids ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=@{entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index a4cbc5f3..956bbd04 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -32,7 +32,6 @@ Query several entities based on the entities types ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - #@{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index acde9947..1fc43211 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -9,9 +9,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld ${filename2}= building-minimal-sample.jsonld ${expectation_filename}= building-attributes-query-sample-expectation.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building -${attribute_airqualitylevel}= https://uri.fiware.org/ns/data-models#airQualityLevel -${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index e50cd66c..c196f7df 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld -${entity_type}= https://uri.fiware.org/ns/data-models#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 3472bedf..597ccab9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -25,11 +25,12 @@ Query several entities via POST Interaction based on ids ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index 228c4c84..a6d724e9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -32,11 +32,12 @@ Query several entities via POST Interaction based on the entities types ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${vehicle_entity_type} ${parking_entity_type} + @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index b911217d..3b0aeed3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -23,11 +23,12 @@ Query several entities via POST Interaction based on the given id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 7ffd18b7..aa46bdac 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -8,7 +8,6 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-sample-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory @@ -24,7 +23,7 @@ Query several entities via POST Interaction based on attribute names ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 36952866..da47aa14 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -23,11 +23,11 @@ Query several entities via POST Interaction based on a list of properties ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index 7b27ea33..89c08f79 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -23,7 +23,7 @@ Query entities based on incorrect ids ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${entity_invalid_id_one} ${entity_invalid_id_two} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index 79fb8608..22fc2947 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -25,7 +25,7 @@ Query entities based on incorrect entity types ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${invalid_entity_type_one} ${invalid_entity_type_two} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_entity_type_one} ${invalid_entity_type_two} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index 2ac89ffa..5a8359c5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -23,8 +23,7 @@ Query several entities based on incorrect attribute names ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{attributes_to_be_retrieved}= Create List ${invalid_attribute_one} ${invalid_attribute_two} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index 6ab42eb0..1f8048c5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can query entitites based on a list of properties +Documentation Check that you cannot query entitites if the request has a wrong geometryProperty Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -11,8 +11,8 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** -Query several entities based on a list of properties - [Documentation] Check that you can query entitites based on a list of properties +Query entitites when the request has a wrong geometryProperty + [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index c35101b9..5622a072 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -26,12 +26,12 @@ Query entities in a simplified representation ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} options=${options_parameter} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 69db1e52..08bef2dc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -26,11 +26,12 @@ Get an entity by id that can be returned in a geoJSON format ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index 72f7345d..fa326ffd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -26,7 +26,7 @@ Query entities specifying a maximum number of results ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${third_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 2dc442b9..16841d96 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -9,12 +9,11 @@ Test Template Create Entity Scenarios *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Cases *** FILENAME CONTENT_TYPE +*** Test Cases *** FILENAME CONTENT_TYPE 001_01_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json 001_01_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json 001_01_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -001_01_04_EntityWithNoContext building-minimal-without-context-sample.jsonld application/ld+json -001_01_05_EntityWithLocationAttribute building-location-attribute.jsonld application/ld+json +001_01_04_EntityWithLocationAttribute building-location-attribute-sample.jsonld application/ld+json *** Keywords *** Create Entity Scenarios diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index afcaa3c1..be92a3fe 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -5,7 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME +*** Test Cases *** FILENAME 001_02_01_InvalidJson invalid-json-sample.jsonld 001_02_02_EmptyJson empty-sample.jsonld 001_02_03_EntityWithNoContext building-minimal-without-context-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 758ed56a..8b83523b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -6,13 +6,10 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Delete Entity Scenarios -*** Variable *** -${entity_id_empty}= -${entity_id_not_valid}= thisisaninvaliduri -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_02_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -002_02_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +002_02_01_Delete an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_02_Delete an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03_.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03_.robot rename to TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index 3991a51a..721dc0af 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -10,7 +10,7 @@ Test Template Append Attributes ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME +*** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME 010_01_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld ${EMPTY} 010_01_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld 010_01_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 17a1ceac..db4e7325 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -12,10 +12,10 @@ ${status_code}= 400 ${invalid_fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld *** Test Cases *** -010_02_01_Append entity attributes if the entity Id is not present - Append Attributes ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI - Append Attributes thisisaninvaliduri +#010_02_01_Append entity attributes if the entity Id is not present +# Append Attributes ${EMPTY} +#010_02_02_Append entity attributes if the Entity Id is not a valid URI +# Append Attributes thisisaninvaliduri 010_02_03_Append entity attributes with invalid entity fragments Append entity attributes with invalid entity fragments diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index f7bc5eef..e2bad05c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -10,7 +10,7 @@ Test Template Update Attributes ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME 011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld ${EMPTY} 011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld ${EMPTY} 011_01_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 442c7273..3ca99501 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -9,16 +9,15 @@ Test Template Update Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-datasetid-attributes-sample.jsonld -${attribute_id}= speed ${status_code}= 204 -*** Test Cases *** FRAGMENT_FILENAME -012_01_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID +012_01_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld isParked +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld speed *** Keywords *** Update Attributes - [Arguments] ${fragment_filename} + [Arguments] ${fragment_filename} ${attribute_id} [Documentation] Check that you can perform a partial update on an entity attribute [Tags] mandatory @@ -26,7 +25,7 @@ Update Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_JSON} Check Response Status Code ${status_code} ${response['status']} #TODO: check body response is empty diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index 07858243..f3b4ab17 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -28,9 +28,9 @@ Partial Update Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 8b00f797..8361ea94 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -12,7 +12,7 @@ ${status_code}= 204 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${attribute_id}= speed -*** Test Cases *** DATASETID DELETEALL +*** Test Cases *** DATASETID DELETEALL 013_01_01_delete an attribute with the id ${EMPTY} false 013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false 013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index 72f7b220..cba71b77 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -17,7 +17,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld index 2af764ed..e49a2c9a 100644 --- a/data/entities/building-minimal-sample.jsonld +++ b/data/entities/building-minimal-sample.jsonld @@ -2,7 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 2cca72ea..2b21215c 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -24,7 +24,6 @@ "value": false }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index e4394e7c..821498e6 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -20,7 +20,6 @@ "value": false }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld index 332addc2..e3ffe113 100644 --- a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld +++ b/data/entities/expectations/building-attributes-query-sample-expectation.jsonld @@ -1,14 +1,14 @@ { - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://uri.fiware.org/ns/data-models#Building", - "https://uri.fiware.org/ns/data-models#airQualityLevel": { + "id": "urn:ngsi-ld:Building:4279250905792670", + "type": "https://ngsi-ld-test-suite/context#Building", + "https://ngsi-ld-test-suite/context#airQualityLevel": { "type": "Property", "value": 4, "observedAt": "2020-09-09T16:40:00.000Z", "unitCode": "C62" }, - "https://uri.fiware.org/ns/data-models#subCategory": { + "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": "tourism" }, diff --git a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld index 85a97476..dae72da2 100644 --- a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld +++ b/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld @@ -20,6 +20,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-sample-expectation.jsonld b/data/entities/expectations/building-minimal-sample-expectation.jsonld index d29ee00f..2fe6f024 100644 --- a/data/entities/expectations/building-minimal-sample-expectation.jsonld +++ b/data/entities/expectations/building-minimal-sample-expectation.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld index 93f2fb86..6f8083d0 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld @@ -12,6 +12,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld index 046ce109..014c2d53 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld @@ -6,6 +6,6 @@ "https://ngsi-ld-test-suite/context#almostFull": false, "https://ngsi-ld-test-suite/context#subCategory": "tourism", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld index 35862406..3a632ab1 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld @@ -20,6 +20,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld index 3eb294f5..51439a5b 100644 --- a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld +++ b/data/entities/expectations/vehicle-parking-sample-expectation.jsonld @@ -1,57 +1,57 @@ [ { - "id": "urn:ngsi-ld:OffStreetParking:1149507078845158", - "type": "https://uri.fiware.org/ns/data-models#OffStreetParking", - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -8.5, - 41.2 - ] - } - }, - "name": { + "id": "urn:ngsi-ld:Vehicle:8012188779712372", + "type": "https://ngsi-ld-test-suite/context#Vehicle", + "https://ngsi-ld-test-suite/context#brandName": { "type": "Property", - "value": "Downtown One" + "value": "Mercedes" }, - "https://uri.fiware.org/ns/data-models#availableSpotNumber": { - "type": "Property", + "isParked": { + "type": "Relationship", "providedBy": { "type": "Relationship", - "object": "urn:ngsi-ld:Camera:C1" + "object": "urn:ngsi-ld:Person:Bob" }, - "value": 121, - "observedAt": "2017-07-29T12:05:02Z", - "https://uri.fiware.org/ns/data-models#reliability": { - "type": "Property", - "value": 0.7 - } - }, - "https://uri.fiware.org/ns/data-models#totalSpotNumber": { - "type": "Property", - "value": 200 + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" ] }, { - "id": "urn:ngsi-ld:Vehicle:8601152883544931", - "type": "https://uri.fiware.org/ns/data-models#Vehicle", - "isParked": { - "type": "Relationship", + "id": "urn:ngsi-ld:OffStreetParking:8309214349077321", + "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "availableSpotNumber": { + "type": "Property", "providedBy": { "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "object": "urn:ngsi-ld:Camera:C1" }, - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z" + "reliability": { + "type": "Property", + "value": 0.7 + }, + "value": 121, + "observedAt": "2017-07-29T12:05:02Z" }, - "https://uri.fiware.org/ns/data-models#brandName": { + "totalSpotNumber": { "type": "Property", - "value": "Mercedes" + "value": 200 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.5, + 41.2 + ] + } + }, + "name": { + "type": "Property", + "value": "Downtown One" }, "@context": [ "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" diff --git a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld index 1e48b1af..e5f1135d 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld @@ -11,7 +11,5 @@ "brandName": { "type": "Property", "value": "BMW" - }, - "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + } } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld index f32c9912..42bb70af 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld @@ -13,7 +13,6 @@ "value": 23 }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld index af875bdd..54c0d1e1 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld @@ -1,14 +1,11 @@ { - "speed": { - "type": "Property", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" + "https://ngsi-ld-test-suite/context#isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" } - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file + } +} diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld index 6fdcfbda..259a93f9 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld @@ -1,13 +1,11 @@ { - "speed": { + "https://ngsi-ld-test-suite/context#speed": { "type": "Property", "value": 56, "source": { "type": "Property", "value": "Speedometer" }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, - "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "datasetId": "12345" + } } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld index efdff7ad..8368c5bd 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld @@ -7,9 +7,5 @@ "value": "Speedometer" }, "datasetId": "" - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] + } } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld index 62f3ac6c..c47ce407 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld @@ -11,9 +11,5 @@ "attribute_to_be_added": { "type": "Property", "value": 23 - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] + } } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld index 2b414e02..8c2d18b6 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld @@ -17,6 +17,6 @@ } }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld index 749042fd..0ae499d3 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld index d070c1b7..a1cfae90 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld index b16aa20e..6794ae23 100644 --- a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld +++ b/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld index 385f1929..982cfb89 100644 --- a/data/entities/parking-simple-attributes-sample.jsonld +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -30,7 +30,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-datasetid-attributes-sample.jsonld b/data/entities/vehicle-datasetid-attributes-sample.jsonld index c5298899..2cb1d9f1 100644 --- a/data/entities/vehicle-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-datasetid-attributes-sample.jsonld @@ -21,7 +21,7 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + "datasetId": "12345" }, { "type": "Property", @@ -33,7 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 556d5af4..0553c272 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -15,7 +15,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index ec44774f..729dd4ef 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 342cca12..74de3e93 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -98,7 +98,7 @@ Query Entities Via POST Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} query=${params} headers=${headers} + ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} Output request Output response [return] ${response} @@ -135,11 +135,10 @@ Append Entity Attributes Append Entity Attributes Using Session [Arguments] ${id} ${filename} ${content_type} ${options} - ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ params=options=${options} data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} [return] ${response} Update Entity Attributes Using Session diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 60545bf1..ba0f8ca2 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -101,10 +101,10 @@ Check Response Body Containing List Containing Entity Elements Check Response Body Containing List Containing Entity Elements With Different Types [Arguments] ${filename} ${entities_representation_ids} ${response_body} ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} - ${index}= Set Variable 1 + ${index}= Set Variable 0 FOR ${entity_representation_id} IN @{entities_representation_ids} ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} - ${index}= Evaluate ${index} - 1 + ${index}= Evaluate ${index} + 1 END Log ${response_body} Log ${entities_representation_payload} -- GitLab From 48d5019f68047862bcc67f2d650b2887756a3020 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 9 Mar 2021 14:54:07 +0000 Subject: [PATCH 124/442] renamed data files --- .../Consumption/Entity/018_01_01.robot | 2 +- .../Consumption/Entity/018_01_02.robot | 2 +- .../Consumption/Entity/018_01_03.robot | 2 +- .../Consumption/Entity/018_04.robot | 2 +- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 2 +- .../Consumption/Entity/019_01_02.robot | 2 +- .../Consumption/Entity/019_01_03.robot | 2 +- .../Consumption/Entity/019_01_04.robot | 2 +- .../Consumption/Entity/019_01_05.robot | 2 +- .../Consumption/Entity/019_02_01.robot | 2 +- .../Consumption/Entity/019_02_02.robot | 2 +- .../Consumption/Entity/019_02_03.robot | 2 +- .../Consumption/Entity/019_02_04.robot | 2 +- .../Consumption/Entity/019_02_05.robot | 2 +- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- .../Consumption/Entity/019_06.robot | 2 +- .../Provision/EntityAttributes/010_01.robot | 10 ++++----- .../Provision/EntityAttributes/010_02.robot | 6 ++--- .../Provision/EntityAttributes/010_03.robot | 2 +- .../Provision/EntityAttributes/011_01.robot | 8 +++---- .../Provision/EntityAttributes/011_02.robot | 6 ++--- .../Provision/EntityAttributes/011_03.robot | 2 +- .../Provision/EntityAttributes/012_01.robot | 6 ++--- .../Provision/EntityAttributes/012_02.robot | 12 +++++----- .../Provision/EntityAttributes/012_03.robot | 10 ++++----- .../Provision/TemporalEntity/014_01.robot | 2 +- .../Provision/TemporalEntity/014_02.robot | 2 +- .../Provision/TemporalEntity/014_03.robot | 2 +- .../Provision/TemporalEntity/016_01.robot | 2 +- .../Provision/TemporalEntity/016_02.robot | 2 +- .../Provision/TemporalEntity/016_03.robot | 2 +- .../033_01_01.robot | 2 +- .../033_01_02.robot | 2 +- .../033_01_03.robot | 2 +- .../033_02.robot | 6 ++--- .../033_03.robot | 2 +- .../033_06.robot | 2 +- .../033_07.robot | 2 +- .../033_09.robot | 2 +- .../035_01.robot | 2 +- .../035_02.robot | 2 +- .../035_03.robot | 2 +- .../034_01.robot | 4 ++-- .../034_02.robot | 12 +++++----- .../034_03.robot | 2 +- ...source-registration-invalid-sample.jsonld} | 2 +- ...gistration-invalid-structure-sample.jsonld | 7 ++++++ ...t-source-registration-no-id-sample.jsonld} | 2 +- ...egistration-past-expiration-sample.jsonld} | 2 +- ...-source-registration-simple-sample.jsonld} | 2 +- ...egistration-with-expiration-sample.jsonld} | 2 +- ...registration-different-type-sample.jsonld} | 2 +- ...gistration-invalid-structure-sample.jsonld | 7 ------ ...sonld => add-attribute-expectation.jsonld} | 0 ...lding-attributes-query-expectation.jsonld} | 2 +- ...ding-geoproperty-query-expectation.jsonld} | 0 ...cation-attribute-sample-expectation.jsonld | 22 ------------------- ...ld => building-minimal-expectation.jsonld} | 0 ...ding-simple-attributes-expectation.jsonld} | 0 ...imple-attributes-query-expectation.jsonld} | 0 ...-attributes-simplified-expectation.jsonld} | 0 ...hicle-offstreetparking-expectation.jsonld} | 0 ...ehicle-speed-datasetid-expectation.jsonld} | 0 ...id-attributes-sample-expectation-04.jsonld | 0 ...-sample.jsonld => invalid-fragment.jsonld} | 3 +-- ... vehicle-attribute-to-add-fragment.jsonld} | 0 ...e.jsonld => vehicle-empty-fragment.jsonld} | 0 ...sonld => vehicle-isparked-fragment.jsonld} | 0 ...speed-different-datasetid-fragment.jsonld} | 0 ...-datasetid-different-type-fragment.jsonld} | 0 ...cle-speed-equal-datasetid-fragment.jsonld} | 0 ...e-speed-invalid-datasetid-fragment.jsonld} | 0 ...le-speed-two-datasetid-01-fragment.jsonld} | 0 ...le-speed-two-datasetid-02-fragment.jsonld} | 0 ...le-speed-two-datasetid-03-fragment.jsonld} | 0 ...le-speed-two-datasetid-04-fragment.jsonld} | 0 ... vehicle-speed-wrong-name-fragment.jsonld} | 0 ...vehicle-speed-two-datasetid-sample.jsonld} | 0 ...oral-representation-fragment-sample.jsonld | 14 ------------ ...temporal-intanceid-update-fragment.jsonld} | 0 ...e-temporal-representation-fragment.jsonld} | 0 ...ion-without-context-fragment-sample.jsonld | 19 ---------------- 84 files changed, 92 insertions(+), 148 deletions(-) rename data/csourceRegistrations/{registration-invalid-sample.jsonld => context-source-registration-invalid-sample.jsonld} (85%) create mode 100644 data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld rename data/csourceRegistrations/{registration-no-id-sample.jsonld => context-source-registration-no-id-sample.jsonld} (84%) rename data/csourceRegistrations/{registration-past-expiration-sample.jsonld => context-source-registration-past-expiration-sample.jsonld} (85%) rename data/csourceRegistrations/{registration-sample.jsonld => context-source-registration-simple-sample.jsonld} (85%) rename data/csourceRegistrations/{registration-with-expiration-sample.jsonld => context-source-registration-with-expiration-sample.jsonld} (85%) rename data/csourceRegistrations/{registration-different-type-sample.jsonld => fragments/context-source-registration-different-type-sample.jsonld} (84%) delete mode 100644 data/csourceRegistrations/registration-invalid-structure-sample.jsonld rename data/entities/expectations/{vehicle-attributes-sample-append-expectation-02.jsonld => add-attribute-expectation.jsonld} (100%) rename data/entities/expectations/{building-attributes-query-sample-expectation.jsonld => building-attributes-query-expectation.jsonld} (89%) rename data/entities/expectations/{building-location-attribute-sample-expectation-query-geoproperty.jsonld => building-geoproperty-query-expectation.jsonld} (100%) delete mode 100644 data/entities/expectations/building-location-attribute-sample-expectation.jsonld rename data/entities/expectations/{building-minimal-sample-expectation.jsonld => building-minimal-expectation.jsonld} (100%) rename data/entities/expectations/{building-simple-attributes-sample-expectation.jsonld => building-simple-attributes-expectation.jsonld} (100%) rename data/entities/expectations/{building-simple-attributes-sample-expectation-query-attributes.jsonld => building-simple-attributes-query-expectation.jsonld} (100%) rename data/entities/expectations/{building-simple-attributes-sample-expectation-simplified.jsonld => building-simple-attributes-simplified-expectation.jsonld} (100%) rename data/entities/expectations/{vehicle-parking-sample-expectation.jsonld => two-types-vehicle-offstreetparking-expectation.jsonld} (100%) rename data/entities/expectations/{vehicle-two-datasetid-attributes-sample-expectation-03.jsonld => vehicle-speed-datasetid-expectation.jsonld} (100%) delete mode 100644 data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld rename data/entities/fragmentEntities/{invalid-vehicle-fragment-datasetid-sample.jsonld => invalid-fragment.jsonld} (77%) rename data/entities/fragmentEntities/{vehicle-fragment-same-datasetid-sample.jsonld => vehicle-attribute-to-add-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-all-empty-sample.jsonld => vehicle-empty-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-empty-datasetid-sample.jsonld => vehicle-isparked-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-different-datasetid-sample.jsonld => vehicle-speed-different-datasetid-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-equal-datasetid-different-type-sample.jsonld => vehicle-speed-equal-datasetid-different-type-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-equal-datasetid-sample.jsonld => vehicle-speed-equal-datasetid-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-invalid-datasetid-sample.jsonld => vehicle-speed-invalid-datasetid-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-two-datasetid-attributes-sample-01.jsonld => vehicle-speed-two-datasetid-01-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-two-datasetid-attributes-sample-02.jsonld => vehicle-speed-two-datasetid-02-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-two-datasetid-attributes-sample-03.jsonld => vehicle-speed-two-datasetid-03-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-two-datasetid-attributes-sample-04.jsonld => vehicle-speed-two-datasetid-04-fragment.jsonld} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-attribute-name-missing-sample.jsonld => vehicle-speed-wrong-name-fragment.jsonld} (100%) rename data/entities/{vehicle-datasetid-attributes-sample.jsonld => vehicle-speed-two-datasetid-sample.jsonld} (100%) delete mode 100644 data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld rename data/temporalEntities/fragments/{vehicle-temporal-intanceid-update-sample.jsonld => vehicle-temporal-intanceid-update-fragment.jsonld} (100%) rename data/temporalEntities/fragments/{vehicle-temporal-representation-fragment-sample.jsonld => vehicle-temporal-representation-fragment.jsonld} (100%) delete mode 100644 data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot index 381f3b60..24656459 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation.jsonld +${expectation_filename}= building-simple-attributes-expectation.jsonld *** Test Cases *** 018_01_01_Get an entity by id diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 4fe17c79..0c6c80fd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation-query-attributes.jsonld +${expectation_filename}= building-simple-attributes-query-expectation.jsonld ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot index 8ccd23fa..d3f20c15 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld +${expectation_filename}= building-geoproperty-query-expectation.jsonld ${geometry_property}= location *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index 366e2126..d8e6cbdd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld ${options_parameter}= keyValues *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index d7e60109..27f28091 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld ${options_parameter}= keyValues ${accept_header}= application/geo+json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index d3f04514..920357a9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index 956bbd04..8d734a8e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -11,7 +11,7 @@ ${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld -${expectation_filename}= vehicle-parking-sample-expectation.jsonld +${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index ac17db40..42ab2226 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index 1fc43211..6c03ee7e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld ${filename2}= building-minimal-sample.jsonld -${expectation_filename}= building-attributes-query-sample-expectation.jsonld +${expectation_filename}= building-attributes-query-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index c196f7df..9b6bfb83 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-location-attribute-sample-expectation-query-geoproperty.jsonld +${expectation_filename}= building-geoproperty-query-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 597ccab9..eb6b1258 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index a6d724e9..69e3adab 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -11,7 +11,7 @@ ${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld -${expectation_filename}= vehicle-parking-sample-expectation.jsonld +${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 3b0aeed3..5f8b2de2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index aa46bdac..024e289b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index da47aa14..9abc975d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 5622a072..1b4d8caf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld ${options_parameter}= keyValues ${entity_type}= https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 08bef2dc..be2e37ad 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-sample-expectation-simplified.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${accept_header}= application/geo+json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index fa326ffd..9f6639ef 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-sample-expectation.jsonld +${expectation_filename}= building-minimal-expectation.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building ${limit}= 2 diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index 721dc0af..e0f9e842 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -8,13 +8,13 @@ Test Template Append Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld +${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME -010_01_01_Append entity attributes 204 ${EMPTY} vehicle-fragment-same-datasetid-sample.jsonld ${EMPTY} -010_01_02_Append entity attributes 207 noOverwrite vehicle-fragment-same-datasetid-sample.jsonld vehicle-attributes-sample-append-expectation-02.jsonld -010_01_03_Append entity attributes 204 ${EMPTY} vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} -010_01_04_Append entity attributes 204 noOverwrite vehicle-fragment-different-datasetid-sample.jsonld ${EMPTY} +010_01_01_Append entity attributes 204 ${EMPTY} vehicle-attribute-to-add-fragment.jsonld ${EMPTY} +010_01_02_Append entity attributes 207 noOverwrite vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld +010_01_03_Append entity attributes 204 ${EMPTY} vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} +010_01_04_Append entity attributes 204 noOverwrite vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} *** Keywords *** Append Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index db4e7325..acd9ea6e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -6,10 +6,10 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld ${status_code}= 400 -${invalid_fragment_filename}= invalid-vehicle-fragment-datasetid-sample.jsonld +${invalid_fragment_filename}= invalid-fragment.jsonld *** Test Cases *** #010_02_01_Append entity attributes if the entity Id is not present diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index e84799b5..3459d6d0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-fragment-same-datasetid-sample.jsonld +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index e2bad05c..cc7f73d4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -11,10 +11,10 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-two-datasetid-attributes-sample-01.jsonld ${EMPTY} -011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-two-datasetid-attributes-sample-02.jsonld ${EMPTY} -011_01_03_Check that you can update only some attributes while others failed 207 vehicle-two-datasetid-attributes-sample-03.jsonld vehicle-two-datasetid-attributes-sample-expectation-03.jsonld -011_01_04_Check that you cannot change the type of the attribute 204 vehicle-two-datasetid-attributes-sample-04.jsonld ${EMPTY} +011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} +011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} +011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld +011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index 2bcc4482..bbe3cec0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -9,11 +9,11 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: *** Test Cases *** 011_02_01_Update an attribute if the Entity Id is not present - Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld + Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_02_Update an attribute if the Entity Id is not a valid URI - Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-two-datasetid-attributes-sample-01.jsonld + Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_03_Update entity attributes with invalid entity fragments - Update entity attributes with invalid entity fragments vehicle-datasetid-attributes-sample.jsonld invalid-vehicle-fragment-datasetid-sample.jsonld + Update entity attributes with invalid entity fragments vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot index e8816488..f309554e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld +${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 3ca99501..76718a5b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -8,12 +8,12 @@ Test Template Update Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld +${filename}= vehicle-speed-two-datasetid-sample.jsonld ${status_code}= 204 *** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID -012_01_01_Check that you can partially update an attribute vehicle-fragment-empty-datasetid-sample.jsonld isParked -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-fragment-equal-datasetid-sample.jsonld speed +012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index 9204ca02..8444f5f2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -13,12 +13,12 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${status_code}= 400 *** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-fragment-equal-datasetid-sample.jsonld -012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-fragment-equal-datasetid-sample.jsonld -012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-fragment-attribute-name-missing-sample.jsonld -012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-fragment-equal-datasetid-sample.jsonld -012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-fragment-equal-datasetid-different-type-sample.jsonld -012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed vehicle-fragment-all-empty-sample.jsonld +012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld +012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld +012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index f3b4ab17..b7ec1196 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -9,15 +9,15 @@ Test Template Partial Update Attributes *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-datasetid-attributes-sample.jsonld +${filename}= vehicle-speed-two-datasetid-sample.jsonld ${status_code}= 404 ${attribute_id}= speed *** Test Cases *** ENTITY_ID FRAGMENT_FILENAME -012_03_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-fragment-same-datasetid-sample.jsonld -012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-fragment-invalid-datasetid-sample.jsonld -012_03_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-fragment-empty-datasetid-sample.jsonld -012_03_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-fragment-attribute-name-missing-sample.jsonld +012_03_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld +012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld.jsonld +012_03_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-isparked-fragment.jsonld +012_03_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld *** Keywords *** Partial Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot index e30995ff..254950a7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld *** Test Cases *** 014_01_02_Add an attribute to a temporal entity with simple temporal properties diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot index 7eb7acc9..33327658 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${status_code}= 400 *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot index 1ca7648a..1b99ecae 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${status_code}= 404 *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot index a27641f8..53df2e11 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld ${attributeId}= speed *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot index 99d5d0f7..d53614c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot @@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld ${status_code}= 400 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot index 60debbb9..8037375f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot @@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-sample.jsonld +${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld ${status_code}= 404 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 48beab75..43ef87ed 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/registration-with-expiration-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld *** Test Case *** Create Context Source Registration With Specific Date Expiration Date diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index a45c6ec9..55dabb2e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/registration-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create Context Source Registration That Never Expires diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 32d8e4f0..aa59c63b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/registration-no-id-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld *** Test Case *** Create Context Source Registration Without A Sprecified ID diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 29742cca..b906d86b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -6,15 +6,15 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-invalid-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Cases *** 033_02_01_Create a context source registration with invalid JSON file Create a context source registration with invalid JSON file 033_02_02_Create a context source registration with a different data structure than CsourRegistration data type - Create Context Source With Invalid Content csourceRegistrations/registration-invalid-structure-sample.jsonld + Create Context Source With Invalid Content csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld 033_02_03_Create a context source registration with a date in the past - Create Context Source With Invalid Content csourceRegistrations/registration-past-expiration-sample.jsonld + Create Context Source With Invalid Content csourceRegistrations/context-source-registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 4274214e..69783222 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= csourceRegistrations/registration-sample.jsonld +${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Cases *** Create a context source registration that already exists diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index c79245ee..fcdaa412 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration containing a JSON-LD @context with a JSON content type diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index 17057c04..e47a4400 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration using a JSON-LD @context obtained from the request payload diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index 1c6c0058..a7e8f6b3 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration with a Link header and a JSON-LD content type diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 59485637..aa79d926 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-sample.jsonld +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld *** Test Case *** Delete a context source registration by id diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 479a314a..f70d18b1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -8,7 +8,7 @@ Test Template Delete Context Source *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld +${filename}= context-source-registration-simple-sample.jsonld *** Test Case *** INVALID_REGISTRATION_ID 035_02_01_Delete a Context Source Registration if the Id is not present ${EMPTY} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index b9406805..b40e6f94 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-sample.jsonld +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld *** Test Case *** Delete a context source registration by id diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 26c54f63..3488c445 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -10,8 +10,8 @@ Test Template Update Context Source ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Case *** FILENAME UPDATE_FILENAME -034_01_01_Update a context source registration by id registration-sample.jsonld registration-with-expiration-sample.jsonld -034_01_02_Update a context source registration to never expire registration-with-expiration-sample.jsonld registration-sample.jsonld +034_01_01_Update a context source registration by id context-source-registration-simple-sample.jsonld context-source-registration-with-expiration-sample.jsonld +034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld *** Keywords *** Update Context Source diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 08e3a176..5157844f 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -8,18 +8,18 @@ Suite Setup Setup Initial Entities *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld -${registration_payload_file_path}= registration-invalid-sample.jsonld +${filename}= context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Case *** 034_02_01_Update a context source registration by id if the Id is not present - Update Context Source ${EMPTY} registration-with-expiration-sample.jsonld + Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld 034_02_02_Update a context source registration by id if the Id is not a valid URI - Update Context Source invalidURI registration-with-expiration-sample.jsonld + Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld 034_02_03_Update a context source registration if the request body is not of the same data type - Update Context Source ${valid_registration_id} registration-different-type-sample.jsonld + Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld 034_02_04_Update a context source registration if you attempt to remove a mandatory property - Update Context Source ${valid_registration_id} registration-invalid-structure-sample.jsonld + Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld 034_02_05_Update a context source registration if the request body is invalid Update a context source registration if the request body is invalid diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 9bdb1b5c..fffb4366 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= registration-sample.jsonld +${filename}= context-source-registration-simple-sample.jsonld *** Test Case *** Update a context source registration by id if the id is not known to the system diff --git a/data/csourceRegistrations/registration-invalid-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld similarity index 85% rename from data/csourceRegistrations/registration-invalid-sample.jsonld rename to data/csourceRegistrations/context-source-registration-invalid-sample.jsonld index b0ffbb3e..1c01a4b4 100644 --- a/data/csourceRegistrations/registration-invalid-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld new file mode 100644 index 00000000..28176c46 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/registration-no-id-sample.jsonld b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld similarity index 84% rename from data/csourceRegistrations/registration-no-id-sample.jsonld rename to data/csourceRegistrations/context-source-registration-no-id-sample.jsonld index f2abff25..04ed167a 100644 --- a/data/csourceRegistrations/registration-no-id-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld @@ -37,6 +37,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/registration-past-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld similarity index 85% rename from data/csourceRegistrations/registration-past-expiration-sample.jsonld rename to data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld index f9f76264..4f449784 100644 --- a/data/csourceRegistrations/registration-past-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": " 2018-11-29T14:53:15Z", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld similarity index 85% rename from data/csourceRegistrations/registration-sample.jsonld rename to data/csourceRegistrations/context-source-registration-simple-sample.jsonld index 956aeda4..096c701b 100644 --- a/data/csourceRegistrations/registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/registration-with-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld similarity index 85% rename from data/csourceRegistrations/registration-with-expiration-sample.jsonld rename to data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld index bb9ae210..6e0a40b5 100644 --- a/data/csourceRegistrations/registration-with-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": " 2025-11-29T14:53:15Z", "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/registration-different-type-sample.jsonld b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld similarity index 84% rename from data/csourceRegistrations/registration-different-type-sample.jsonld rename to data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld index 80945e1f..d15dfb55 100644 --- a/data/csourceRegistrations/registration-different-type-sample.jsonld +++ b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/registration-invalid-structure-sample.jsonld b/data/csourceRegistrations/registration-invalid-structure-sample.jsonld deleted file mode 100644 index cc6bf6c3..00000000 --- a/data/csourceRegistrations/registration-invalid-structure-sample.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type": "ContextSourceRegistration", - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld b/data/entities/expectations/add-attribute-expectation.jsonld similarity index 100% rename from data/entities/expectations/vehicle-attributes-sample-append-expectation-02.jsonld rename to data/entities/expectations/add-attribute-expectation.jsonld diff --git a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld b/data/entities/expectations/building-attributes-query-expectation.jsonld similarity index 89% rename from data/entities/expectations/building-attributes-query-sample-expectation.jsonld rename to data/entities/expectations/building-attributes-query-expectation.jsonld index e3ffe113..77216ca0 100644 --- a/data/entities/expectations/building-attributes-query-sample-expectation.jsonld +++ b/data/entities/expectations/building-attributes-query-expectation.jsonld @@ -1,6 +1,6 @@ { - "id": "urn:ngsi-ld:Building:4279250905792670", + "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", "https://ngsi-ld-test-suite/context#airQualityLevel": { "type": "Property", diff --git a/data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld b/data/entities/expectations/building-geoproperty-query-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-location-attribute-sample-expectation-query-geoproperty.jsonld rename to data/entities/expectations/building-geoproperty-query-expectation.jsonld diff --git a/data/entities/expectations/building-location-attribute-sample-expectation.jsonld b/data/entities/expectations/building-location-attribute-sample-expectation.jsonld deleted file mode 100644 index b4f0f8b2..00000000 --- a/data/entities/expectations/building-location-attribute-sample-expectation.jsonld +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "https://ngsi-ld-test-suite/context#subCategory": { - "type": "Property", - "value": ["tourism"] - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [13.3986, 52.5547] - } - }, - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-sample-expectation.jsonld b/data/entities/expectations/building-minimal-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-minimal-sample-expectation.jsonld rename to data/entities/expectations/building-minimal-expectation.jsonld diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.jsonld b/data/entities/expectations/building-simple-attributes-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-simple-attributes-sample-expectation.jsonld rename to data/entities/expectations/building-simple-attributes-expectation.jsonld diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld b/data/entities/expectations/building-simple-attributes-query-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-simple-attributes-sample-expectation-query-attributes.jsonld rename to data/entities/expectations/building-simple-attributes-query-expectation.jsonld diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld b/data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld similarity index 100% rename from data/entities/expectations/building-simple-attributes-sample-expectation-simplified.jsonld rename to data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.jsonld b/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld similarity index 100% rename from data/entities/expectations/vehicle-parking-sample-expectation.jsonld rename to data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld b/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld similarity index 100% rename from data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-03.jsonld rename to data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld diff --git a/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld b/data/entities/expectations/vehicle-two-datasetid-attributes-sample-expectation-04.jsonld deleted file mode 100644 index e69de29b..00000000 diff --git a/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld b/data/entities/fragmentEntities/invalid-fragment.jsonld similarity index 77% rename from data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld rename to data/entities/fragmentEntities/invalid-fragment.jsonld index 00a0cd6b..7fc26d82 100644 --- a/data/entities/fragmentEntities/invalid-vehicle-fragment-datasetid-sample.jsonld +++ b/data/entities/fragmentEntities/invalid-fragment.jsonld @@ -13,7 +13,6 @@ "value": "BMW" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-same-datasetid-sample.jsonld rename to data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld b/data/entities/fragmentEntities/vehicle-empty-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-all-empty-sample.jsonld rename to data/entities/fragmentEntities/vehicle-empty-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-empty-datasetid-sample.jsonld rename to data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-different-datasetid-sample.jsonld rename to data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-different-type-sample.jsonld rename to data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-equal-datasetid-sample.jsonld rename to data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-invalid-datasetid-sample.jsonld rename to data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-01.jsonld rename to data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-02.jsonld rename to data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-03.jsonld rename to data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-two-datasetid-attributes-sample-04.jsonld rename to data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld diff --git a/data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-attribute-name-missing-sample.jsonld rename to data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld diff --git a/data/entities/vehicle-datasetid-attributes-sample.jsonld b/data/entities/vehicle-speed-two-datasetid-sample.jsonld similarity index 100% rename from data/entities/vehicle-datasetid-attributes-sample.jsonld rename to data/entities/vehicle-speed-two-datasetid-sample.jsonld diff --git a/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld deleted file mode 100644 index 28242dc7..00000000 --- a/data/temporalEntities/fragments/vehicle-simplified-temporal-representation-fragment-sample.jsonld +++ /dev/null @@ -1,14 +0,0 @@ -{ - "added_attribute": { - "type": "Property", - "values": [ - [121,"2018-08-01T12:03:00Z"], - [80,"2018-08-01T12:05:00Z"], - [100,"2018-08-01T12:07:00Z"] - ] - }, - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] -} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld similarity index 100% rename from data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld rename to data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld similarity index 100% rename from data/temporalEntities/fragments/vehicle-temporal-representation-fragment-sample.jsonld rename to data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld deleted file mode 100644 index 922b0d31..00000000 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-without-context-fragment-sample.jsonld +++ /dev/null @@ -1,19 +0,0 @@ -{ - "added_attribute":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ] -} \ No newline at end of file -- GitLab From 8ad270c6effdc945d90ffb24d89653db88c30c12 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 9 Mar 2021 19:17:43 +0000 Subject: [PATCH 125/442] added tags --- .../Consumption/Entity/018_01_01.robot | 2 +- .../Consumption/Entity/018_01_02.robot | 2 +- .../Consumption/Entity/018_01_03.robot | 2 +- .../Consumption/Entity/018_02.robot | 2 +- .../Consumption/Entity/018_03_01.robot | 2 +- .../Consumption/Entity/018_03_02.robot | 2 +- .../Consumption/Entity/018_04.robot | 2 +- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 2 +- .../Consumption/Entity/019_01_02.robot | 2 +- .../Consumption/Entity/019_01_03.robot | 2 +- .../Consumption/Entity/019_01_04.robot | 2 +- .../Consumption/Entity/019_01_05.robot | 2 +- .../Consumption/Entity/019_02_01.robot | 2 +- .../Consumption/Entity/019_02_02.robot | 2 +- .../Consumption/Entity/019_02_03.robot | 2 +- .../Consumption/Entity/019_02_04.robot | 2 +- .../Consumption/Entity/019_02_05.robot | 2 +- .../Consumption/Entity/019_03_01.robot | 2 +- .../Consumption/Entity/019_03_02.robot | 2 +- .../Consumption/Entity/019_03_03.robot | 2 +- .../Consumption/Entity/019_03_04.robot | 2 +- .../Consumption/Entity/019_03_05.robot | 2 +- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- .../Consumption/Entity/019_06.robot | 2 +- .../Entities/CreateEntity/001_01.robot | 2 +- .../Entities/CreateEntity/001_02.robot | 2 +- .../Entities/CreateEntity/001_03.robot | 2 +- .../Entities/DeleteEntity/002_01.robot | 2 +- .../Entities/DeleteEntity/002_02.robot | 2 +- .../Entities/DeleteEntity/002_03.robot | 2 +- .../Provision/EntityAttributes/010_01.robot | 2 +- .../Provision/EntityAttributes/010_02.robot | 6 ++--- .../Provision/EntityAttributes/010_03.robot | 2 +- .../Provision/EntityAttributes/011_01.robot | 2 +- .../Provision/EntityAttributes/011_02.robot | 10 ++++----- .../Provision/EntityAttributes/011_03.robot | 2 +- .../Provision/EntityAttributes/012_01.robot | 2 +- .../Provision/EntityAttributes/012_02.robot | 2 +- .../Provision/EntityAttributes/012_03.robot | 2 +- .../Provision/EntityAttributes/013_01.robot | 2 +- .../Provision/EntityAttributes/013_02.robot | 2 +- .../Provision/EntityAttributes/013_03.robot | 2 +- .../033_01_01.robot | 2 +- .../033_01_02.robot | 2 +- .../033_01_03.robot | 2 +- .../033_02.robot | 2 +- .../033_03.robot | 2 +- .../035_01.robot | 2 +- .../035_02.robot | 2 +- .../035_03.robot | 2 +- .../034_01.robot | 2 +- .../034_02.robot | 22 +++++++++---------- .../034_03.robot | 2 +- 55 files changed, 71 insertions(+), 71 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot index 24656459..c7928e44 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot @@ -12,7 +12,7 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Test Cases *** 018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id - [Tags] mandatory + [Tags] /entities/{entityId} 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 0c6c80fd..65fdb175 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity - [Tags] mandatory + [Tags] /entities/{entityId} 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot index d3f20c15..f63cfea5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot @@ -13,7 +13,7 @@ ${geometry_property}= location *** Test Cases *** 018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity - [Tags] mandatory + [Tags] /entities/{entityId} 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index d7e6dd24..5f75ed80 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] mandatory + [Tags] /entities/{entityId} 5_7_1 ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 5bad223c..7d82ec3a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] mandatory + [Tags] /entities/{entityId} 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 024706b8..7e3493cd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] mandatory + [Tags] /entities/{entityId} 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index d8e6cbdd..5ebaa221 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] mandatory + [Tags] /entities/{entityId} 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index 27f28091..4c2392da 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] mandatory + [Tags] /entities/{entityId} 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index 920357a9..b6548ba6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index 8d734a8e..52cfd88a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index 42ab2226..03ab724d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index 6c03ee7e..d6f11619 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -16,7 +16,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index 9b6bfb83..181cdc5d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index eb6b1258..29c5db5e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index 69e3adab..08329128 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 5f8b2de2..c7a55e78 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 024e289b..3505711d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 9abc975d..4bc6a2a0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index 89c08f79..2914b47e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot index 22fc2947..11f6c57f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 6ba1a5e2..96f6886e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot index 5a8359c5..5d0d706a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot @@ -14,7 +14,7 @@ ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index 1f8048c5..be18dd4c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -13,7 +13,7 @@ ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty - [Tags] mandatory + [Tags] /entities/ 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 1b4d8caf..27d45e27 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] mandatory + [Tags] /entities/ 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index be2e37ad..0a32c62e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] mandatory + [Tags] /entities/ 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index 9f6639ef..d23a8401 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] mandatory + [Tags] /entities/ 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 16841d96..7f4ed1cc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Create Entity Scenarios [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity - [Tags] mandatory + [Tags] /entities/ 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index be92a3fe..77fa8ad8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -14,7 +14,7 @@ Test Template Create Entity With Invalid Request Scenarios Create Entity With Invalid Request Scenarios [Arguments] ${filename} [Documentation] Check that you cannot create an entity with an invalid request - [Tags] mandatory + [Tags] /entities/ 5_6_1 Request Entity From File ${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index 7b18be4f..9a8fdc7a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -12,7 +12,7 @@ ${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id - [Tags] mandatory + [Tags] /entities/ 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index a476e0f0..8254de9f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity [Documentation] Check that you can delete an entity by id - [Tags] mandatory + [Tags] /entities/{entityId} 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 8b83523b..01389e53 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -17,7 +17,7 @@ Test Template Delete Entity Scenarios Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id - [Tags] mandatory + [Tags] /entities/{entityId} 5_6_6 ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index 1c29651d..3e24e854 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -11,7 +11,7 @@ ${expected_status_code}= 404 *** Test Case *** Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system - [Tags] mandatory + [Tags] /entities/{entityId} 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index e0f9e842..759b23ab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -20,7 +20,7 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld Append Attributes [Arguments] ${status_code} ${overwrite} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index acd9ea6e..3564e43f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -23,7 +23,7 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -44,8 +44,8 @@ Append entity attributes with invalid entity fragments ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code ${response} + Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check Response Status Code 400 ${response['status']} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 3459d6d0..eee1bf46 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index cc7f73d4..b2408731 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -20,7 +20,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot index bbe3cec0..ccfb6c0d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot @@ -19,7 +19,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Update Attributes [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -35,15 +35,15 @@ Update Attributes Update entity attributes with invalid entity fragments [Arguments] ${filename} ${fragment_filename} [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} Output ${fragment_filename} ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - #Check Response Status Code ${response} - #Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} - #Check Response Body Title When Using Session Request ${response.json()} + Check Response Status Code 400 ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot index f309554e..84b9017a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/ 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index 76718a5b..ea7b4ae7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -19,7 +19,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} ${attribute_id} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index 8444f5f2..9dd3a92c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index b7ec1196..8e872530 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 8361ea94..d9e1bacd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} [Documentation] Check that you can delete an attribute from an entity - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot index 5ee5aaa5..e936abc9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot index 889e2450..565357f3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] mandatory + [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 43ef87ed..897e492e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date - [Tags] mandatory + [Tags] /csourceRegistrations/ 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 55dabb2e..1d384107 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires - [Tags] mandatory + [Tags] /csourceRegistrations/ 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index aa59c63b..97fe3165 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration Without A Sprecified ID [Documentation] Check that when creating a context source registration without specifying an ID - [Tags] mandatory + [Tags] /csourceRegistrations/ 5_9_2 ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${request} ${response}= Create Context Source Registration With Return ${payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index b906d86b..8be35651 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -20,7 +20,7 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample. Create Context Source With Invalid Content [Arguments] ${filename} [Documentation] Check that you cannot create a context source with invalid content - [Tags] mandatory + [Tags] /csourceRegistrations/ 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 69783222..823ba804 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -12,7 +12,7 @@ ${filename}= csourceRegistrations/context-source-registration-simple-sample.jso *** Test Cases *** Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists - [Tags] mandatory + [Tags] /csourceRegistrations/ 5_9_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index aa79d926..a5febdfa 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j *** Test Case *** Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index f70d18b1..610c8100 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -18,7 +18,7 @@ ${filename}= context-source-registration-simple-sample.jsonld Delete Context Source [Arguments] ${invalid_registration_id} [Documentation] Check that you cannot delete a context source registration under some conditions - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index b40e6f94..1f44f028 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j *** Test Case *** Delete a context source registration by id [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 3488c445..23cd6558 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -17,7 +17,7 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: Update Context Source [Arguments] ${filename} ${update_filename} [Documentation] Check that you can update a context source registration by id - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 5157844f..3b4f3c29 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -12,14 +12,14 @@ ${filename}= context-source-registration-simple-sample.jsonld ${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Case *** -034_02_01_Update a context source registration by id if the Id is not present - Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld -034_02_02_Update a context source registration by id if the Id is not a valid URI - Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld -034_02_03_Update a context source registration if the request body is not of the same data type - Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld -034_02_04_Update a context source registration if you attempt to remove a mandatory property - Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld +#034_02_01_Update a context source registration by id if the Id is not present +# Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld +#034_02_02_Update a context source registration by id if the Id is not a valid URI +# Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld +#034_02_03_Update a context source registration if the request body is not of the same data type +# Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld +#034_02_04_Update a context source registration if you attempt to remove a mandatory property +# Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld 034_02_05_Update a context source registration if the request body is invalid Update a context source registration if the request body is invalid @@ -27,7 +27,7 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample.j Update Context Source [Arguments] ${registration_id} ${fragment_filename} [Documentation] Check that you cannot update a context source registration under some conditions - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} @@ -43,7 +43,7 @@ Update Context Source Update a context source registration if the request body is invalid [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} @@ -51,7 +51,7 @@ Update a context source registration if the request body is invalid Check Response Status Code 201 ${response['status']} ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} + Check Response Status Code 400 ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index fffb4366..d05e504a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -11,7 +11,7 @@ ${filename}= context-source-registration-simple-sample.jsonld *** Test Case *** Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system - [Tags] mandatory + [Tags] /csourceRegistrations/{registrationId} 5_9_3 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} -- GitLab From a8dfc3f5f23a386b14f1edba8391180ffd31f7f5 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 10 Mar 2021 09:42:50 +0000 Subject: [PATCH 126/442] added missing tags --- .../ContextInformation/Consumption/Entity/019_02_01.robot | 2 +- .../ContextInformation/Consumption/Entity/019_02_02.robot | 2 +- .../ContextInformation/Consumption/Entity/019_02_03.robot | 2 +- .../ContextInformation/Consumption/Entity/019_02_04.robot | 2 +- .../ContextInformation/Consumption/Entity/019_02_05.robot | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 29c5db5e..0402dd96 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] /entities/ 5_7_2 + [Tags] /entityOperations/query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index 08329128..c66e1123 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] /entities/ 5_7_2 + [Tags] /entityOperations/query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index c7a55e78..9b5e746c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] /entities/ 5_7_2 + [Tags] /entityOperations/query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot index 3505711d..6a42c907 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] /entities/ 5_7_2 + [Tags] /entityOperations/query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot index 4bc6a2a0..46780edc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] /entities/ 5_7_2 + [Tags] /entityOperations/query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} -- GitLab From b5a0e32c865267807646afcaaff96c33eda3280d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 11 Mar 2021 09:58:42 +0100 Subject: [PATCH 127/442] fix: pass id and type parameters as a comma-separated list (and not as a list) when querying entities --- .../ContextInformation/Consumption/Entity/018_01_02.robot | 2 +- .../ContextInformation/Consumption/Entity/018_03_02.robot | 2 +- .../ContextInformation/Consumption/Entity/019_01_01.robot | 4 ++-- .../ContextInformation/Consumption/Entity/019_01_03.robot | 2 +- .../ContextInformation/Consumption/Entity/019_01_04.robot | 2 +- .../ContextInformation/Consumption/Entity/019_01_05.robot | 7 ++++--- .../ContextInformation/Consumption/Entity/019_02_01.robot | 2 +- .../ContextInformation/Consumption/Entity/019_02_02.robot | 2 +- .../ContextInformation/Consumption/Entity/019_03_01.robot | 2 +- .../ContextInformation/Consumption/Entity/019_03_03.robot | 2 +- .../ContextInformation/Consumption/Entity/019_03_05.robot | 2 +- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 65fdb175..d539dc71 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -20,7 +20,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 7e3493cd..df7d0e2b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -18,7 +18,7 @@ Get an entity if an attribute is not known to the system ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Create List ${attribute_not_known} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index b6548ba6..da0476b5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -28,8 +28,8 @@ Query several entities based on ids @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=@{entity_types_to_be_retrieved} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index 03ab724d..7d616b51 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -23,7 +23,7 @@ Query several entities based on the given id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index d6f11619..bc6823c2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -26,7 +26,7 @@ Query several entities based on attribute names Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot index 181cdc5d..bfd336ed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot @@ -23,11 +23,12 @@ Query several entities based on a list of properties ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + @{entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot index 0402dd96..c97c4903 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot @@ -27,7 +27,7 @@ Query several entities via POST Interaction based on ids @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index c66e1123..f2aec860 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -36,7 +36,7 @@ Query several entities via POST Interaction based on the entities types ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Create List ${building_entity_id} ${vehicle_entity_id} + @{entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${building_entity_id} ${vehicle_entity_id} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot index 2914b47e..f1943fdf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot @@ -24,7 +24,7 @@ Query entities based on incorrect ids Check Response Status Code 201 ${response['status']} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot index 96f6886e..6c68087d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot @@ -22,7 +22,7 @@ Query several entities based on incorrect id pattern ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_id_pattern=${invalid_entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot index be18dd4c..55dd7fd3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot @@ -22,7 +22,7 @@ Query entitites when the request has a wrong geometryProperty ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${invalid_geometry_property} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} -- GitLab From 526f32ba5bf2aa646abe782f5b932501fcfbb0e3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 11 Mar 2021 11:52:07 +0100 Subject: [PATCH 128/442] fix: do not re-add core context when included in the default compound context --- data/entities/building-relationship-sample.jsonld | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/entities/building-relationship-sample.jsonld b/data/entities/building-relationship-sample.jsonld index e55a2a40..4b34bddb 100644 --- a/data/entities/building-relationship-sample.jsonld +++ b/data/entities/building-relationship-sample.jsonld @@ -6,7 +6,6 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file -- GitLab From 11a3de649c7e55531eb43f4ea644a03c0963a810 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 11 Mar 2021 12:14:33 +0100 Subject: [PATCH 129/442] fix: use correct URI for datasetId --- .../vehicle-speed-equal-datasetid-fragment.jsonld | 2 +- data/entities/vehicle-speed-two-datasetid-sample.jsonld | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld index 259a93f9..5e832e32 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld @@ -6,6 +6,6 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "12345" + "datasetId": "urn:ngsi-ld:Property:speedometer" } } \ No newline at end of file diff --git a/data/entities/vehicle-speed-two-datasetid-sample.jsonld b/data/entities/vehicle-speed-two-datasetid-sample.jsonld index 2cb1d9f1..b44a810c 100644 --- a/data/entities/vehicle-speed-two-datasetid-sample.jsonld +++ b/data/entities/vehicle-speed-two-datasetid-sample.jsonld @@ -21,7 +21,7 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "12345" + "datasetId": "urn:ngsi-ld:Property:speedometer" }, { "type": "Property", -- GitLab From b418b2e34c26b9d2f2e0c1e7e90a4457a2219f7c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 11 Mar 2021 13:48:11 +0100 Subject: [PATCH 130/442] fix: add an @context in the JSON-LD entity payload used to test append of attributes --- .../vehicle-attribute-to-add-fragment.jsonld | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld index c47ce407..5684047f 100644 --- a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld @@ -11,5 +11,8 @@ "attribute_to_be_added": { "type": "Property", "value": 23 - } + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } \ No newline at end of file -- GitLab From eb65009857fca256b49ec179e01d25479959f075 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 11 Mar 2021 15:33:37 +0000 Subject: [PATCH 131/442] refactored common behaviors --- TP/NGSI-LD/CommonBehaviours/043.robot | 86 +++++++++++--- TP/NGSI-LD/CommonBehaviours/044_01.robot | 41 +++++++ TP/NGSI-LD/CommonBehaviours/044_01_01.robot | 73 +++++++++++- TP/NGSI-LD/CommonBehaviours/044_02.robot | 4 +- TP/NGSI-LD/CommonBehaviours/044_02b.robot | 84 ++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_03b.robot | 92 +++++++++++++++ TP/NGSI-LD/CommonBehaviours/044_04.robot | 4 +- TP/NGSI-LD/CommonBehaviours/044_04b.robot | 61 ++++++++++ TP/NGSI-LD/CommonBehaviours/044_05b.robot | 107 +++++++++++++++++ .../Consumption/Entity/018_01_01.robot | 2 +- .../Consumption/Entity/018_01_02.robot | 2 +- .../Consumption/Entity/018_01_03.robot | 2 +- .../Consumption/Entity/018_02.robot | 2 +- .../Consumption/Entity/018_03_01.robot | 2 +- .../Consumption/Entity/018_03_02.robot | 2 +- .../Consumption/Entity/018_04.robot | 2 +- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/018_06.robot | 2 +- .../vehicle-fragment-brandname-sample.jsonld | 2 +- resources/ApiUtils.resource | 108 ++++++++++++------ resources/AssertionUtils.resource | 10 +- 21 files changed, 617 insertions(+), 73 deletions(-) create mode 100644 TP/NGSI-LD/CommonBehaviours/044_01.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_02b.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_03b.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_04b.robot create mode 100644 TP/NGSI-LD/CommonBehaviours/044_05b.robot diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index fe35908c..b372613b 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -4,33 +4,81 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Throw 503 LDContextNotAvaliable error - *** Variable *** ${expected_status_code}= 503 + ${building_id_prefix}= urn:ngsi-ld:Building: -${registration_id_prefix}= urn:ngsi-ld:Registration: +${building_filename}= building-minimal-without-context-sample.jsonld + ${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-without-context-sample.jsonld + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= bus-temporal-representation-without-context-sample.jsonld + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-without-context-sample.jsonld + +*** Test Cases *** +043_01 Create entity + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Entity by Id ${entity_id} + +043_02 Create subscription + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) -*** Test Cases *** PREFIX DELETE_PREFIX ENDPOINT FILENAME_PATH -043_01_endpoint /entities/ ${building_id_prefix} ${EMPTY} ${ENTITIES_ENDPOINT_PATH} entities/building-minimal-without-context-sample.jsonld -043_02_endpoint /csourceRegistrations/ ${registration_id_prefix} ${EMPTY} ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations/context-source-registration-without-context-sample.jsonld -043_03_endpoint /subscriptions/ ${subscription_id_prefix} ${EMPTY} ${SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_04_endpoint /csourceSubscriptions/ ${subscription_id_prefix} / ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions/subscription-without-context-sample.jsonld -043_05_endpoint /temporal/entities/ ${building_id_prefix} / ${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporalEntities/bus-temporal-representation-without-context-sample.jsonld + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Subscription ${subscription_id} -*** Keywords *** -Throw 503 LDContextNotAvaliable error - [Arguments] ${prefix} ${delete_prefix} ${endpoint} ${filename_path} - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved - [Tags] mandatory - ${create_id}= Generate Random Entity Id ${prefix} - ${delete_id}= Set Variable ${delete_prefix}${create_id} +043_03 Create Temporal Representation of Entities + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) - ${response}= Create Request By Selecting Endpoint ${create_id} ${endpoint} ${filename_path} + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Request By Selecting Endpoint/Id ${delete_id} ${endpoint} \ No newline at end of file + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +043_04 Batch entity create + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code Set To ${expected_status_code} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Batch Delete Entities @{entities_to_be_created} + +043_05 Create context source registration + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) + + ${registration_id_prefix}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id_prefix} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + + [Teardown] Delete Context Source Registration ${registration_id_prefix} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot new file mode 100644 index 00000000..2502ed43 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_fragment}= vehicle-fragment-brandname-sample.jsonld +${attribute_id}= brandName + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld + +*** Test Cases *** +044_01_02_endpoint /entities/{entityId}/attrs/{attrId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} + +044_01_03_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Subscription ${subscription_id} + diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01_01.robot index fc0274bd..5717b5da 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01_01.robot @@ -9,6 +9,22 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld + +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-simple-attributes-sample.jsonld +${fragment_filename}= vehicle-fragment-brandname-sample.jsonld +${attribute_id}= brandName + + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${filename_path}= csourceSubscriptions/subscription-sample.jsonld +${fragment_filename_path}= csourceSubscriptions/fragments/subscription-update-sample.jsonld + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= registration-sample.jsonld +${fragment_filename_path}= context-source-registration-update-sample.jsonld + + *** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/ [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type @@ -20,4 +36,59 @@ ${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} Check Response Status Code 204 ${response['status']} - [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id ${entity_id} + +044_01_02_endpoint /entities/{entityId}/attrs/{attrId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} + +044_01_03_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscription_id} ${filename_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Subscription ${subscription_id} ${fragment_filename_path} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Subscription ${subscription_id} + +044_01_04_endpoint /csourceRegistrations/{registrationId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/fragments/${fragment_filename_path} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + Check Response Status Code 204 ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} + +*** comment *** +043_01 Create entity +043_02 Retrieve entity by id +043_03 Partial attribute update + +043_04 Create subscription +043_05 Retrieve subscription by id +043_06 Update subscription + +043_07 Create Temporal Representation of Entities +043_08 Query temporal entities +043_09 Batch entity create +043_10 Create context source registration +043_11 Query context source registration \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index bccd74d2..9a787c2e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -56,7 +56,7 @@ ${teatype}= Vehicle ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${id} + ${request} ${response}= Query Entity ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} @@ -82,7 +82,7 @@ ${teatype}= Vehicle ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Retrieve Subscription ${id} + ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02b.robot b/TP/NGSI-LD/CommonBehaviours/044_02b.robot new file mode 100644 index 00000000..07b009a5 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_02b.robot @@ -0,0 +1,84 @@ +*** Settings *** +Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${building_expectation}= building-simple-attributes-sample-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_expectation}= subscription-sample-expectation.json + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/registration-with-expiration-sample.jsonld +${registration_expectation}= registration-with-expiration-expectation-sample.json +${registration_type}= Vehicle + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${tea_expectation}= vehicle-temporal-representation-expectation.json +${teatype}= Vehicle + +*** Test Cases *** +044_02_01_endpoint /entities/{entityId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) + ${id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Query Entity ${id} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* + + [Teardown] Delete Entity by Id Returning Response ${id} + + +044_02_02_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Retrieve Subscription ${id} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* + + [Teardown] Delete Subscription ${id} + +044_02_03_endpoint /csourceRegistrations/ + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} + Check Response Status Code 200 ${response['status']} + Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* + + [Teardown] Delete Context Source Registration ${registration_id} + +044_02_04_endpoint /temporal/entities + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z + Check Response Status Code 200 ${response['status']} + Set Test Variable ${response} + Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} + Check Request Containing Accept Header Set To ${request} application/json, */* + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_03b.robot b/TP/NGSI-LD/CommonBehaviours/044_03b.robot new file mode 100644 index 00000000..79c9916e --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_03b.robot @@ -0,0 +1,92 @@ +*** Settings *** +Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld +${vehicle_attribute}= speed +${vehicle_fragment}= vehicle-fragment-empty-datasetid-sample.jsonld + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld + +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** +044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_03_02_endpoint patch /subscriptions/{subscriptionId} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Update Subscription ${id} ${subscription_fragment} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Subscription ${id} + + +044_03_03_endpoint post /entities/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} + +044_03_04_endpoint post /subscriptions/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) + + ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Subscription ${subscriptions_id} + +044_03_05_endpoint post /entityOperations/create + + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} content_type=${EMPTY} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 415 + + [Teardown] Batch Delete Entities @{expected_entities_ids} + +044_03_06_endpoint post /temporal/entities/ + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} + Check Response Status Code 415 ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index aa010577..b4239d0d 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -52,7 +52,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} accept=${accept} + ${request} ${response}= Query Entity ${entity_id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -76,7 +76,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Retrieve Subscription ${id} accept=${accept} + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Subscription ${id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04b.robot b/TP/NGSI-LD/CommonBehaviours/044_04b.robot new file mode 100644 index 00000000..a80de3b3 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_04b.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${accept}= application/xml +${status_code}= 406 + +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** +044_04_01_endpoint get /entities/{entityId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Query Entity ${entity_id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_04_02_endpoint get /subscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +044_04_03_endpoint get /csourceRegistrations/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) + + Query Context Source Registrations type=Building accept=${accept} + Check Response Status Code Set To ${status_code} + +044_04_04_endpoint get /csourceSubscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) + + Query Context Source Registration Subscriptions accept=${accept} + Check Response Status Code Set To ${status_code} + +044_04_05_endpoint get /temporal/entities + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + + @{entity_types_to_be_retrieved}= Create List Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Check Response Status Code Set To ${status_code} + diff --git a/TP/NGSI-LD/CommonBehaviours/044_05b.robot b/TP/NGSI-LD/CommonBehaviours/044_05b.robot new file mode 100644 index 00000000..f6d40827 --- /dev/null +++ b/TP/NGSI-LD/CommonBehaviours/044_05b.robot @@ -0,0 +1,107 @@ +*** Settings *** +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${accept}= application/geo+json +${status_code}= 406 + +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building + +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json + +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= registration-sample.jsonld +${registration_fragment}= registration-with-expiration-sample.jsonld + +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_attribute}= brandName +${vehicle_fragment}= vehicle-fragment-brandname-sample.jsonld + +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld + +*** Test Cases *** +044_05_01_endpoint create /entities/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id ${entity_id} + +044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Retrieve Entity by Id ${entity_id} + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +044_05_03_endpoint create /subscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) + + ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${subscriptions_id} + +044_05_04_endpoint update /subscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) + + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + + ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Subscription ${id} + +044_05_05_endpoint create /temporal/entities/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) + + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +044_05_06_endpoint create /entityOperations/create + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} accept=${accept} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To ${status_code} + + [Teardown] Batch Delete Entities @{expected_entities_ids} + +044_05_07_endpoint create /csourceRegistrations/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) + + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot index 381f3b60..a862d667 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot @@ -18,7 +18,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 4fe17c79..f7697e2e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -21,7 +21,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot index 8ccd23fa..90ebce62 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot @@ -19,7 +19,7 @@ ${geometry_property}= location ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot index 548f50ed..3ac7d19a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot @@ -15,7 +15,7 @@ Get Entity With Invalid/Missing Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] mandatory - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot index 5bad223c..af115a4a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot @@ -13,7 +13,7 @@ Get an entity if the Entity Id is not known to the system [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index 534477a0..a277c41d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -19,7 +19,7 @@ Get an entity if an atris not known to the system Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Create List ${attribute_not_known} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot index 366e2126..5d6b02f7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot @@ -19,7 +19,7 @@ Get an entity in a simplified representation ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index d7e60109..2ad1b79c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -20,7 +20,7 @@ Get an entity by id that can be returned in a geoJSON format ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} + ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot index 48e921f2..c380f352 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot @@ -25,7 +25,7 @@ Check Json-LD Resolution When retrieving an entity [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Tags] mandatory - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} diff --git a/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld b/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld index cf7ce5ac..819eca55 100644 --- a/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld +++ b/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld @@ -1,5 +1,5 @@ { - "brandName": { + "https://ngsi-ld-test-suite/context#brandName": { "type": "Property", "value": "BMW" }, diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 745a2d28..7a035b90 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -62,9 +62,9 @@ Query Entity Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} - Output request + ${request}= Output request Output response - [return] ${response} + [return] ${request} ${response} Query Entities [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} @@ -119,10 +119,11 @@ Retrieve Entity by Id Set Test Variable ${response} Create Entity Selecting Content Type - [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} + [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='${EMPTY}' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} ${request}= Output request @@ -173,8 +174,9 @@ Delete Entity Attributes [return] ${response} Partial Update Entity Attributes - [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} + [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} Output request @@ -278,32 +280,6 @@ Delete Context Source Registration With Return Output response [return] ${response} -Create Request By Selecting Endpoint - [Arguments] ${id} ${endpoint} ${filename_path} - ${item_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${item}= Update Value To Json ${item_payload} $..id ${id} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${item} headers=${headers} - Output request - Output response - [return] ${response} - -Merge Request By Selecting Endpoint - [Arguments] ${id} ${endpoint} ${filename_path} - ${item_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${item}= Update Value To Json ${item_payload} $..id ${id} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${endpoint} body=${item} headers=${headers} - Output request - Output response - [return] ${response} - -Delete Request By Selecting Endpoint/Id - [Arguments] ${id} ${delete_endpoint} - ${response}= DELETE ${delete_endpoint}${id} - Output request - Output response - Create Entity [Arguments] ${filename} ${entity_id} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} @@ -314,10 +290,11 @@ Create Entity Output response Create Or Update Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} Output request Output response @@ -411,9 +388,10 @@ Update Temporal Representation Of Entity Selecting Content Type [return] ${response} Batch Create Entities - [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} ${headers}= Create Dictionary Set To Dictionary ${headers} Content-Type ${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} Output request @@ -607,9 +585,9 @@ Retrieve Context Source Registration Set Test Variable ${response} Create Context Source Registration Subscription - [Arguments] ${subscription_payload} ${accept}=${EMPTY} + [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - &{headers}= Create Dictionary Content-Type=application/ld+json + &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} ${request}= Output request @@ -717,9 +695,9 @@ Retrieve Subscription Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} - Output request + ${request}= Output request Output response - [return] ${response} + [return] ${request} ${response} Update Context Source Registration Subscription By Selecting Content Type [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} @@ -797,4 +775,60 @@ Batch Delete Entities By Selecting Content Type Output request Output response Run Keyword If not ${teardown} Set Test Variable ${response} - Set Test Variable ${response} \ No newline at end of file + Set Test Variable ${response} + +Query Context Source Registrations With Return + [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} accept=${accept} + Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} + Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} + Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + + [return] ${request} ${response} + +Query Temporal Representation Of Entities With Return + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} + ${entity_types_length} = Get Length ${entity_types} + ${entity_ids_length} = Get Length ${entity_ids} + ${attrs_length} = Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} + Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + [return] ${request} ${response} \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index ae045c3d..a58483d4 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -40,6 +40,12 @@ Check Response Body Content ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} Should Be True ${comparison_result} msg=Entity Comparison Failed +Check Request Containing Accept Header Set To + [Arguments] ${request} ${expected_accept_content} + + Run Keyword If 'Accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['Accept']} ignore_order=True + Run Keyword If 'accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['accept']} ignore_order=True + # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to @@ -296,6 +302,6 @@ Check Response Body Containing One Subscription element Check Response Body Containing One Registration element [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${subscription} ${instance_id_regex_expr} + ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${registration} ${instance_id_regex_expr} Should Be True ${comparison_result} msg=Entity Comparison Failed \ No newline at end of file -- GitLab From 5d7f6d9711dc0dbad660ff8369f5087eda36d5a9 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 11 Mar 2021 18:47:47 +0000 Subject: [PATCH 132/442] reviewed query entities tests --- .../Consumption/Entity/019_01_04.robot | 4 +-- .../Consumption/Entity/019_02_02.robot | 5 +-- .../Consumption/Entity/019_02_03.robot | 4 +-- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- .../Consumption/Entity/019_06.robot | 2 +- .../Provision/EntityAttributes/010_01.robot | 36 +++++++++++++------ .../Provision/EntityAttributes/010_02.robot | 8 ++--- ...l-datasetid-different-type-fragment.jsonld | 5 +-- resources/ApiUtils.resource | 9 +++++ 10 files changed, 49 insertions(+), 28 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot index bc6823c2..907b16f2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot @@ -26,10 +26,10 @@ Query several entities based on attribute names Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot index f2aec860..f6af3e50 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot @@ -16,7 +16,6 @@ ${building_entity_type}= https://ngsi-ld-test-suite/context#Building ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking - *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types @@ -36,11 +35,9 @@ Query several entities via POST Interaction based on the entities types ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${building_entity_id} ${vehicle_entity_id} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} - + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} *** Keywords *** Delete Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot index 9b5e746c..438c15b9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot @@ -24,15 +24,13 @@ Query several entities via POST Interaction based on the given id pattern Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 27d45e27..514da40c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -28,7 +28,7 @@ Query entities in a simplified representation @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index 0a32c62e..a48764cb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -28,7 +28,7 @@ Get an entity by id that can be returned in a geoJSON format @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot index d23a8401..625df83a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot @@ -27,7 +27,7 @@ Query entities specifying a maximum number of results Check Response Status Code 201 ${response['status']} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index 759b23ab..2945ae8e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -4,21 +4,37 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Append Attributes - *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-speed-two-datasetid-sample.jsonld -*** Test Cases *** STATUS_CODE OVERWRITE FRAGMENT_FILENAME EXPECTATION_FILENAME -010_01_01_Append entity attributes 204 ${EMPTY} vehicle-attribute-to-add-fragment.jsonld ${EMPTY} -010_01_02_Append entity attributes 207 noOverwrite vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld -010_01_03_Append entity attributes 204 ${EMPTY} vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} -010_01_04_Append entity attributes 204 noOverwrite vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} +*** Test Cases *** +010_01_01_Append entity attributes + Append Attributes Without Params 204 vehicle-attribute-to-add-fragment.jsonld +010_01_02_Append entity attributes + Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld +010_01_03_Append entity attributes + Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld +010_01_04_Append entity attributes + Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} *** Keywords *** -Append Attributes - [Arguments] ${status_code} ${overwrite} ${fragment_filename} ${expectation_filename} +Append Attributes Without Params + [Arguments] ${status_code} ${fragment_filename} + [Documentation] Check that you can append entity attributes + [Tags] /entities/{entityId}/attrs/ 5_6_3 + + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Append Attributes With Params + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] /entities/{entityId}/attrs/ 5_6_3 @@ -26,7 +42,7 @@ Append Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${overwrite} + ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite Check Response Status Code ${status_code} ${response['status']} Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 3564e43f..67bb6c34 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -12,10 +12,10 @@ ${status_code}= 400 ${invalid_fragment_filename}= invalid-fragment.jsonld *** Test Cases *** -#010_02_01_Append entity attributes if the entity Id is not present -# Append Attributes ${EMPTY} -#010_02_02_Append entity attributes if the Entity Id is not a valid URI -# Append Attributes thisisaninvaliduri +010_02_01_Append entity attributes if the entity Id is not present + Append Attributes ${EMPTY} +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri 010_02_03_Append entity attributes with invalid entity fragments Append entity attributes with invalid entity fragments diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld index e104e4d0..e865fd84 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld @@ -8,6 +8,7 @@ }, "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" }, - "@context": - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 74de3e93..42a29b9b 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -125,6 +125,15 @@ Create Entity Selecting Content Type [return] ${request} ${response} Append Entity Attributes + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} + Output request + Output response + [return] ${response} + +Append Entity Attributes With Parameters [Arguments] ${id} ${fragment_filename} ${content_type} ${options} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} -- GitLab From dc2d57d0f5d3fefe7efbabfd5896b3bc73b8359f Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 12 Mar 2021 14:55:41 +0000 Subject: [PATCH 133/442] fixed append entity attributes keyword --- .../Provision/EntityAttributes/010_02.robot | 10 +++++----- .../Provision/EntityAttributes/010_03.robot | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index 67bb6c34..f0f1480e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -14,10 +14,10 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld *** Test Cases *** 010_02_01_Append entity attributes if the entity Id is not present Append Attributes ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI - Append Attributes thisisaninvaliduri -010_02_03_Append entity attributes with invalid entity fragments - Append entity attributes with invalid entity fragments +#010_02_02_Append entity attributes if the Entity Id is not a valid URI +# Append Attributes thisisaninvaliduri +#010_02_03_Append entity attributes with invalid entity fragments +# Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes @@ -29,7 +29,7 @@ Append Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index eee1bf46..7f790698 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -14,7 +14,7 @@ Append entity attributes when the entity id is not known to the system [Tags] /entities/{entityId}/attrs/ 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -- GitLab From 2b818d356ac54848a23c1f42b1656ea6e0e0ecbf Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 12 Mar 2021 14:56:03 +0000 Subject: [PATCH 134/442] fixed append entity attributes keyword --- .../Provision/EntityAttributes/010_02.robot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot index f0f1480e..2355e695 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot @@ -14,10 +14,10 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld *** Test Cases *** 010_02_01_Append entity attributes if the entity Id is not present Append Attributes ${EMPTY} -#010_02_02_Append entity attributes if the Entity Id is not a valid URI -# Append Attributes thisisaninvaliduri -#010_02_03_Append entity attributes with invalid entity fragments -# Append entity attributes with invalid entity fragments +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri +010_02_03_Append entity attributes with invalid entity fragments + Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes -- GitLab From 3e298467b7b0e90fce931d3f803837eaaf42ceb7 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 15 Mar 2021 19:26:51 +0000 Subject: [PATCH 135/442] reviewed failing tests related updated:fragments not using contexts and wrong expectation format --- .../Provision/EntityAttributes/010_01.robot | 2 +- .../Provision/EntityAttributes/010_03.robot | 4 ++-- .../Provision/EntityAttributes/012_01.robot | 7 +++---- .../Provision/EntityAttributes/012_02.robot | 10 +++++----- .../Provision/EntityAttributes/012_03.robot | 2 +- .../034_02.robot | 16 ++++++++-------- .../add-attribute-expectation.jsonld | 18 +++++------------- .../vehicle-isparked-fragment.jsonld | 5 ++++- .../vehicle-new-attribute-fragment.jsonld | 9 +++++++++ ...hicle-speed-equal-datasetid-fragment.jsonld | 5 ++++- ...cle-speed-invalid-datasetid-fragment.jsonld | 5 ++++- .../vehicle-speed-wrong-name-fragment.jsonld | 5 ++++- ...e-temporal-intanceid-update-fragment.jsonld | 2 +- ...cle-temporal-representation-fragment.jsonld | 2 +- ...representation-invalid-json-fragment.jsonld | 4 ++-- 15 files changed, 54 insertions(+), 42 deletions(-) create mode 100644 data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index 2945ae8e..543cae57 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -10,7 +10,7 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** 010_01_01_Append entity attributes - Append Attributes Without Params 204 vehicle-attribute-to-add-fragment.jsonld + Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld 010_01_02_Append entity attributes Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld 010_01_03_Append entity attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot index 7f790698..6a44fa90 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot append entity attributes if the entity id or attributes are not known to the system +Documentation Check that you cannot append entity attributes if the entity id is not known to the system Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -10,7 +10,7 @@ ${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system - [Documentation] Check that you cannot append entity attributes if the entity id or attributes are not known to the system + [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system [Tags] /entities/{entityId}/attrs/ 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index ea7b4ae7..ae829b00 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -12,8 +12,8 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld ${status_code}= 204 *** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID -012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed +012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed *** Keywords *** Update Attributes @@ -25,8 +25,7 @@ Update Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - #TODO: check body response is empty [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot index 9dd3a92c..c01c314b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot @@ -13,12 +13,12 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${status_code}= 400 *** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld -012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +#012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +#012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld 012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld -012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld -012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld +#012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld +#012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +#012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index 8e872530..53dd1709 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -28,7 +28,7 @@ Partial Update Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 3b4f3c29..263fc5e8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -12,14 +12,14 @@ ${filename}= context-source-registration-simple-sample.jsonld ${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Case *** -#034_02_01_Update a context source registration by id if the Id is not present -# Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld -#034_02_02_Update a context source registration by id if the Id is not a valid URI -# Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld -#034_02_03_Update a context source registration if the request body is not of the same data type -# Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld -#034_02_04_Update a context source registration if you attempt to remove a mandatory property -# Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld +034_02_01_Update a context source registration by id if the Id is not present + Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld +034_02_02_Update a context source registration by id if the Id is not a valid URI + Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld +034_02_03_Update a context source registration if the request body is not of the same data type + Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld +034_02_04_Update a context source registration if you attempt to remove a mandatory property + Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld 034_02_05_Update a context source registration if the request body is invalid Update a context source registration if the request body is invalid diff --git a/data/entities/expectations/add-attribute-expectation.jsonld b/data/entities/expectations/add-attribute-expectation.jsonld index ff230172..1f9522a6 100644 --- a/data/entities/expectations/add-attribute-expectation.jsonld +++ b/data/entities/expectations/add-attribute-expectation.jsonld @@ -1,14 +1,6 @@ { - "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added": [ - { - "@type": [ - "https://uri.etsi.org/ngsi-ld/Property" - ], - "https://uri.etsi.org/ngsi-ld/hasValue": [ - { - "@value": 23 - } - ] - } - ] -} \ No newline at end of file + "updated":[ + "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added" + ], + "notUpdated":[ ] + } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld index 54c0d1e1..1b59b6f2 100644 --- a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld @@ -7,5 +7,8 @@ "type": "Relationship", "object": "urn:ngsi-ld:Person:JohnDoe" } - } + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } diff --git a/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld new file mode 100644 index 00000000..4ed2fd7b --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld @@ -0,0 +1,9 @@ +{ + "attribute_to_be_added": { + "type": "Property", + "value": 23 + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld index 5e832e32..c61d72cb 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld @@ -7,5 +7,8 @@ "value": "Speedometer" }, "datasetId": "urn:ngsi-ld:Property:speedometer" - } + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld index 8368c5bd..f25aea7c 100644 --- a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld @@ -7,5 +7,8 @@ "value": "Speedometer" }, "datasetId": "" - } + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld index e5f1135d..a5a4be17 100644 --- a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld @@ -11,5 +11,8 @@ "brandName": { "type": "Property", "value": "BMW" - } + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld index 60e19dde..d7433ad6 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld @@ -7,6 +7,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld index 985d962a..8a4c0af9 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld @@ -17,6 +17,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld index 95b7174f..b7661abf 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -41,7 +41,7 @@ "observedAt":"2020-09-01T14:07:00Z" } ], - "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file -- GitLab From cf582c25ea3a8d17c19b5afb12f94a5d5f83acb7 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 16 Mar 2021 11:22:39 +0000 Subject: [PATCH 136/442] fixed expectation file structure --- ...vehicle-speed-datasetid-expectation.jsonld | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld index 8d27d4a2..d1ea2d54 100644 --- a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld @@ -1,31 +1,6 @@ { - "https://ngsi-ld-test-suite/context#speed": [ - { - "https://uri.etsi.org/ngsi-ld/datasetId": [ - { - "@id": "urn:ngsi-ld:Property:speedometerA4567-speed" - } - ], - "https://ngsi-ld-test-suite/context#source": [ - { - "@type": [ - "https://uri.etsi.org/ngsi-ld/Property" - ], - "https://uri.etsi.org/ngsi-ld/hasValue": [ - { - "@value": "Speedometer" - } - ] - } - ], - "@type": [ - "https://uri.etsi.org/ngsi-ld/Property" - ], - "https://uri.etsi.org/ngsi-ld/hasValue": [ - { - "@value": 99 - } - ] - } - ] -} \ No newline at end of file + "updated":[ + "https://ngsi-ld-test-suite/context#speed" + ], + "notUpdated":[ ] + } \ No newline at end of file -- GitLab From 18d958ed49d0961637267db9fcc051e6d8f660c2 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 16 Mar 2021 14:16:57 +0000 Subject: [PATCH 137/442] folders setup --- .../CreateSubscription/001_01.robot | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot b/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot new file mode 100644 index 00000000..7f4ed1cc --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot @@ -0,0 +1,30 @@ +*** Settings *** +Documentation Check that you can create an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Entity Scenarios + +*** Variable *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json +001_01_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json +001_01_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json +001_01_04_EntityWithLocationAttribute building-location-attribute-sample.jsonld application/ld+json + +*** Keywords *** +Create Entity Scenarios + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create an entity + [Tags] /entities/ 5_6_1 + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} + + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file -- GitLab From 2508882c007a34e44aa9db81f739794a89f6ccbd Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Tue, 16 Mar 2021 15:17:53 +0100 Subject: [PATCH 138/442] feat: add checks on modifications made in the context broker for batch entities and csource registration subscription --- .../CreateBatchOfEntities/003_01.robot | 3 ++ .../CreateBatchOfEntities/003_02.robot | 4 +++ .../DeleteBatchOfEntities/006_01.robot | 3 ++ .../DeleteBatchOfEntities/006_02.robot | 2 ++ .../UpdateBatchOfEntities/005_01.robot | 25 +++++++++---- .../UpdateBatchOfEntities/005_02.robot | 25 +++++++++---- .../UpdateBatchOfEntities/005_03.robot | 15 ++++++-- .../UpsertBatchOfEntities/004_01.robot | 3 ++ .../UpsertBatchOfEntities/004_02.robot | 4 +++ .../UpsertBatchOfEntities/004_03.robot | 4 +++ .../UpsertBatchOfEntities/004_04.robot | 21 +++++++---- .../UpsertBatchOfEntities/004_05.robot | 4 +++ .../Entities/CreateEntity/001_01.robot | 5 +++ .../Entities/DeleteEntity/002_01.robot | 3 ++ .../038_01.robot | 4 +++ .../038_02.robot | 4 +++ .../042_01.robot | 3 ++ .../039_01.robot | 6 ++++ ...alityLevel-with-relationship-fragment.json | 12 +++++++ .../fragmentEntities/empty-fragment.json | 3 ++ .../fragmentEntities/locatedAt-fragment.json | 6 ++++ .../simple-attributes-fragment.json | 22 ++++++++++++ ...tes-relationship-of-property-fragment.json | 26 ++++++++++++++ resources/ApiUtils.resource | 5 ++- resources/AssertionUtils.resource | 35 ++++++++++++++++++- resources/JsonUtils.resource | 6 ++++ 26 files changed, 229 insertions(+), 24 deletions(-) create mode 100644 data/entities/fragmentEntities/airQualityLevel-with-relationship-fragment.json create mode 100644 data/entities/fragmentEntities/empty-fragment.json create mode 100644 data/entities/fragmentEntities/locatedAt-fragment.json create mode 100644 data/entities/fragmentEntities/simple-attributes-fragment.json create mode 100644 data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 725fd77b..4de7f40a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -33,4 +33,7 @@ Batch Create Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + Check Created Resources Set To ${entities_to_be_created} + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index bc248639..c7b24622 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -30,6 +30,10 @@ Create a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + @{created_entities}= Create List ${first_entity} ${second_entity} + Check Created Resources Set To ${created_entities} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 13652a23..f2f36c0e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -20,6 +20,9 @@ Delete a batch of entities Check Response Status Code Set To 204 + Query Entities ${entities_ids_to_be_deleted} Building context=${ngsild_test_suite_context} + Check SUT Not Containing Resources + *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index 49246ae0..7bd1b04f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -25,6 +25,8 @@ Delete a batch of non existing and existing entities Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + Check SUT Not Containing Resources *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 4ecd8679..8f176978 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -10,31 +10,42 @@ Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld -EntityWithSimpleRelationships building-relationship-sample.jsonld -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json +EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json *** Keywords *** Batch Update Entity Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities [Tags] mandatory ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} Batch Update Entities @{entities_to_be_updated} Check Response Status Code Set To 204 + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} + ${update_fragment}= Load Test Sample entities/${update_fragment_filename} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + Query Entities ${entities_ids_to_be_updated} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${updated_entities} + Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + Create Entity ${entity_payload_filename} ${first_entity_id} + Create Entity ${entity_payload_filename} ${second_entity_id} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 45485a7d..1fc9498c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -10,31 +10,42 @@ Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld -EntityWithSimpleRelationships building-relationship-sample.jsonld -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json +EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json *** Keywords *** Batch Update Entity With NoOverwrite Option Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities with noOverwrite option [Tags] mandatory ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite Check Response Status Code Set To 204 + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} + ${update_fragment}= Load Test Sample entities/${update_fragment_filename} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + Query Entities ${entities_ids_to_be_updated} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${updated_entities} + Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + Create Entity ${entity_payload_filename} ${first_entity_id} + Create Entity ${entity_payload_filename} ${second_entity_id} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 6ea6ff51..c274b8be 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld +${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of-property-fragment.json *** Test Case *** Update a batch of non existing and existing entities @@ -30,14 +32,23 @@ Update a batch of non existing and existing entities Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_existing_entity_id} + ${update_fragment}= Load Test Sample entities/${update_fragment_filename} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${updated_entities} + Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_existing_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_existing_entity_id} + Create Entity ${entity_payload_filename} ${first_existing_entity_id} + Create Entity ${entity_payload_filename} ${second_existing_entity_id} Set Suite Variable ${first_existing_entity_id} Set Suite Variable ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index d3f74612..710f4c13 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -32,4 +32,7 @@ Batch Upsert Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${entities_to_be_upserted} + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 6ec7f570..3c643b81 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -34,6 +34,10 @@ Batch Upsert Non-existing And Existing Entities Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + Query Entities ${upserted_entities_ids} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${entities_to_be_upserted} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 24fe2194..16a632e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -30,6 +30,10 @@ Batch Upsert Existing Entities Scenarios Check Response Status Code Set To 204 + @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Query Entities ${upserted_entities_ids} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${entities_to_be_upserted} + Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index e9baf486..43bcedfb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -10,15 +10,16 @@ Suite Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: +${existing_entity_payload_filename}= building-minimal-sample.jsonld -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld -EntityWithSimpleRelationships building-relationship-sample.jsonld -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json +EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json +EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json *** Keywords *** Batch Upsert Entities With Update Option Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can upsert a batch of entities with update option [Tags] mandatory @@ -26,6 +27,7 @@ Batch Upsert Entities With Update Option Scenarios ${new_entity}= Load Entity ${filename} ${new_entity_id} ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} + @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} Batch Upsert Entities @{entities_to_be_upserted} update_option=update @@ -33,12 +35,19 @@ Batch Upsert Entities With Update Option Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} + ${update_fragment}= Load Test Sample entities/${update_fragment_filename} + ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} + @{updated_entities}= Create List ${new_entity} ${old_updated_entity} + Query Entities ${entities_ids_to_be_upserted} Building context=${ngsild_test_suite_context} + Check Updated Resources Set To ${updated_entities} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${existing_entity_id} + Create Entity ${existing_entity_payload_filename} ${existing_entity_id} Set Suite Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 5bb07723..91426f04 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -30,4 +30,8 @@ Upsert a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + @{upserted_entities}= Create List ${first_entity} ${second_entity} + Check Updated Resources Set To ${upserted_entities} + Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 7f4ed1cc..b35b351b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -27,4 +27,9 @@ Create Entity Scenarios Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} + ${created_entity}= Load Test Sample entities/${filename} ${entity_id} + Run Keyword If '${content_type}'=='application/json' Retrieve Entity by Id ${entity_id} ${content_type} + Run Keyword If '${content_type}'=='application/ld+json' Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + Check Created Resource Set To ${created_entity} + [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 8254de9f..c7529b70 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -18,3 +18,6 @@ Delete an entity ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code 204 ${response['status']} + + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 2e97d9dd..aeb55b3c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -23,6 +23,10 @@ Create Context Source Registration Subscription Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions # TODO: Refactor Generate Random Entity Id to Generate Random Test Sample Id diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index e5347ac4..d7019a98 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -25,6 +25,10 @@ Create Context Source Registration Subscription Without An Id Set Suite Variable ${subscription_id} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} + Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Delete Created Context Source Registration Subscriptions Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index e422665c..53629a0f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -19,6 +19,9 @@ Delete Context Source Registration Subscription Check Response Status Code Set To 204 + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index c72a111c..bca6b4d5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -22,6 +22,11 @@ Update Context Source Registration Subscription Check Response Status Code Set To 204 + ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${subscription} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -30,6 +35,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} + Set Suite Variable ${subscription_payload} Delete Initial Context Source Registration Subscriptions Delete Context Source Registration Subscription ${subscription_id} diff --git a/data/entities/fragmentEntities/airQualityLevel-with-relationship-fragment.json b/data/entities/fragmentEntities/airQualityLevel-with-relationship-fragment.json new file mode 100644 index 00000000..cbf121c3 --- /dev/null +++ b/data/entities/fragmentEntities/airQualityLevel-with-relationship-fragment.json @@ -0,0 +1,12 @@ +{ + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z", + "hasWeatherObserved": { + "type": "Relationship", + "object": "urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/empty-fragment.json b/data/entities/fragmentEntities/empty-fragment.json new file mode 100644 index 00000000..0db3279e --- /dev/null +++ b/data/entities/fragmentEntities/empty-fragment.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/data/entities/fragmentEntities/locatedAt-fragment.json b/data/entities/fragmentEntities/locatedAt-fragment.json new file mode 100644 index 00000000..c48f459a --- /dev/null +++ b/data/entities/fragmentEntities/locatedAt-fragment.json @@ -0,0 +1,6 @@ +{ + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/simple-attributes-fragment.json b/data/entities/fragmentEntities/simple-attributes-fragment.json new file mode 100644 index 00000000..d682a537 --- /dev/null +++ b/data/entities/fragmentEntities/simple-attributes-fragment.json @@ -0,0 +1,22 @@ +{ + "name":{ + "type":"Property", + "value":"Eiffel Tower" + }, + "subCategory":{ + "type":"Property", + "value":[ + "tourism" + ] + }, + "airQualityLevel":{ + "type":"Property", + "value":4, + "unitCode":"C62", + "observedAt":"2020-09-09T16:40:00.000Z" + }, + "almostFull":{ + "type":"Property", + "value":false + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json b/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json new file mode 100644 index 00000000..52660970 --- /dev/null +++ b/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json @@ -0,0 +1,26 @@ +{ + "name":{ + "type":"Property", + "value":"Eiffel Tower" + }, + "subCategory":{ + "type":"Property", + "value":[ + "tourism" + ] + }, + "airQualityLevel":{ + "type":"Property", + "value":4, + "unitCode":"C62", + "observedAt":"2020-09-09T16:40:00.000Z", + "hasWeatherObserved":{ + "type":"Relationship", + "object":"urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + }, + "almostFull":{ + "type":"Property", + "value":false + } +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 42a29b9b..1789ba86 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -60,6 +60,7 @@ Query Entity ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} Output request Output response + Set Test Variable ${response} [return] ${response} Query Entities @@ -83,6 +84,7 @@ Query Entities ${response}= GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response + Set Test Variable ${response} [return] ${response} Query Entities Via POST @@ -578,9 +580,10 @@ Update Context Source Registration Subscription Set Test Variable ${response} Retrieve Context Source Registration Subscription - [Arguments] ${subscription_id} ${context}=${EMPTY} + [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} &{headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} Output request diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index ba0f8ca2..261fcd30 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -2,7 +2,7 @@ Library ${EXECDIR}/libraries/assertionUtils.py *** Variable *** -${id_regex_expr}= root\\['@context'\\] +${id_regex_expr}= root\\['id'\\] ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] @@ -285,3 +285,36 @@ Check Pagination Prev And Next Headers Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link']} ${expected_links} ignore_order=True Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} + +Check Resource Set To + [Arguments] ${resource} ${ignored_keys}=${None} ${error_message}=${EMPTY} + + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${resource} ${ignored_keys} + Should Be True ${comparison_result} msg=${error_message} + +Check Created Resource Set To + [Arguments] ${created_resource} ${ignored_keys}=${None} + + Check Resource Set To ${created_resource} ${ignored_keys} Created Resource Comparison Failed + +Check Created Resources Set To + [Arguments] ${created_resources} ${ignored_keys}=${None} + + Check Resource Set To ${created_resources} ${ignored_keys} Created Resources Comparison Failed + +Check Updated Resource Set To + [Arguments] ${updated_resource} ${ignored_keys}=${None} + + Check Resource Set To ${updated_resource} ${ignored_keys} Updated Resource Comparison Failed + +Check Updated Resources Set To + [Arguments] ${updated_resources} ${ignored_keys}=${None} + + Check Resource Set To ${updated_resources} ${ignored_keys} Updated Resources Comparison Failed + +Check SUT Not Containing Resource + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} 404 + +Check SUT Not Containing Resources + Should Be Empty ${response['body']} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 07767d1d..9d633d56 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -64,3 +64,9 @@ Create Batch Operation Result &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} [return] &{batch_operation_result} + +Upsert Element In Entity + [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ + + ${updated_entity}= Add Object To Json ${initial_entity} ${jsonPath} ${fragment} + [return] ${updated_entity} -- GitLab From 839665ae59d909283eb0439f0d044275ca4e2003 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 16 Mar 2021 16:28:31 +0000 Subject: [PATCH 139/442] adapt tests to the new defined endpoints --- TP/NGSI-LD/CommonBehaviours/044_01.robot | 8 +- TP/NGSI-LD/CommonBehaviours/044_01_01.robot | 94 --------- TP/NGSI-LD/CommonBehaviours/044_01_02.robot | 24 --- TP/NGSI-LD/CommonBehaviours/044_01_03.robot | 23 -- TP/NGSI-LD/CommonBehaviours/044_01_04.robot | 27 --- TP/NGSI-LD/CommonBehaviours/044_01_05.robot | 25 --- TP/NGSI-LD/CommonBehaviours/044_01_06.robot | 27 --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 179 ++-------------- TP/NGSI-LD/CommonBehaviours/044_02b.robot | 84 -------- TP/NGSI-LD/CommonBehaviours/044_03.robot | 197 +----------------- TP/NGSI-LD/CommonBehaviours/044_03b.robot | 92 -------- TP/NGSI-LD/CommonBehaviours/044_04.robot | 140 +------------ TP/NGSI-LD/CommonBehaviours/044_04b.robot | 61 ------ TP/NGSI-LD/CommonBehaviours/044_05.robot | 117 +++++------ TP/NGSI-LD/CommonBehaviours/044_05b.robot | 107 ---------- ...stration-with-expiration-expectation.json} | 0 ...onld => vehicle-brandname-fragment.jsonld} | 0 17 files changed, 91 insertions(+), 1114 deletions(-) delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_01.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_02.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_03.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_04.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_05.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_01_06.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_02b.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_03b.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_04b.robot delete mode 100644 TP/NGSI-LD/CommonBehaviours/044_05b.robot rename data/csourceRegistrations/expectations/{registration-with-expiration-expectation-sample.json => context-source-registration-with-expiration-expectation.json} (100%) rename data/entities/fragmentEntities/{vehicle-fragment-brandname-sample.jsonld => vehicle-brandname-fragment.jsonld} (100%) diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 2502ed43..76c1db84 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-fragment-brandname-sample.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.jsonld ${attribute_id}= brandName ${subscription_id_prefix}= urn:ngsi-ld:Subscription: @@ -15,7 +15,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld *** Test Cases *** -044_01_02_endpoint /entities/{entityId}/attrs/{attrId} +044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -26,8 +26,8 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa Check Response Status Code 204 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} - -044_01_03_endpoint /subscriptions/{subscriptionId} + +044_01_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01_01.robot deleted file mode 100644 index 5717b5da..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_01.robot +++ /dev/null @@ -1,94 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${fragment_filename}= vehicle-two-datasetid-attributes-sample-01.jsonld - - -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-simple-attributes-sample.jsonld -${fragment_filename}= vehicle-fragment-brandname-sample.jsonld -${attribute_id}= brandName - - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${filename_path}= csourceSubscriptions/subscription-sample.jsonld -${fragment_filename_path}= csourceSubscriptions/fragments/subscription-update-sample.jsonld - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-sample.jsonld -${fragment_filename_path}= context-source-registration-update-sample.jsonld - - -*** Test Cases *** -044_01_01_endpoint /entities/{entityId}/attrs/ - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_01_02_endpoint /entities/{entityId}/attrs/{attrId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_01_03_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscription_id} ${filename_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Subscription ${subscription_id} ${fragment_filename_path} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Subscription ${subscription_id} - -044_01_04_endpoint /csourceRegistrations/{registrationId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/fragments/${fragment_filename_path} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Context Source Registration ${registration_id} - -*** comment *** -043_01 Create entity -043_02 Retrieve entity by id -043_03 Partial attribute update - -043_04 Create subscription -043_05 Retrieve subscription by id -043_06 Update subscription - -043_07 Create Temporal Representation of Entities -043_08 Query temporal entities -043_09 Batch entity create -043_10 Create context source registration -043_11 Query context source registration \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_02.robot b/TP/NGSI-LD/CommonBehaviours/044_01_02.robot deleted file mode 100644 index 35dc5c35..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_02.robot +++ /dev/null @@ -1,24 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-simple-attributes-sample.jsonld -${fragment_filename}= vehicle-fragment-brandname-sample.jsonld -${attribute_id}= brandName - -*** Test Cases *** -044_01_02_endpoint /entities/{entityId}/attrs/{attrId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_03.robot b/TP/NGSI-LD/CommonBehaviours/044_01_03.robot deleted file mode 100644 index 1960878b..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_03.robot +++ /dev/null @@ -1,23 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${filename_path}= csourceSubscriptions/subscription-sample.jsonld -${fragment_filename_path}= csourceSubscriptions/fragments/subscription-update-sample.jsonld - -*** Test Cases *** -044_01_03_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscription_id} ${filename_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Subscription ${subscription_id} ${fragment_filename_path} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_04.robot b/TP/NGSI-LD/CommonBehaviours/044_01_04.robot deleted file mode 100644 index 83877508..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_04.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= registration-sample.jsonld -${fragment_filename_path}= context-source-registration-update-sample.jsonld - -*** Test Cases *** -044_01_04_endpoint /csourceRegistrations/{registrationId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/fragments/${fragment_filename_path} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_05.robot b/TP/NGSI-LD/CommonBehaviours/044_01_05.robot deleted file mode 100644 index a2986056..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_05.robot +++ /dev/null @@ -1,25 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json - -*** Test Cases *** -044_01_05_endpoint /csourceSubscriptions/{subscriptionId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - - ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_01_06.robot b/TP/NGSI-LD/CommonBehaviours/044_01_06.robot deleted file mode 100644 index d5249424..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_01_06.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${temporal_entity_filename}= vehicle-temporal-representation-sample.jsonld -${temporal_entity_fragment_file_path}= vehicle-temporal-representation-fragment.jsonld -${attribute_id}= speed - -*** Test Cases *** -044_01_06_endpoint /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory - ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Temporal Representation Of Entity Selecting Content Type ${temporal_entity_id} ${temporal_entity_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_id} ${CONTENT_TYPE_LD_JSON} - ${instance_id}= Set Variable ${response["body"]["speed"][0]["instanceId"]} - - ${response}= Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_id} ${attribute_id} ${instance_id} ${temporal_entity_fragment_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 9a787c2e..df734374 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -6,9 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${building_filename}= building-simple-attributes-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.json ${building_expectation}= building-simple-attributes-sample-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building @@ -16,15 +14,9 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld ${subscription_expectation}= subscription-sample-expectation.json -${types_expectation}= types/expectations/entity-type-list-022-01-01-expectation.json -${type_expectation}= types/expectations/entity-type-info-024-01-expectation.json - -${attributes_expectation}= types/expectations/attribute-list-025-01-01-expectation.json -${attribute_expectation}= types/expectations/attribute-027-01-expectation.json - ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/registration-with-expiration-sample.jsonld -${registration_expectation}= registration-with-expiration-expectation-sample.json +${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +${registration_expectation}= context-source-registration-with-expiration-expectation.json ${registration_type}= Vehicle ${tea_id_prefix}= urn:ngsi-ld:Vehicle: @@ -32,25 +24,8 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld ${tea_expectation}= vehicle-temporal-representation-expectation.json ${teatype}= Vehicle - *** Test Cases *** -044_02_01_endpoint /entities/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/) - ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${id} - ${entities_ids_to_be_retrieved}= Set Variable ${id} - - @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${building_expectation} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entity by Id Returning Response ${id} - -044_02_02_endpoint /entities/{entityId} +044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) ${id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} @@ -59,23 +34,12 @@ ${teatype}= Vehicle ${request} ${response}= Query Entity ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* [Teardown] Delete Entity by Id Returning Response ${id} + -044_02_03_endpoint /subscriptions/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Query Subscriptions - Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - - [Teardown] Delete Subscription ${id} - -044_02_04_endpoint /subscriptions/{subscriptionId} +044_02_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -85,70 +49,11 @@ ${teatype}= Vehicle ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* [Teardown] Delete Subscription ${id} -044_02_05_endpoint /types/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/types/) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - - Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${vehicle_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - - Retrieve Entity Types context=${EMPTY} accept=${EMPTY} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTypeList element ${types_expectation} - - [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True - -044_02_06_endpoint /types/{type} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/types/{type}) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - - Retrieve Entity Type type=Building context=${EMPTY} accept=${EMPTY} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTypeInfo element ${type_expectation} - - [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True - -044_02_07_endpoint /attributes/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/attributes/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Retrieve Attributes context=${EMPTY} accept=${EMPTY} - Check Response Status Code Set To 200 - Check Response Body Containing AttributeList element ${attributes_expectation} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_02_08_endpoint /attributes/{attrId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/attributes/{attrId}) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} accept=${EMPTY} - Check Response Status Code Set To 200 - Check Response Body Containing Attribute element ${attribute_expectation} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_02_09_endpoint /csourceRegistrations/ +044_02_03_endpoint /csourceRegistrations/ [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) ${registration_id}= Generate Random Entity Id ${registration_id_prefix} @@ -157,73 +62,23 @@ ${teatype}= Vehicle ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - Query Context Source Registrations id=${registration_id} type=${registration_type} - Check Response Status Code Set To 200 - Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - - [Teardown] Delete Context Source Registration ${registration_id} - -044_02_10_endpoint /csourceRegistrations/{registrationId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/{registrationId}) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - Retrieve Context Source Registration ${registration_id} - Check Response Status Code Set To 200 + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} + Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} + Check Request Containing Accept Header Set To ${request} application/json, */* [Teardown] Delete Context Source Registration ${registration_id} -044_02_11_endpoint /csourceSubscriptions/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceSubscriptions/) - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Query Context Source Registration Subscriptions - Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_expectation} ${subscription_id} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} - -044_02_12_endpoint /csourceSubscriptions/{subscriptionId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceSubscriptions/{subscriptionId}) - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Retrieve Context Source Registration Subscription ${subscription_id} - Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_expectation} ${subscription_id} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} - -044_02_13_endpoint /temporal/entities +044_02_04_endpoint /temporal/entities [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - Query Temporal Representation Of Entities entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - -044_02_14_endpoint /temporal/entities/{entityId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities/{entityId}) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - Check Response Status Code Set To 200 + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z + Check Response Status Code 200 ${response['status']} + Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} + Check Request Containing Accept Header Set To ${request} application/json, */* - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_02b.robot b/TP/NGSI-LD/CommonBehaviours/044_02b.robot deleted file mode 100644 index 07b009a5..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_02b.robot +++ /dev/null @@ -1,84 +0,0 @@ -*** Settings *** -Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${building_expectation}= building-simple-attributes-sample-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_expectation}= subscription-sample-expectation.json - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/registration-with-expiration-sample.jsonld -${registration_expectation}= registration-with-expiration-expectation-sample.json -${registration_type}= Vehicle - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_expectation}= vehicle-temporal-representation-expectation.json -${teatype}= Vehicle - -*** Test Cases *** -044_02_01_endpoint /entities/{entityId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) - ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Entity ${id} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* - - [Teardown] Delete Entity by Id Returning Response ${id} - - -044_02_02_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Retrieve Subscription ${id} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* - - [Teardown] Delete Subscription ${id} - -044_02_03_endpoint /csourceRegistrations/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* - - [Teardown] Delete Context Source Registration ${registration_id} - -044_02_04_endpoint /temporal/entities - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z - Check Response Status Code 200 ${response['status']} - Set Test Variable ${response} - Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Request Containing Accept Header Set To ${request} application/json, */* - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index 02bdff5f..bf43562b 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -6,43 +6,22 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.json ${vehicle_attribute}= speed -${vehicle_fragment}= vehicle-fragment-empty-datasetid-sample.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.jsonld ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/registration-sample.jsonld -${registration_fragment}= csourceRegistrations/registration-with-expiration-sample.jsonld - ${tea_id_prefix}= urn:ngsi-ld:Vehicle: ${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_fragment}= vehicle-temporal-intanceid-update-sample.jsonld -${tea_attribute}= speed -${tea_first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${tea_second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** -044_03_01_endpoint patch /entities/{entityId}/attrs/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Entity Attributes ${entity_id} ${vehicle_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_03_02_endpoint patch /entities/{entityId}/attrs/{attrId} +044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -54,7 +33,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Teardown] Delete Entity by Id Returning Response ${entity_id} -044_03_03_endpoint patch /subscriptions/{subscriptionId} +044_03_02_endpoint patch /subscriptions/{subscriptionId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -66,52 +45,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Teardown] Delete Subscription ${id} -044_03_04_endpoint patch /csourceRegistrations/{registrationId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /csourceRegistrations/{registrationId}) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Context Source Registration With Return ${registration_id} ${registration_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Context Source Registration ${registration_id} - -044_03_05_endpoint patch /csourceSubscriptions/{subscriptionId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /csourceSubscriptions/{subscriptionId}) - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - ${subscription_update_fragment}= Load Test Sample ${subscription_fragment} - ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} - - -044_03_06_endpoint patch /temporal/entities/{entityId}/attrs/{attrId}/{instanceId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /temporal/entities/{entityId}/attrs/{attrId}/{instanceId}) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs - ${instanceId}= Set Variable ${response['body']['https://ngsi-ld-test-suite/context#speed'][0]['instanceId']} - - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${tea_attribute} ${instanceId} ${tea_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - - -044_03_07_endpoint post /entities/ +044_03_03_endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) ${entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -120,19 +54,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Teardown] Delete Entity by Id ${entity_id} -044_03_08_endpoint post /entities/{entityId}/attrs/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/{entityId}/attrs/) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Entity Attributes ${entity_id} ${vehicle_fragment} ${EMPTY} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_03_09_endpoint post /subscriptions/ +044_03_04_endpoint post /subscriptions/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -141,29 +63,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Teardown] Delete Subscription ${subscriptions_id} -044_03_10_endpoint post /csourceRegistrations/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /csourceRegistrations/) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} content_type=${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Context Source Registration ${registration_id} - -044_03_11_endpoint post /csourceSubscriptions/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /csourceSubscriptions/) - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - ${request} ${response}= Create Context Source Registration Subscription With Return ${subscription_payload} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} - -044_03_12_endpoint post /entityOperations/create +044_03_05_endpoint post /entityOperations/create [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) @@ -180,90 +80,11 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_03_13_endpoint post /entityOperations/upsert - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/upsert) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - - Batch Upsert Entities By Selecting Content Type @{entities_to_be_upserted} ${EMPTY} - Check Response Status Code Set To 415 - - [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_03_14_endpoint post /entityOperations/update - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/update) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} - - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - - Batch Update Entities @{entities_to_be_updated} ${EMPTY} - Check Response Status Code Set To 415 - - [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True - - -044_03_15_endpoint post /entityOperations/delete - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/delete) - - ${first_entity_id}= Generate Random Entity Id ${id_prefix} - ${second_entity_id}= Generate Random Entity Id ${id_prefix} - Create Entity ${building_filename} ${first_entity_id} - Create Entity ${building_filename} ${second_entity_id} - - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities By Selecting Content Type @{entities_ids_to_be_deleted} ${EMPTY} - Check Response Status Code Set To 415 - -044_03_16_endpoint post /entityOperations/query - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/query) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Query Entity ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} content_type=${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True - -044_03_17_endpoint post /temporal/entities/ +044_03_06_endpoint post /temporal/entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} Check Response Status Code 415 ${response['status']} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - -044_03_18_endpoint post /temporal/entityOperations/query - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entityOperations/query) - - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${tea_second_vehicle_payload_file} ${second_temporal_entity_representation_id} - @{temporal_entity_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - - Query Temporal Representation Of Entities Via Post entity-operations-after-query.jsonld ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Several Temporal Representations Of Entities @{temporal_entity_representation_ids} \ No newline at end of file + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_03b.robot b/TP/NGSI-LD/CommonBehaviours/044_03b.robot deleted file mode 100644 index 79c9916e..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_03b.robot +++ /dev/null @@ -1,92 +0,0 @@ -*** Settings *** -Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld -${vehicle_attribute}= speed -${vehicle_fragment}= vehicle-fragment-empty-datasetid-sample.jsonld - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld - - -*** Test Cases *** -044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_03_02_endpoint patch /subscriptions/{subscriptionId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Subscription ${id} ${subscription_fragment} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Subscription ${id} - - -044_03_03_endpoint post /entities/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_03_04_endpoint post /subscriptions/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) - - ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Subscription ${subscriptions_id} - -044_03_05_endpoint post /entityOperations/create - - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${EMPTY} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 415 - - [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_03_06_endpoint post /temporal/entities/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index b4239d0d..29d07ad6 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -10,42 +10,12 @@ ${status_code}= 406 ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/registration-sample.jsonld - -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld -${vehicle_attribute}= speed - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld - *** Test Cases *** -044_04_01_endpoint get /entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True - - -044_04_02_endpoint get /entities/{entityId} +044_04_01_endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) ${entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -57,19 +27,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld [Teardown] Delete Entity by Id Returning Response ${entity_id} -044_04_03_endpoint get /subscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Query Subscriptions accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${id} - -044_04_04_endpoint get /subscriptions/{subscriptionId} +044_04_02_endpoint get /subscriptions/{subscriptionId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -81,104 +39,20 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld [Teardown] Delete Subscription ${id} -044_04_05_endpoint get /types/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /types/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Retrieve Entity Types With Return ${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_04_06_endpoint get /types/{type} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /types/{type}) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Retrieve Entity Type With Return ${entity_type} ${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_04_07_endpoint get /attributes/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /attributes/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - ${response}= Retrieve Attributes With Return ${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_04_08_endpoint get /attributes/{attrId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /attributes/{attrId}) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - ${response}= Retrieve Attribute With Return airQualityLevel ${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_04_09_endpoint get /csourceRegistrations/ +044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) Query Context Source Registrations type=Building accept=${accept} Check Response Status Code Set To ${status_code} - -044_04_10_endpoint get /csourceRegistrations/{registrationId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/{registrationId}) - - ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${registration_filename} ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} - - - Retrieve Context Source Registration ${context_source_registration_id} accept=${accept} - Check Response Status Code Set To ${status_code} - - [Teardown] Delete Context Source Registration ${context_source_registration_id} - - -044_04_11_endpoint get /csourceSubscriptions/ +044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code Set To ${status_code} -044_04_12_endpoint get /csourceSubscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/{subscriptionId}) - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Retrieve Context Source Registration Subscription ${subscription_id} accept=${accept} - Check Response Status Code Set To ${status_code} - - [Teardown] Delete Context Source Registration Subscription ${subscription_id} - -044_04_13_endpoint get /temporal/entities +044_04_05_endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} - Check Response Status Code Set To ${status_code} - -044_04_14_endpoint get /temporal/entities/{entityId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities/{entityId}) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} accept=${accept} - Check Response Status Code Set To ${status_code} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + Check Response Status Code Set To ${status_code} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_04b.robot b/TP/NGSI-LD/CommonBehaviours/044_04b.robot deleted file mode 100644 index a80de3b3..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_04b.robot +++ /dev/null @@ -1,61 +0,0 @@ -*** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${accept}= application/xml -${status_code}= 406 - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Cases *** -044_04_01_endpoint get /entities/{entityId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Entity ${entity_id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_04_02_endpoint get /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${id} - -044_04_03_endpoint get /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - - Query Context Source Registrations type=Building accept=${accept} - Check Response Status Code Set To ${status_code} - -044_04_04_endpoint get /csourceSubscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) - - Query Context Source Registration Subscriptions accept=${accept} - Check Response Status Code Set To ${status_code} - -044_04_05_endpoint get /temporal/entities - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - - @{entity_types_to_be_retrieved}= Create List Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} - Check Response Status Code Set To ${status_code} - diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index de22aa7c..ff5b8b74 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -17,100 +17,91 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= registration-sample.jsonld -${registration_fragment}= registration-with-expiration-sample.jsonld +${registration_filename}= context-source-registration-with-expiration-sample.jsonld +${registration_fragment}= context-source-registration-with-expiration-expectation.json ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-datasetid-attributes-sample.jsonld -${vehicle_attribute}= speed +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_attribute}= brandName +${vehicle_fragment}= vehicle-brandname-fragment.jsonld ${tea_id_prefix}= urn:ngsi-ld:Vehicle: ${tea_filename}= vehicle-temporal-representation-sample.jsonld -*** comment *** -044_05_01_endpoint /subscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/subscriptions/) +*** Test Cases *** +044_05_01_endpoint create /entities/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Subscription ${id} + [Teardown] Delete Entity by Id ${entity_id} -044_05_02_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/subscriptions/{subscriptionId}) +044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - - ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Retrieve Entity by Id ${entity_id} + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Subscription ${id} + [Teardown] Delete Entity by Id Returning Response ${entity_id} -#044_05_03_endpoint /types/ -# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/types/) +044_05_03_endpoint create /subscriptions/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) -#044_05_04_endpoint /types/{type} -# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/types/{type}) - -#044_05_05_endpoint /attributes/ -# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/attributes/) + ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Subscription ${subscriptions_id} -#044_05_06_endpoint /attributes/{attrId} -# [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/attributes/{attrId}) +044_05_04_endpoint update /subscriptions/{subscriptionId} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) -044_05_07_endpoint /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceRegistrations/) + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} + ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Context Source Registration ${registration_id} - - - -044_05_08_endpoint /csourceRegistrations/{registrationId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceRegistrations/{registrationId}) + [Teardown] Delete Subscription ${id} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} +044_05_05_endpoint create /temporal/entities/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_fragment} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Context Source Registration ${registration_id} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} +044_05_06_endpoint create /entityOperations/create + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) -044_05_09_endpoint /csourceSubscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceSubscriptions/) + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} accept=${accept} - Check Response Status Code Set To ${status_code} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} accept=${accept} - [Teardown] Delete Context Source Registration Subscription ${subscription_id} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To ${status_code} -*** Test Cases *** -044_05_10_endpoint /csourceSubscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (/csourceSubscriptions/{subscriptionId}) + [Teardown] Batch Delete Entities @{expected_entities_ids} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_filename} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} +044_05_07_endpoint create /csourceRegistrations/ + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) - ${subscription_update_fragment}= Load Test Sample ${subscription_fragment} - ${response}= Update Context Source Registration Subscription By Selecting Content Type ${subscription_id} ${subscription_update_fragment} ${CONTENT_TYPE_LD_JSON} #accept=${accept} + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Context Source Registration Subscription ${subscription_id} \ No newline at end of file + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_05b.robot b/TP/NGSI-LD/CommonBehaviours/044_05b.robot deleted file mode 100644 index f6d40827..00000000 --- a/TP/NGSI-LD/CommonBehaviours/044_05b.robot +++ /dev/null @@ -1,107 +0,0 @@ -*** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${accept}= application/geo+json -${status_code}= 406 - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= registration-sample.jsonld -${registration_fragment}= registration-with-expiration-sample.jsonld - -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= brandName -${vehicle_fragment}= vehicle-fragment-brandname-sample.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld - -*** Test Cases *** -044_05_01_endpoint create /entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Entity by Id ${entity_id} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_05_03_endpoint create /subscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) - - ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${subscriptions_id} - -044_05_04_endpoint update /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - - ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${id} - -044_05_05_endpoint create /temporal/entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - -044_05_06_endpoint create /entityOperations/create - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} accept=${accept} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To ${status_code} - - [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_05_07_endpoint create /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json b/data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json similarity index 100% rename from data/csourceRegistrations/expectations/registration-with-expiration-expectation-sample.json rename to data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json diff --git a/data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld similarity index 100% rename from data/entities/fragmentEntities/vehicle-fragment-brandname-sample.jsonld rename to data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld -- GitLab From 3186b1fb11eb73a74bad7e4c9f841dd44bd416ec Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 16 Mar 2021 16:48:29 +0000 Subject: [PATCH 140/442] fixed more merge conflicts --- .../ContextInformation/Consumption/Entity/018_01_02.robot | 5 ----- .../ContextInformation/Consumption/Entity/018_03_02.robot | 5 ----- .../ContextInformation/Consumption/Entity/019_01_02.robot | 4 ---- 3 files changed, 14 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index 45cc30b0..d539dc71 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -20,13 +20,8 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} -<<<<<<< HEAD - ${attributes_to_be_retrieved}= Create List ${attribute_airqualitylevel} ${attribute_subcategory} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} -======= ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} ->>>>>>> develop Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index bf7c433d..df7d0e2b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -18,13 +18,8 @@ Get an entity if an attribute is not known to the system ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} -<<<<<<< HEAD - ${attributes_to_be_retrieved}= Create List ${attribute_not_known} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} -======= ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} ->>>>>>> develop Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot index 2664ed4c..52cfd88a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot @@ -11,11 +11,7 @@ ${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${parking_filename}= parking-simple-attributes-sample.jsonld -<<<<<<< HEAD -${expectation_filename}= vehicle-parking-sample-expectation.json -======= ${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ->>>>>>> develop ${building_entity_type}= https://ngsi-ld-test-suite/context#Building ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking -- GitLab From e0901ca07bc1540489d69f841e309ed777b42616 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 09:54:22 +0100 Subject: [PATCH 141/442] feat: add missing tc for query context source registrations --- .../037_10.robot | 52 +++++++++++++++++ ...e-registrations-037-10-01-expectation.json | 37 ++++++++++++ ...e-registrations-037-10-02-expectation.json | 23 ++++++++ ...e-registrations-037-10-03-expectation.json | 58 +++++++++++++++++++ resources/ApiUtils.resource | 3 +- 5 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json create mode 100644 data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot new file mode 100644 index 00000000..94076c1f --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration With Query Params +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations + +*** Variable *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld + +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of Entity Ids id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} +With NGSI-LD Query q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} +With Context Source Filter csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + +*** Keywords *** +Query Context Source Registration With Query Params + [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties + [Tags] mandatory + + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + +Setup Initial Context Source Registrations + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Create Context Source Registration ${third_context_source_registration_payload} + + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + Set Suite Variable ${third_context_source_registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration ${third_context_source_registration_id} diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json new file mode 100644 index 00000000..25b886f0 --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json @@ -0,0 +1,37 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + }, + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"GeoProperty", + "value":{ + "type":"Point", + "coordinates":[-8.521,41.2] + } + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json new file mode 100644 index 00000000..c462e3a6 --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json @@ -0,0 +1,23 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"GeoProperty", + "value":{ + "type":"Point", + "coordinates":[-8.521,41.2] + } + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json b/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json new file mode 100644 index 00000000..0d7f5b3c --- /dev/null +++ b/data/csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json @@ -0,0 +1,58 @@ +[ + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "endpoint":"http://my.csource.org:1026" + }, + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ], + "propertyNames":[ + "name", + "subCategory" + ], + "relationshipNames":[ + "locatedAt" + ] + } + ], + "endpoint":"http://my.csource.org:1026" + }, + { + "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type":"ContextSourceRegistration", + "information":[ + { + "entities":[ + { + "type":"Building" + } + ] + } + ], + "location":{ + "type":"GeoProperty", + "value":{ + "type":"Point", + "coordinates":[-8.521,41.2] + } + }, + "endpoint":"http://my.csource.org:1026" + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index b1243bca..28af5b77 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -547,7 +547,7 @@ Update Context Source Registration Set Test Variable ${response} Query Context Source Registrations - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -557,6 +557,7 @@ Query Context Source Registrations Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} + Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} -- GitLab From b232736f65f5df2d4436ce355b6db4945b0e74eb Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 13:32:51 +0100 Subject: [PATCH 142/442] feat: implement test cases for update subscription --- .../UpdateSubscription/029_01.robot | 26 ++++++++++++ .../UpdateSubscription/029_02.robot | 19 +++++++++ .../UpdateSubscription/029_03.robot | 35 ++++++++++++++++ .../UpdateSubscription/029_04.robot | 35 ++++++++++++++++ .../UpdateSubscription/029_05.robot | 41 +++++++++++++++++++ .../UpdateSubscription/029_06.robot | 41 +++++++++++++++++++ .../UpdateSubscription/029_07.robot | 39 ++++++++++++++++++ .../UpdateSubscription/029_08.robot | 41 +++++++++++++++++++ .../UpdateSubscription/029_09.robot | 35 ++++++++++++++++ .../UpdateSubscription/029_10.robot | 38 +++++++++++++++++ .../UpdateSubscription/029_11.robot | 35 ++++++++++++++++ ...ption-vehicle-expanded-types-sample.jsonld | 19 +++++++++ .../subscription-vehicle-sample.jsonld | 19 +++++++++ ...subscription-building-entities-sample.json | 7 ++++ ...iption-expiresAt-future-update-sample.json | 3 ++ .../subscription-expiresAt-update-sample.json | 3 ++ .../subscription-invalid-update-sample.json | 5 +++ ...isActive-expiresAt-null-update-sample.json | 4 ++ ...tion-isActive-expiresAt-update-sample.json | 4 ++ ...ive-null-expiresAt-null-update-sample.json | 4 ++ ...isActive-null-expiresAt-update-sample.json | 4 ++ ...scription-isActive-null-update-sample.json | 3 ++ .../subscription-isActive-update-sample.json | 3 ++ ...ription-null-properties-update-sample.json | 6 +++ .../fragments/subscription-update-sample.json | 9 ++++ .../subscription-vehicle-entities-sample.json | 7 ++++ .../subscription-inactive-sample.jsonld | 20 +++++++++ data/subscriptions/subscription-sample.jsonld | 19 +++++++++ resources/ApiUtils.resource | 25 +++++++---- resources/AssertionUtils.resource | 1 + 30 files changed, 541 insertions(+), 9 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot create mode 100644 data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld create mode 100644 data/subscriptions/expected/subscription-vehicle-sample.jsonld create mode 100644 data/subscriptions/fragments/subscription-building-entities-sample.json create mode 100644 data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-expiresAt-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-invalid-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-null-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-isActive-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-null-properties-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-update-sample.json create mode 100644 data/subscriptions/fragments/subscription-vehicle-entities-sample.json create mode 100644 data/subscriptions/subscription-inactive-sample.jsonld create mode 100644 data/subscriptions/subscription-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot new file mode 100644 index 00000000..679523a4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Subscription With Non present Or Invalid Id + +*** Test Cases *** id +NotPresentId ${EMPTY} +InvalidId InvalidUri + +*** Variable *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + +*** Keywords *** +Update Subscription With Non present Or Invalid Id + [Arguments] ${id} + [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Tags] mandatory + + Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot new file mode 100644 index 00000000..3c64d310 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + +*** Test Case *** +Update Unknown Subscription + [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised + [Tags] mandatory + + Update Subscription unknownSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot new file mode 100644 index 00000000..9a787102 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json + +*** Test Case *** +Update Subscription With Invalid Fragment + [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot new file mode 100644 index 00000000..e22a5f35 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json + +*** Test Case *** +Update Subscription With Null Mandatory Properties + [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot new file mode 100644 index 00000000..60aca577 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json +${expected_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-sample.jsonld +${expected_expanded_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld + +*** Test Case *** +Update Subscription With Term to Uri Expansion + [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 204 + + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Body Containing Subscription element ${expected_subscription_payload_file_path} ${subscription_id} + + Retrieve Subscription ${subscription_id} + Check Response Body Containing Subscription element ${expected_expanded_subscription_payload_file_path} ${subscription_id} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot new file mode 100644 index 00000000..606931b9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can update a subcription: The implementation shall modify the target Subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + +*** Test Case *** +Update Subscription + [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 204 + + ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} + ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${subscription} ${ignored_attributes} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + Set Suite Variable ${subscription_payload} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot new file mode 100644 index 00000000..bfbb5d6d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Activate Paused Subscription With isActive Member +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH +ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json +ActiveNull subscriptions/fragments/subscription-isActive-null-update-sample.json + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + +*** Keywords *** +Activate Paused Subscription With isActive Member + [Arguments] ${subscription_update_fragment_file_path} + [Documentation] Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active + +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot new file mode 100644 index 00000000..2472613f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Activate Paused Subscription With isActive And ExpiresAt Members +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH +ActiveTrueExpiresAtNull subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json +ActiveTrueExpiresAt subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json +ActiveNullExpiresAtNull subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json +ActiveNullExpiresAt subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + +*** Keywords *** +Activate Paused Subscription With isActive And ExpiresAt Members + [Arguments] ${subscription_update_fragment_file_path} + [Documentation] Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active + +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot new file mode 100644 index 00000000..b414200e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-update-sample.json + +*** Test Case *** +Update Subscription Status To Paused + [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status paused + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot new file mode 100644 index 00000000..6cdf122f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json + +*** Test Case *** +Activate Expired Subscription + [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" + [Tags] mandatory + + # Update subscription to expired + Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot new file mode 100644 index 00000000..4c38313d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json + +*** Test Case *** +Update Subscription With ExpiresAt In The Past + [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised + [Tags] mandatory + + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld new file mode 100644 index 00000000..5cb80bfe --- /dev/null +++ b/data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld @@ -0,0 +1,19 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"https://ngsi-ld-test-suite/context#Vehicle" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/expected/subscription-vehicle-sample.jsonld b/data/subscriptions/expected/subscription-vehicle-sample.jsonld new file mode 100644 index 00000000..ae7a20da --- /dev/null +++ b/data/subscriptions/expected/subscription-vehicle-sample.jsonld @@ -0,0 +1,19 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Vehicle" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-building-entities-sample.json b/data/subscriptions/fragments/subscription-building-entities-sample.json new file mode 100644 index 00000000..57564a2b --- /dev/null +++ b/data/subscriptions/fragments/subscription-building-entities-sample.json @@ -0,0 +1,7 @@ +{ + "entities":[ + { + "type":"Building" + } + ] +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json new file mode 100644 index 00000000..e4f92ec3 --- /dev/null +++ b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json @@ -0,0 +1,3 @@ +{ + "expiresAt": "2030-08-01T22:07:00Z" +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json new file mode 100644 index 00000000..237d2180 --- /dev/null +++ b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json @@ -0,0 +1,3 @@ +{ + "expiresAt": "2020-08-01T22:07:00Z" +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-invalid-update-sample.json b/data/subscriptions/fragments/subscription-invalid-update-sample.json new file mode 100644 index 00000000..e82d4022 --- /dev/null +++ b/data/subscriptions/fragments/subscription-invalid-update-sample.json @@ -0,0 +1,5 @@ +{ + "notification":{ + "format":"keyValues" + } +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json new file mode 100644 index 00000000..5cc9b6ab --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json @@ -0,0 +1,4 @@ +{ + "isActive": true, + "expiresAt": null +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json new file mode 100644 index 00000000..f72957cd --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json @@ -0,0 +1,4 @@ +{ + "isActive": true, + "expiresAt": "2030-08-01T22:07:00Z" +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json new file mode 100644 index 00000000..1ec15711 --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json @@ -0,0 +1,4 @@ +{ + "isActive": null, + "expiresAt": null +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json new file mode 100644 index 00000000..1780d379 --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json @@ -0,0 +1,4 @@ +{ + "isActive": null, + "expiresAt": "2030-08-01T22:07:00Z" +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-update-sample.json new file mode 100644 index 00000000..fe8bb4e2 --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-null-update-sample.json @@ -0,0 +1,3 @@ +{ + "isActive": null +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-update-sample.json b/data/subscriptions/fragments/subscription-isActive-update-sample.json new file mode 100644 index 00000000..b432cbae --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-update-sample.json @@ -0,0 +1,3 @@ +{ + "isActive": false +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-null-properties-update-sample.json b/data/subscriptions/fragments/subscription-null-properties-update-sample.json new file mode 100644 index 00000000..f044a4da --- /dev/null +++ b/data/subscriptions/fragments/subscription-null-properties-update-sample.json @@ -0,0 +1,6 @@ +{ + "notification":{ + "format":"keyValues", + "endpoint":null + } +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-update-sample.json b/data/subscriptions/fragments/subscription-update-sample.json new file mode 100644 index 00000000..81f39078 --- /dev/null +++ b/data/subscriptions/fragments/subscription-update-sample.json @@ -0,0 +1,9 @@ +{ + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.second.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-vehicle-entities-sample.json b/data/subscriptions/fragments/subscription-vehicle-entities-sample.json new file mode 100644 index 00000000..ff01dca7 --- /dev/null +++ b/data/subscriptions/fragments/subscription-vehicle-entities-sample.json @@ -0,0 +1,7 @@ +{ + "entities":[ + { + "type":"Vehicle" + } + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-inactive-sample.jsonld b/data/subscriptions/subscription-inactive-sample.jsonld new file mode 100644 index 00000000..a00ea736 --- /dev/null +++ b/data/subscriptions/subscription-inactive-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": false, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld new file mode 100644 index 00000000..fd713519 --- /dev/null +++ b/data/subscriptions/subscription-sample.jsonld @@ -0,0 +1,19 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 28af5b77..c7156c82 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -26,11 +26,11 @@ ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json ${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json -${ERROR_TYPE_BAD_REQUEST_DATA} http://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} http://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} http://uri.etsi.org/ngsi-ld/errors/AlreadyExists -${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} http://uri.etsi.org/ngsi-ld/errors/LDContextNotAvailable +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LDContextNotAvailable ${response} @@ -661,9 +661,10 @@ Update Context Source Registration Subscription From File Set Test Variable ${response} Create Subscription - [Arguments] ${subscription_id} ${filename_path} ${content_type} ${accept}=${EMPTY} + [Arguments] ${subscription_id} ${filename_path} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} @@ -672,13 +673,15 @@ Create Subscription [return] ${response} Update Subscription - [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} + [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response + Set Test Variable ${response} [return] ${response} Delete Subscription @@ -686,6 +689,7 @@ Delete Subscription ${response}= DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} Output request Output response + Set Suite Variable ${response} [return] ${response} Query Subscriptions @@ -701,13 +705,16 @@ Query Subscriptions [return] ${response} Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} + [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} ${request}= Output request Output response + Set Test Variable ${response} [return] ${request} ${response} Update Context Source Registration Subscription By Selecting Content Type @@ -842,4 +849,4 @@ Query Temporal Representation Of Entities With Return ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} ${request}= Output request Output response - [return] ${request} ${response} \ No newline at end of file + [return] ${request} ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 0fc84a3f..db22588f 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -305,6 +305,7 @@ Check Response Body Containing One Registration element ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${registration} ${instance_id_regex_expr} Should Be True ${comparison_result} msg=Entity Comparison Failed + Check Resource Set To [Arguments] ${resource} ${ignored_keys}=${None} ${error_message}=${EMPTY} -- GitLab From 77d76f36f04eb481d5602bf7cd5bb01ede56f972 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 13:37:22 +0100 Subject: [PATCH 143/442] feat: implement test cases for retrieve subscription --- .../RetrieveSubscription/030_01.robot | 22 +++++++++++++ .../RetrieveSubscription/030_02.robot | 15 +++++++++ .../RetrieveSubscription/030_03.robot | 33 +++++++++++++++++++ resources/ApiUtils.resource | 2 +- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot new file mode 100644 index 00000000..d039eb9f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Retrieve Subscription With Non present Or Invalid Id + +*** Test Cases *** id +NotPresentId ${EMPTY} +InvalidId InvalidUri + +*** Keywords *** +Retrieve Subscription With Non present Or Invalid Id + [Arguments] ${id} + [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Tags] mandatory + + Retrieve Subscription ${id} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot new file mode 100644 index 00000000..bca57022 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -0,0 +1,15 @@ +*** Settings *** +Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +*** Test Case *** +Retrieve Unknown Subscription + [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised + [Tags] mandatory + + Retrieve Subscription unknownSubscription + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot new file mode 100644 index 00000000..1cfdfa2d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you can retrieve a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Case *** +Retrieve Subscription + [Documentation] Check that you can retrieve a subscription + [Tags] mandatory + + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index c7156c82..3a024e6e 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -693,7 +693,7 @@ Delete Subscription [return] ${response} Query Subscriptions - [Arguments] ${limit}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${limit}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} -- GitLab From 647e06dac2972c8c5edc67f0a61c00a43d15da1a Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 13:39:54 +0100 Subject: [PATCH 144/442] feat: implement test cases for delete subscription --- .../DeleteSubscription/032_01.robot | 22 ++++++++++++ .../DeleteSubscription/032_02.robot | 15 ++++++++ .../DeleteSubscription/032_03.robot | 34 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot new file mode 100644 index 00000000..3820ebe7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Delete Subscription With Non present Or Invalid Id + +*** Test Cases *** id +NotPresentId ${EMPTY} +InvalidId InvalidUri + +*** Keywords *** +Delete Subscription With Non present Or Invalid Id + [Arguments] ${id} + [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Tags] mandatory + + Delete Subscription ${id} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot new file mode 100644 index 00000000..5600e7a6 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -0,0 +1,15 @@ +*** Settings *** +Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +*** Test Case *** +Delete Unknown Subscription + [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised + [Tags] mandatory + + Delete Subscription unknownSubscription + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot new file mode 100644 index 00000000..2abec456 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you can delete a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Case *** +Delete Subscription + [Documentation] Check that you can delete a subscription + [Tags] mandatory + + Delete Subscription ${subscription_id} + Check Response Status Code Set To 204 + + Retrieve Subscription ${subscription_id} + Check SUT Not Containing Resource + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} -- GitLab From f39fdea22ded28b83e4afeffc5689f5b60a69189 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 13:43:17 +0100 Subject: [PATCH 145/442] feat: add tcs for query subscriptions --- .../QuerySubscriptions/031_01.robot | 45 +++++++++++++++ .../QuerySubscriptions/031_02.robot | 50 ++++++++++++++++ .../subscriptions-031-01-expectation.json | 57 +++++++++++++++++++ ...bscription-watchedAttributes-sample.jsonld | 20 +++++++ resources/ApiUtils.resource | 12 ++-- 5 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot create mode 100644 data/subscriptions/expectations/subscriptions-031-01-expectation.json create mode 100644 data/subscriptions/subscription-watchedAttributes-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot new file mode 100644 index 00000000..4507b2df --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you can query a list of subscriptions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json + +*** Test Case *** +Query Subscriptions + [Documentation] Check that you can query a list of subscriptions + [Tags] mandatory + + Query Subscriptions context=${ngsild_test_suite_context} + + @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} ${third_subscription_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + +*** Keywords *** +Setup Initial Subscriptions + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${first_subscription_id} + Delete Subscription ${second_subscription_id} + Delete Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot new file mode 100644 index 00000000..15078a31 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Subscriptions With Limit And Page Parameters +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} +Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + +*** Keywords *** +Query Subscriptions With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place + [Tags] mandatory + + Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} + +Setup Initial Subscriptions + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${first_subscription_id} + Delete Subscription ${second_subscription_id} + Delete Subscription ${third_subscription_id} diff --git a/data/subscriptions/expectations/subscriptions-031-01-expectation.json b/data/subscriptions/expectations/subscriptions-031-01-expectation.json new file mode 100644 index 00000000..cd952e1f --- /dev/null +++ b/data/subscriptions/expectations/subscriptions-031-01-expectation.json @@ -0,0 +1,57 @@ +[ + { + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "active" + }, + { + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "watchedAttributes":[ + "name", + "subCategory" + ], + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "active" + }, + { + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "paused" + } +] \ No newline at end of file diff --git a/data/subscriptions/subscription-watchedAttributes-sample.jsonld b/data/subscriptions/subscription-watchedAttributes-sample.jsonld new file mode 100644 index 00000000..de343a44 --- /dev/null +++ b/data/subscriptions/subscription-watchedAttributes-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "watchedAttributes": ["name", "subCategory"], + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 3a024e6e..51895df3 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -693,16 +693,20 @@ Delete Subscription [return] ${response} Query Subscriptions - [Arguments] ${limit}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + &{headers}= Create Dictionary &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} + Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response - [return] ${response} + + Set Test Variable ${response} Retrieve Subscription [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} -- GitLab From dc22dea56243f546394d4c6810f04b0172cdd8f0 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 17 Mar 2021 15:22:16 +0100 Subject: [PATCH 146/442] fix: remove duplicate update command in 029_10 --- .../Subscription/UpdateSubscription/029_10.robot | 2 -- 1 file changed, 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 6cdf122f..2cb4a28f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -18,8 +18,6 @@ Activate Expired Subscription [Tags] mandatory # Update subscription to expired - Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 -- GitLab From aa9076d55622636fc31434dfd3f9c5ea2e0190ac Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 17 Mar 2021 18:46:01 +0100 Subject: [PATCH 147/442] fix: return request and response from Query Entity keyword --- .../ContextInformation/Consumption/Entity/018_01_02.robot | 2 +- .../ContextInformation/Consumption/Entity/018_03_02.robot | 2 +- resources/ApiUtils.resource | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot index d539dc71..ea8cacb9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot @@ -21,7 +21,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot index df7d0e2b..8e8567e3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot @@ -19,7 +19,7 @@ Get an entity if an attribute is not known to the system Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} - ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 51895df3..218eaf1e 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -65,7 +65,7 @@ Query Entity ${request}= Output request Output response Set Test Variable ${response} - [return] ${response} + [return] ${request} ${response} Query Entities [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} -- GitLab From 733a2c06f0bdd1c1121204c87642889d623666d2 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 17 Mar 2021 18:47:04 +0100 Subject: [PATCH 148/442] fix: re-add the Update Subscription required in 029_10 --- .../Subscription/UpdateSubscription/029_10.robot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 2cb4a28f..6cdf122f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -18,6 +18,8 @@ Activate Expired Subscription [Tags] mandatory # Update subscription to expired + Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 -- GitLab From c6505e6d331890f4386dcba1318b94468e69a2cc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 18 Mar 2021 15:13:17 +0100 Subject: [PATCH 149/442] fix: duplicate extension in filename in 012_03 --- .../Provision/EntityAttributes/012_03.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot index 53dd1709..7e5d3c11 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot @@ -15,7 +15,7 @@ ${attribute_id}= speed *** Test Cases *** ENTITY_ID FRAGMENT_FILENAME 012_03_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld -012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld.jsonld +012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld 012_03_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-isparked-fragment.jsonld 012_03_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld @@ -39,4 +39,4 @@ Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${not_found_entity_id} \ No newline at end of file + Set Suite Variable ${not_found_entity_id} -- GitLab From bce63fb713844f8c2ea17b0904d39176fd8f4dd1 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 18 Mar 2021 21:57:53 +0000 Subject: [PATCH 150/442] added validations when the state changes --- .../Provision/EntityAttributes/010_01.robot | 24 +++++--- .../Provision/EntityAttributes/011_01.robot | 19 +++--- .../Provision/EntityAttributes/012_01.robot | 14 +++-- .../Provision/EntityAttributes/013_01.robot | 15 +++-- .../Provision/TemporalEntity/007_01.robot | 4 ++ .../Provision/TemporalEntity/008_01.robot | 5 ++ .../Provision/TemporalEntity/009_01.robot | 5 +- .../Provision/TemporalEntity/014_01.robot | 6 ++ .../Provision/TemporalEntity/015_01.robot | 15 +++-- .../Provision/TemporalEntity/017_01.robot | 6 ++ .../033_01_01.robot | 8 ++- .../033_01_02.robot | 8 ++- .../033_01_03.robot | 6 +- .../035_01.robot | 4 ++ .../034_01.robot | 20 ++++--- .../context-source-registration-sample.jsonld | 52 ++++++++++++---- ...registration-with-expiration-sample.jsonld | 4 +- ...-delete-datasetid-speed-expectation.jsonld | 31 ++++++++++ ...le-delete-default-speed-expectation.jsonld | 31 ++++++++++ ...-delete-deleteall-speed-expectation.jsonld | 21 +++++++ ...vehicle-isparked-update-expectation.jsonld | 38 ++++++++++++ ...ehicle-multi-attributes-expectation.jsonld | 38 ++++++++++++ .../vehicle-speed-appended-expectation.jsonld | 44 ++++++++++++++ ...eed-different-datasetid-expectation.jsonld | 33 ++++++++++ ...hicle-update-attributes-expectation.jsonld | 38 ++++++++++++ ...te-datasetid-attributes-expectation.jsonld | 38 ++++++++++++ .../vehicle-update-speed-expectation.jsonld | 38 ++++++++++++ ...cle-speed-two-datasetid-03-fragment.jsonld | 2 +- ...cle-speed-two-datasetid-04-fragment.jsonld | 12 +--- ...ntation-added-attribute-expectation.jsonld | 60 +++++++++++++++++++ ...ete-fuelLevel-datasetid-expectation.jsonld | 37 ++++++++++++ ...tation-delete-fuelLevel-expectation.jsonld | 33 ++++++++++ ...tion-delete-speed-instanceid-sample.jsonld | 38 ++++++++++++ ...ion-deleteall-fuelLevel-expectation.jsonld | 25 ++++++++ ...l-representation-update-expectation.jsonld | 43 +++++++++++++ ...le-temporal-intanceid-update-sample.jsonld | 12 ---- 36 files changed, 747 insertions(+), 80 deletions(-) create mode 100644 data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-isparked-update-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-multi-attributes-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-speed-appended-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-update-attributes-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-update-speed-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld delete mode 100644 data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index 543cae57..e5c0539b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -10,17 +10,17 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** 010_01_01_Append entity attributes - Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld + Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld 010_01_02_Append entity attributes - Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld + Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld 010_01_03_Append entity attributes - Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld + Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld 010_01_04_Append entity attributes - Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} + Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld *** Keywords *** Append Attributes Without Params - [Arguments] ${status_code} ${fragment_filename} + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] /entities/{entityId}/attrs/ 5_6_3 @@ -31,10 +31,15 @@ Append Attributes Without Params ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${entity_expectation_payload} + [Teardown] Delete Entity by Id Returning Response ${entity_id} Append Attributes With Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] /entities/{entityId}/attrs/ 5_6_3 @@ -44,6 +49,11 @@ Append Attributes With Params ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite Check Response Status Code ${status_code} ${response['status']} - Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']} + Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} + + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index b2408731..48b72cf1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -10,15 +10,15 @@ Test Template Update Attributes ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} -011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} -011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld -011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME +011_01_01_Check that you can update existing attributes with no datasetId 204 fragments/vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld +011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld +011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld *** Keywords *** Update Attributes - [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes [Tags] /entities/{entityId}/attrs/ 5_6_2 @@ -28,6 +28,11 @@ Update Attributes ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']} + Run Keyword If "${expectation_response_filename}"!="${EMPTY}" Check Response Body Content ${expectation_response_filename} ${response['body']} + + ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index ae829b00..ac3141f2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -11,13 +11,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-speed-two-datasetid-sample.jsonld ${status_code}= 204 -*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID -012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld *** Keywords *** Update Attributes - [Arguments] ${fragment_filename} ${attribute_id} + [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} [Documentation] Check that you can perform a partial update on an entity attribute [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 @@ -28,4 +28,10 @@ Update Attributes ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${entity_expectation_payload} + + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index d9e1bacd..01970573 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -12,14 +12,14 @@ ${status_code}= 204 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${attribute_id}= speed -*** Test Cases *** DATASETID DELETEALL -013_01_01_delete an attribute with the id ${EMPTY} false -013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false -013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true +*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME +013_01_01_delete an attribute with the id ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld +013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true vehicle-delete-deleteall-speed-expectation.jsonld *** Keywords *** Delete Attributes - [Arguments] ${datasetId} ${deleteAll} + [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} [Documentation] Check that you can delete an attribute from an entity [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 @@ -30,4 +30,9 @@ Delete Attributes ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${entity_expectation_payload} + [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot index 7c05ccbb..9f686e75 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot @@ -23,4 +23,8 @@ Create Temporal Entity ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} Check Response Status Code 201 ${response['status']} + ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} + Set Test Variable ${response} + Check Created Resource Set To ${created_temporal_entity} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot index 68dd8cf8..b88aba37 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld ${update_filename}= vehicle-temporal-representation-update-sample.jsonld +${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld *** Test Cases *** 008_01_Update a temporal representation of an entity with simple temporal properties @@ -21,5 +22,9 @@ ${update_filename}= vehicle-temporal-representation-update-sample.jsonld ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} instanceId + Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot index 2f87e8dd..31e14452 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot @@ -18,4 +18,7 @@ Delete a temporal representation of an entity with simple temporal properties Check Response Status Code 201 ${response['status']} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} - Check Response Status Code 204 ${response['status']} \ No newline at end of file + Check Response Status Code 204 ${response['status']} + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot index 254950a7..46182bcf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld ${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld *** Test Cases *** 014_01_02_Add an attribute to a temporal entity with simple temporal properties @@ -21,4 +22,9 @@ ${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} instanceId + Check Updated Resource Set To ${temporal_entity_expectation_payload} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot index aeb72a1b..f2d47f1e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot @@ -12,14 +12,14 @@ ${filename}= vehicle-temporal-representation-sample.jsonld ${status_code}= 204 ${attribute_id}= fuelLevel -*** Test Cases *** DELETEALL DATASETID -015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} -015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel -015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel +*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE +015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld +015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld *** Keywords *** Delete Attribute From A Temporal Entity - [Arguments] ${deleteAll} ${datasetId} + [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties [Tags] mandatory @@ -30,4 +30,9 @@ Delete Attribute From A Temporal Entity ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} Check Response Status Code ${status_code} ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} instanceId + Check Updated Resource Set To ${temporal_entity_expectation_payload} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot index b6b727c8..2da21039 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld ${attributeId}= speed +${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld *** Test Cases *** 017_01_Delete an attribute instance in temporal representation of an entity @@ -25,4 +26,9 @@ ${attributeId}= speed ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} instanceId + Check Updated Resource Set To ${temporal_entity_expectation_payload} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 897e492e..8b55bf46 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -16,9 +16,13 @@ Create Context Source Registration With Specific Date Expiration Date ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 1d384107..6df8fa4b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -16,9 +16,13 @@ Create Context Source Registration That Never Expires ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 97fe3165..ef0aec23 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -4,7 +4,6 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource - *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: ${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld @@ -18,5 +17,10 @@ Create Context Source Registration Without A Sprecified ID ${request} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} + + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index a5febdfa..fc8f2502 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -13,6 +13,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id [Tags] /csourceRegistrations/{registrationId} 5_9_4 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} @@ -21,3 +22,6 @@ Delete a context source registration by id ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 204 ${response['status']} + + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 76961327..3153c9d0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -9,24 +9,30 @@ Test Template Update Context Source *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -*** Test Case *** FILENAME UPDATE_FILENAME -034_01_01_Update a context source registration by id context-source-registration-simple-sample.jsonld context-source-registration-with-expiration-sample.jsonld -034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld +*** Test Case *** FILENAME UPDATE_FILENAME +034_01_01_Update a context source registration by id context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld +034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld *** Keywords *** Update Context Source [Arguments] ${filename} ${update_filename} [Documentation] Check that you can update a context source registration by id [Tags] /csourceRegistrations/{registrationId} 5_9_3 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${registration_payload} + + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld index 2c8aeeae..4f37b16e 100644 --- a/data/csourceRegistrations/context-source-registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -1,17 +1,43 @@ { - "id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type":"ContextSourceRegistration", - "information":[ - { - "entities":[ - { - "type":"Building" - } - ] - } + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } ], - "endpoint":"http://my.csource.org:1026", - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "endpoint": "http://my.csource.org:1026", + "location": { + "type": "Polygon", + "coordinates": [ + [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], + [100.0, 1.0], [100.0, 0.0]] ] + }, + "timestamp": { + "startAt": "2017-11-29T14:53:15Z" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld index 6e0a40b5..3ec95d3b 100644 --- a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld @@ -35,9 +35,9 @@ [100.0, 1.0], [100.0, 0.0]] ] }, "timestamp": { - "startAt": " 2017-11-29T14:53:15Z" + "startAt": "2017-11-29T14:53:15Z" }, - "expiresAt": " 2025-11-29T14:53:15Z", + "expiresAt": "2025-11-29T14:53:15Z", "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] diff --git a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld new file mode 100644 index 00000000..98f1b652 --- /dev/null +++ b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld @@ -0,0 +1,31 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld new file mode 100644 index 00000000..98f1b652 --- /dev/null +++ b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld @@ -0,0 +1,31 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld new file mode 100644 index 00000000..df8c093f --- /dev/null +++ b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-isparked-update-expectation.jsonld b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld new file mode 100644 index 00000000..18cc1e9f --- /dev/null +++ b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + } + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometer" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld new file mode 100644 index 00000000..08921f20 --- /dev/null +++ b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld new file mode 100644 index 00000000..9732320d --- /dev/null +++ b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld @@ -0,0 +1,44 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "speed": [ + { + "type": "Property", + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometer", + "value": 55 + }, + { + "type": "Property", + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed", + "value": 54.5 + } + ], + "attribute_to_be_added": { + "type": "Property", + "value": 23 + }, + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld new file mode 100644 index 00000000..887175ed --- /dev/null +++ b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld @@ -0,0 +1,33 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "speed": { + "type": "Property", + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2", + "value": 56 + }, + "attribute_to_be_added": { + "type": "Property", + "value": 23 + }, + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld new file mode 100644 index 00000000..7d74f1b8 --- /dev/null +++ b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": [{ + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld new file mode 100644 index 00000000..2c2c11f9 --- /dev/null +++ b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-speed-expectation.jsonld b/data/entities/expectations/vehicle-update-speed-expectation.jsonld new file mode 100644 index 00000000..b44a810c --- /dev/null +++ b/data/entities/expectations/vehicle-update-speed-expectation.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } + }, + "speed": [{ + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometer" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }], + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld index a1cfae90..375db489 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld @@ -16,7 +16,7 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld index 6794ae23..addf83fb 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld @@ -1,16 +1,6 @@ { - "isParked2": { + "speed": { "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:JohnDoe" - }, - "datasetId": "urn:ngsi-ld:Relationship:parked12345" - }, - "speed2": { - "type": "Property", "value": 99, "source": { "type": "Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld new file mode 100644 index 00000000..bac6a5d2 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld @@ -0,0 +1,60 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "added_attribute":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld new file mode 100644 index 00000000..595adf93 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld @@ -0,0 +1,37 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld new file mode 100644 index 00000000..a9184301 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld @@ -0,0 +1,33 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld new file mode 100644 index 00000000..6a3ff6d6 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld @@ -0,0 +1,38 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld new file mode 100644 index 00000000..21f9b9a4 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld @@ -0,0 +1,25 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld new file mode 100644 index 00000000..5fd7bd26 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld @@ -0,0 +1,43 @@ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld b/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld deleted file mode 100644 index d7433ad6..00000000 --- a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-sample.jsonld +++ /dev/null @@ -1,12 +0,0 @@ -{ - "speed":[ - { - "type":"Property", - "value":129, - "observedAt":"2020-09-01T12:03:00Z" - } - ], - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" - ] -} \ No newline at end of file -- GitLab From 1f9fa4a4d969334219b5aeaa4d55381cb4b6cdbf Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 19 Mar 2021 09:48:45 +0100 Subject: [PATCH 151/442] fix: use name prop from specific context in Discovery TCs - mainly because there is no longer a name property in the core context v1.3 --- data/types/expectations/attribute-026-01-01-expectation.json | 2 +- data/types/expectations/attribute-026-01-02-expectation.json | 2 +- .../types/expectations/entity-type-info-024-01-expectation.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/types/expectations/attribute-026-01-01-expectation.json b/data/types/expectations/attribute-026-01-01-expectation.json index 67799b93..19b88b32 100644 --- a/data/types/expectations/attribute-026-01-01-expectation.json +++ b/data/types/expectations/attribute-026-01-01-expectation.json @@ -1,6 +1,6 @@ [ { - "id":"https://uri.etsi.org/ngsi-ld/name", + "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", "attributeCount":1, diff --git a/data/types/expectations/attribute-026-01-02-expectation.json b/data/types/expectations/attribute-026-01-02-expectation.json index 17ba9dba..076b9e4f 100644 --- a/data/types/expectations/attribute-026-01-02-expectation.json +++ b/data/types/expectations/attribute-026-01-02-expectation.json @@ -1,6 +1,6 @@ [ { - "id":"https://uri.etsi.org/ngsi-ld/name", + "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", "attributeCount":1, diff --git a/data/types/expectations/entity-type-info-024-01-expectation.json b/data/types/expectations/entity-type-info-024-01-expectation.json index 3c78c649..4ae0962d 100644 --- a/data/types/expectations/entity-type-info-024-01-expectation.json +++ b/data/types/expectations/entity-type-info-024-01-expectation.json @@ -5,7 +5,7 @@ "entityCount":2, "attributeDetails":[ { - "id":"https://uri.etsi.org/ngsi-ld/name", + "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", "attributeTypes":[ -- GitLab From a5e2d0017127163d9971293ce6c7911c677cbee3 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 19 Mar 2021 10:37:49 +0000 Subject: [PATCH 152/442] added missing test validation --- .../Provision/TemporalEntity/016_01.robot | 8 +++++++- .../Provision/TemporalEntity/016_02.robot | 2 +- .../Provision/TemporalEntity/016_03.robot | 2 +- ...=> vehicle-temporal-instanceid-update-fragment.jsonld} | 0 4 files changed, 9 insertions(+), 3 deletions(-) rename data/temporalEntities/fragments/{vehicle-temporal-intanceid-update-fragment.jsonld => vehicle-temporal-instanceid-update-fragment.jsonld} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot index 53df2e11..9c47b57a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -7,7 +7,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld ${attributeId}= speed *** Test Cases *** @@ -37,4 +38,9 @@ ${attributeId}= speed ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} instanceId + Check Updated Resource Set To ${temporal_entity_expectation_payload} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot index d53614c8..436e9a8a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot @@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld ${status_code}= 400 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot index 8037375f..ccb1005e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot @@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld ${status_code}= 404 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID diff --git a/data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld similarity index 100% rename from data/temporalEntities/fragments/vehicle-temporal-intanceid-update-fragment.jsonld rename to data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld -- GitLab From 16b10d87ea03681219ccfe36e6593484419c68cd Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 19 Mar 2021 14:26:39 +0000 Subject: [PATCH 153/442] added context attribute to ignore list when validating --- .../ContextInformation/Provision/EntityAttributes/010_01.robot | 2 +- .../ContextInformation/Provision/EntityAttributes/011_01.robot | 2 +- .../ContextInformation/Provision/EntityAttributes/012_01.robot | 2 +- .../ContextInformation/Provision/EntityAttributes/013_01.robot | 2 +- .../ContextInformation/Provision/TemporalEntity/008_01.robot | 2 +- .../ContextInformation/Provision/TemporalEntity/014_01.robot | 2 +- .../ContextInformation/Provision/TemporalEntity/015_01.robot | 2 +- .../ContextInformation/Provision/TemporalEntity/016_01.robot | 2 +- .../ContextInformation/Provision/TemporalEntity/017_01.robot | 2 +- .../Registration/UpdateContextSourceRegistration/034_01.robot | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot index e5c0539b..bf47e81f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot @@ -53,7 +53,7 @@ Append Attributes With Params ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} + ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot index 48b72cf1..e9a66102 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot @@ -32,7 +32,7 @@ Update Attributes ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} + ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot index ac3141f2..3d58d8d1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot @@ -30,7 +30,7 @@ Update Attributes ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} + ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${entity_expectation_payload} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot index 01970573..839a04c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot @@ -32,7 +32,7 @@ Delete Attributes ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} + ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot index b88aba37..0afda983 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot @@ -24,7 +24,7 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.jso ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId + ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot index 46182bcf..4faf3c8b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot @@ -24,7 +24,7 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expect ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId + ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot index f2d47f1e..9ab31c23 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot @@ -32,7 +32,7 @@ Delete Attribute From A Temporal Entity ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId + ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot index 9c47b57a..68ceb697 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot @@ -40,7 +40,7 @@ ${attributeId}= speed ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId + ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot index 2da21039..4ddd57c3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot @@ -28,7 +28,7 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId + ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 3153c9d0..59cc7773 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -31,7 +31,7 @@ Update Context Source Check Response Status Code 204 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} + ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${registration_payload} -- GitLab From f9d522d59c1af443c7bad449069618e01726927d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 19 Mar 2021 17:47:37 +0100 Subject: [PATCH 154/442] fix: use 1.3 core context and incorrect JSON vs JSON-LD use in Entities TCs (018 & 019) --- .../Consumption/Entity/018_05.robot | 2 +- .../Consumption/Entity/019_01_01.robot | 5 +++-- .../Consumption/Entity/019_01_03.robot | 2 +- .../Consumption/Entity/019_04.robot | 2 +- .../Consumption/Entity/019_05.robot | 2 +- ...-with-only-properties-information-sample.jsonld | 3 +-- .../fragments/subscription-update-sample.jsonld | 2 +- .../building-attributes-query-expectation.jsonld | 2 +- .../building-geoproperty-query-expectation.jsonld | 4 ++-- .../expectations/building-minimal-expectation.json | 4 ++++ .../building-minimal-expectation.jsonld | 7 ------- .../building-simple-attributes-expectation.jsonld | 4 ++-- ...ding-simple-attributes-query-expectation.jsonld | 2 +- ...ple-attributes-sample-expanded-expectation.json | 2 +- ...lding-simple-attributes-sample-expectation.json | 2 +- ...g-simple-attributes-simplified-expectation.json | 8 ++++++++ ...simple-attributes-simplified-expectation.jsonld | 14 +++++++------- ...pes-vehicle-offstreetparking-expectation.jsonld | 4 ++-- .../vehicle-brandname-fragment.jsonld | 2 +- ...poral-representation-invalid-json-sample.jsonld | 2 +- ...le-temporal-representation-update-sample.jsonld | 2 +- ...emporal-representation-without-id-sample.jsonld | 2 +- 22 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 data/entities/expectations/building-minimal-expectation.json delete mode 100644 data/entities/expectations/building-minimal-expectation.jsonld create mode 100644 data/entities/expectations/building-simple-attributes-simplified-expectation.json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot index faa882c3..c8f6e021 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json ${options_parameter}= keyValues ${accept_header}= application/geo+json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot index da0476b5..ecfc5ef3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** @@ -18,16 +18,17 @@ Query several entities based on ids ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot index 7d616b51..39ea8c61 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot index 514da40c..a33aed3d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json ${options_parameter}= keyValues ${entity_type}= https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot index a48764cb..848bf7d7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${accept_header}= application/geo+json diff --git a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld index 71583c35..302815d0 100644 --- a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld @@ -8,7 +8,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld b/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld index f721ed26..1ede2610 100644 --- a/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld +++ b/data/csourceSubscriptions/fragments/subscription-update-sample.jsonld @@ -6,5 +6,5 @@ "accept":"application/json" } }, - "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" } \ No newline at end of file diff --git a/data/entities/expectations/building-attributes-query-expectation.jsonld b/data/entities/expectations/building-attributes-query-expectation.jsonld index 77216ca0..a15e428c 100644 --- a/data/entities/expectations/building-attributes-query-expectation.jsonld +++ b/data/entities/expectations/building-attributes-query-expectation.jsonld @@ -13,6 +13,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-geoproperty-query-expectation.jsonld b/data/entities/expectations/building-geoproperty-query-expectation.jsonld index dae72da2..e5b32cf9 100644 --- a/data/entities/expectations/building-geoproperty-query-expectation.jsonld +++ b/data/entities/expectations/building-geoproperty-query-expectation.jsonld @@ -11,7 +11,7 @@ ] } }, - "name": { + "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Eiffel Tower" }, @@ -20,6 +20,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-expectation.json b/data/entities/expectations/building-minimal-expectation.json new file mode 100644 index 00000000..0c1b9efb --- /dev/null +++ b/data/entities/expectations/building-minimal-expectation.json @@ -0,0 +1,4 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Building" +} \ No newline at end of file diff --git a/data/entities/expectations/building-minimal-expectation.jsonld b/data/entities/expectations/building-minimal-expectation.jsonld deleted file mode 100644 index 2fe6f024..00000000 --- a/data/entities/expectations/building-minimal-expectation.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Building", - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-expectation.jsonld b/data/entities/expectations/building-simple-attributes-expectation.jsonld index 3a632ab1..fcf71cdd 100644 --- a/data/entities/expectations/building-simple-attributes-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-expectation.jsonld @@ -1,7 +1,7 @@ { "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", - "name": { + "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Eiffel Tower" }, @@ -20,6 +20,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-query-expectation.jsonld b/data/entities/expectations/building-simple-attributes-query-expectation.jsonld index 6f8083d0..93f2fb86 100644 --- a/data/entities/expectations/building-simple-attributes-query-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-query-expectation.jsonld @@ -12,6 +12,6 @@ "value": "tourism" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json index 134f7221..e6c0047c 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json +++ b/data/entities/expectations/building-simple-attributes-sample-expanded-expectation.json @@ -1,7 +1,7 @@ { "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", - "name": { + "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Eiffel Tower" }, diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expectation.json index f23a0d02..df3301bf 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.json +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.json @@ -1,7 +1,7 @@ { "id": "urn:ngsi-ld:Building:randomUUID", "type": "https://ngsi-ld-test-suite/context#Building", - "name": { + "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Eiffel Tower" }, diff --git a/data/entities/expectations/building-simple-attributes-simplified-expectation.json b/data/entities/expectations/building-simple-attributes-simplified-expectation.json new file mode 100644 index 00000000..17d49789 --- /dev/null +++ b/data/entities/expectations/building-simple-attributes-simplified-expectation.json @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "https://ngsi-ld-test-suite/context#Building", + "https://ngsi-ld-test-suite/context#name": "Eiffel Tower", + "https://ngsi-ld-test-suite/context#airQualityLevel": 4, + "https://ngsi-ld-test-suite/context#almostFull": false, + "https://ngsi-ld-test-suite/context#subCategory": "tourism" +} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld b/data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld index 014c2d53..0fb90c69 100644 --- a/data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld +++ b/data/entities/expectations/building-simple-attributes-simplified-expectation.jsonld @@ -1,11 +1,11 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Building", - "name": "Eiffel Tower", - "https://ngsi-ld-test-suite/context#airQualityLevel": 4, - "https://ngsi-ld-test-suite/context#almostFull": false, - "https://ngsi-ld-test-suite/context#subCategory": "tourism", - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "type": "https://ngsi-ld-test-suite/context#Building", + "https://ngsi-ld-test-suite/context#name": "Eiffel Tower", + "https://ngsi-ld-test-suite/context#airQualityLevel": 4, + "https://ngsi-ld-test-suite/context#almostFull": false, + "https://ngsi-ld-test-suite/context#subCategory": "tourism", + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld b/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld index 51439a5b..03def85a 100644 --- a/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld +++ b/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld @@ -16,7 +16,7 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] }, { @@ -54,7 +54,7 @@ "value": "Downtown One" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } ] \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index 819eca55..14fcc171 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -3,5 +3,5 @@ "type": "Property", "value": "BMW" }, - "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld index 95b7174f..76731949 100644 --- a/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-invalid-json-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld index 67e57257..95959ee2 100644 --- a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld index e803e2f9..dc8fae87 100644 --- a/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-without-id-sample.jsonld @@ -43,6 +43,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file -- GitLab From c2abdc8c36eb41aec17f09bbb05fbb5fcdfe2091 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 19 Mar 2021 17:48:26 +0100 Subject: [PATCH 155/442] fix: ensure check on response body does not depend on order of results --- resources/AssertionUtils.resource | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index db22588f..9d2938cc 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -98,10 +98,9 @@ Check Response Body Containing Entity element Check Response Body Containing List Containing Entity Elements [Arguments] ${expectation_filename} ${entities_ids} ${response_body} - ${index}= Set Variable 0 FOR ${entity_id} IN @{entities_ids} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response_body[${index}]} - ${index}= Evaluate ${index} + 1 + ${entity}= Get Value From Json ${response_body} $[?(@.id=='${entity_id}')] + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${entity}[0] END Check Response Body Containing List Containing Entity Elements With Different Types -- GitLab From fffb75c4a77930c95af17623c12ab0c4f6fdcdaf Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 19 Mar 2021 16:51:36 +0000 Subject: [PATCH 156/442] added folders according D2 structure --- .../Consumption/Entity/{ => QueryEntities}/019_01_01.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_01_02.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_01_03.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_01_04.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_01_05.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_02_01.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_02_02.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_02_03.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_02_04.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_02_05.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_03_01.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_03_02.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_03_03.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_03_04.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_03_05.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_04.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_05.robot | 0 .../Consumption/Entity/{ => QueryEntities}/019_06.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_01_01.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_01_02.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_01_03.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_02.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_03_01.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_03_02.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_04.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_05.robot | 0 .../Consumption/Entity/{ => RetrieveEntity}/018_06.robot | 0 .../EntityAttributes/{ => AppendEntityAttributes}/010_01.robot | 0 .../EntityAttributes/{ => AppendEntityAttributes}/010_02.robot | 0 .../EntityAttributes/{ => AppendEntityAttributes}/010_03.robot | 0 .../EntityAttributes/{ => DeleteEntityAttribute}/013_01.robot | 0 .../EntityAttributes/{ => DeleteEntityAttribute}/013_02.robot | 0 .../EntityAttributes/{ => DeleteEntityAttribute}/013_03.robot | 0 .../EntityAttributes/{ => PartialAttribute}/012_01.robot | 0 .../EntityAttributes/{ => PartialAttribute}/012_02.robot | 0 .../EntityAttributes/{ => PartialAttribute}/012_03.robot | 0 .../EntityAttributes/{ => UpdateEntityAttributes}/011_01.robot | 0 .../EntityAttributes/{ => UpdateEntityAttributes}/011_02.robot | 0 .../EntityAttributes/{ => UpdateEntityAttributes}/011_03.robot | 0 .../{ => CreateTemporalRepresentationOfEntity}/007_01.robot | 0 .../{ => CreateTemporalRepresentationOfEntity}/007_02.robot | 0 .../{ => DeleteTemporalRepresentationOfEntity}/009_01.robot | 0 .../{ => DeleteTemporalRepresentationOfEntity}/009_02.robot | 0 .../{ => DeleteTemporalRepresentationOfEntity}/009_03.robot | 0 .../{ => UpdateTemporalRepresentationOfEntity}/008_01.robot | 0 .../AppendAttributes}/014_01.robot | 0 .../AppendAttributes}/014_02.robot | 0 .../AppendAttributes}/014_03.robot | 0 .../DeleteAttribute}/015_01.robot | 0 .../DeleteAttribute}/015_02.robot | 0 .../DeleteAttribute}/015_03.robot | 0 .../DeleteAttributeInstance}/017_01.robot | 0 .../DeleteAttributeInstance}/017_02.robot | 0 .../DeleteAttributeInstance}/017_03.robot | 0 .../PartialUpdateAttributeInstance}/016_01.robot | 0 .../PartialUpdateAttributeInstance}/016_02.robot | 0 .../PartialUpdateAttributeInstance}/016_03.robot | 0 57 files changed, 0 insertions(+), 0 deletions(-) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_01_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_01_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_01_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_01_04.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_01_05.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_02_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_02_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_02_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_02_04.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_02_05.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_03_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_03_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_03_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_03_04.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_03_05.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_04.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_05.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => QueryEntities}/019_06.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_01_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_01_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_01_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_03_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_03_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_04.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_05.robot (100%) rename TP/NGSI-LD/ContextInformation/Consumption/Entity/{ => RetrieveEntity}/018_06.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => AppendEntityAttributes}/010_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => AppendEntityAttributes}/010_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => AppendEntityAttributes}/010_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => DeleteEntityAttribute}/013_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => DeleteEntityAttribute}/013_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => DeleteEntityAttribute}/013_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => PartialAttribute}/012_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => PartialAttribute}/012_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => PartialAttribute}/012_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => UpdateEntityAttributes}/011_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => UpdateEntityAttributes}/011_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{ => UpdateEntityAttributes}/011_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => CreateTemporalRepresentationOfEntity}/007_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => CreateTemporalRepresentationOfEntity}/007_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => DeleteTemporalRepresentationOfEntity}/009_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => DeleteTemporalRepresentationOfEntity}/009_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => DeleteTemporalRepresentationOfEntity}/009_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/{ => UpdateTemporalRepresentationOfEntity}/008_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/AppendAttributes}/014_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/AppendAttributes}/014_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/AppendAttributes}/014_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttribute}/015_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttribute}/015_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttribute}/015_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttributeInstance}/017_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttributeInstance}/017_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/DeleteAttributeInstance}/017_03.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/PartialUpdateAttributeInstance}/016_01.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/PartialUpdateAttributeInstance}/016_02.robot (100%) rename TP/NGSI-LD/ContextInformation/Provision/{TemporalEntity => TemporalEntityAttributes/PartialUpdateAttributeInstance}/016_03.robot (100%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_01_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_02_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_03_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/019_06.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_01_03.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_03_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_04.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_05.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Consumption/Entity/018_06.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/010_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/013_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/012_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/011_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/007_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/009_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/008_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/014_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/015_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/017_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/016_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot -- GitLab From 2f84900c2a0e40c6e2eebe53afba7938e6428f4f Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 20 Mar 2021 18:03:32 +0100 Subject: [PATCH 157/442] fix: check on status code in 010_02 --- .../EntityAttributes/AppendEntityAttributes/010_02.robot | 2 +- resources/ApiUtils.resource | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 2355e695..df72dac1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -45,7 +45,7 @@ Append entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code 400 ${response['status']} + Check RL Response Status Code Set To ${status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 218eaf1e..9114d877 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -156,7 +156,7 @@ Append Entity Attributes Using Session Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ params=options=${options} data=${file_content} headers=${headers} expected_status=any - [return] ${response} + Set Test Variable ${response} Update Entity Attributes Using Session [Arguments] ${id} ${fragment_filename} ${content_type} ${options} -- GitLab From 47065dd3a542705fd95f8684895d23c786750c16 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 20 Mar 2021 18:06:28 +0100 Subject: [PATCH 158/442] chore: remove duplicate method to check response status code with rf-requests lib --- .../Provision/Entities/CreateEntity/001_02.robot | 2 +- resources/AssertionUtils.resource | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 77fa8ad8..f56d3171 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -18,6 +18,6 @@ Create Entity With Invalid Request Scenarios Request Entity From File ${filename} - Check RL Response Status Code Set To Expected Code 400 + Check RL Response Status Code Set To 400 Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 9d2938cc..1b1a4dc8 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -20,10 +20,6 @@ Check Response Status Code Set To ${response_status}= convert to string ${response['status']} Should Be Equal ${response_status} ${expected_status} -Check RL Response Status Code Set To Expected Code - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} - Check RL Response Status Code Set To [Arguments] ${expected_status} Status Should Be ${expected_status} ${response} -- GitLab From 308e777642be60372796b54d2b695e79f44dd282 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 20 Mar 2021 18:18:17 +0100 Subject: [PATCH 159/442] fix: all checks on response status code when using rf-requests library --- .../EntityAttributes/UpdateEntityAttributes/011_02.robot | 6 +++--- .../CreateTemporalRepresentationOfEntity/007_02.robot | 2 +- .../TemporalEntityAttributes/AppendAttributes/014_02.robot | 2 +- .../UpdateContextSourceRegistration/034_02.robot | 2 +- resources/ApiUtils.resource | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index ccfb6c0d..139e8db4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -40,9 +40,9 @@ Update entity attributes with invalid entity fragments ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Output ${fragment_filename} - ${response}= Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check Response Status Code 400 ${response} + + Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 15e94366..a1b5b9b9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -27,7 +27,7 @@ Create Temporal Entity From File [Tags] mandatory ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${response['status']} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 33327658..962e1094 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -34,7 +34,7 @@ Add an Attribute To a Temporal Entity Check Response Status Code 201 ${response['status']} ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index a059a392..6b74a12d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -51,7 +51,7 @@ Update a context source registration if the request body is invalid Check Response Status Code 201 ${response['status']} ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response} + Check Response Status Code ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 9114d877..525334c1 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -165,7 +165,7 @@ Update Entity Attributes Using Session &{headers}= Create Dictionary Content-Type=${content_type} ${response}= PATCH On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ data=${file_content} headers=${headers} expected_status=any Output ${response.json()} - [return] ${response} + Set Test Variable ${response} Update Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} -- GitLab From 7fa60d0010c06d6e6ad2dde5c05eb0ee986e6772 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 21 Mar 2021 10:40:27 +0100 Subject: [PATCH 160/442] fix: misc problems in 010_01 - ignore reason for notUpdated attributes - add attributeName in expected response on 207 cases - expect test suite context in responses if provided in the query - fix expected response missing instances with previous datasetIds --- .../AppendEntityAttributes/010_01.robot | 3 +- .../add-attribute-expectation.jsonld | 7 +++- .../vehicle-speed-appended-expectation.jsonld | 2 +- ...eed-different-datasetid-expectation.jsonld | 36 ++++++++++++++----- .../vehicle-attribute-to-add-fragment.jsonld | 2 +- resources/AssertionUtils.resource | 5 +-- 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index bf47e81f..13c7a69a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -49,7 +49,8 @@ Append Attributes With Params ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite Check Response Status Code ${status_code} ${response['status']} - Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} + # ignore the reason for the not updated attribute as this detail is up to each context broker implementation + Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} root\\['notUpdated'\\]\\[0\\]\\['reason'\\] ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} diff --git a/data/entities/expectations/add-attribute-expectation.jsonld b/data/entities/expectations/add-attribute-expectation.jsonld index 1f9522a6..c6c6eb75 100644 --- a/data/entities/expectations/add-attribute-expectation.jsonld +++ b/data/entities/expectations/add-attribute-expectation.jsonld @@ -2,5 +2,10 @@ "updated":[ "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added" ], - "notUpdated":[ ] + "notUpdated":[ + { + "attributeName": "https://ngsi-ld-test-suite/context#speed", + "reason": "a reason ignored during the comparison" + } + ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld index 9732320d..8822fc80 100644 --- a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld @@ -39,6 +39,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld index 887175ed..59d405ed 100644 --- a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld @@ -5,15 +5,35 @@ "type": "Property", "value": "Mercedes" }, - "speed": { - "type": "Property", - "source": { + "speed": [ + { "type": "Property", - "value": "Speedometer" + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2", + "value": 56 }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed2", - "value": 56 - }, + { + "type": "Property", + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed", + "value": 54.5 + }, + { + "type": "Property", + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometer", + "value": 55 + } + ], "attribute_to_be_added": { "type": "Property", "value": 23 @@ -28,6 +48,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld index 5684047f..62f7c601 100644 --- a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld @@ -6,7 +6,7 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + "datasetId": "urn:ngsi-ld:Property:speedometer" }, "attribute_to_be_added": { "type": "Property", diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 1b1a4dc8..4573716b 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -29,11 +29,12 @@ Check Response Body Containing Array Of URIs set to Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True Check Response Body Content - [Arguments] ${expectation_filename} ${response_body} + [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} Output ${response_body} Output ${entity_payload} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${instance_id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${all_ignored_paths} Should Be True ${comparison_result} msg=Entity Comparison Failed Check Request Containing Accept Header Set To -- GitLab From b2855527b1276bf96990bcc208c57a718e282b2d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 21 Mar 2021 11:05:52 +0100 Subject: [PATCH 161/442] fix: broken references to fragments or expectation files --- .../Consumption/Entity/QueryEntities/019_02_01.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_03.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_06.robot | 2 +- .../EntityAttributes/UpdateEntityAttributes/011_01.robot | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index c97c4903..ef79b489 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 438c15b9..9aeaf9d1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${entity_id_pattern}= urn:ngsi-ld:Building:.* diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 6a42c907..7f452b27 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 46780edc..5d4e3b9c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${geometry_property}= location diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 625df83a..c1c82572 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.jsonld +${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${limit}= 2 diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index e9a66102..c1b8013b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -11,7 +11,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId 204 fragments/vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld 011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld 011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld 011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld -- GitLab From 82c07d26f9469fb6d4fc9428c8eb80ec71ed9e4c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 22 Mar 2021 09:49:24 +0100 Subject: [PATCH 162/442] fix: TCs to delete attribute instance(s) in 013_01 --- .../DeleteEntityAttribute/013_01.robot | 6 +++--- .../vehicle-delete-datasetid-speed-expectation.jsonld | 10 ++++------ resources/ApiUtils.resource | 10 ++++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 839a04c8..56cb12e6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -13,9 +13,9 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${attribute_id}= speed *** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME -013_01_01_delete an attribute with the id ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +013_01_01_delete an attribute with the default instance ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld 013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld -013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true vehicle-delete-deleteall-speed-expectation.jsonld +013_01_03_delete all target attribute instances ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld *** Keywords *** Delete Attributes @@ -27,7 +27,7 @@ Delete Attributes ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} diff --git a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld index 98f1b652..6d9b6829 100644 --- a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld @@ -15,15 +15,13 @@ }, "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, - "speed": - { + "speed": { "type": "Property", - "value": 54.5, + "value": 55, "source": { "type": "Property", - "value": "GPS" - }, - "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + "value": "Speedometer" + } }, "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 525334c1..4c0e7d7f 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -177,8 +177,14 @@ Update Entity Attributes [return] ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON} + Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + @{params}= Create List + Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} + Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} Output request Output response [return] ${response} -- GitLab From 4448012b6d47f1937d2bba6d9ab705fa35283852 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 10:14:10 +0100 Subject: [PATCH 163/442] fix: fix request parameters in query temporal evolution of entities --- .../QueryTemporalEvolutionOfEntities/021_01.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_02.robot | 4 ++-- .../QueryTemporalEvolutionOfEntities/021_03.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_04.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_05.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_06.robot | 4 ++-- .../QueryTemporalEvolutionOfEntities/021_07.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_08.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_09.robot | 4 ++-- .../QueryTemporalEvolutionOfEntities/021_10.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_11.robot | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 44b84152..456e926e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -26,7 +26,7 @@ Query the temporal evolution of entities [Documentation] Check that you can query the temporal evolution of entities [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index 02eec535..2b06f805 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -18,8 +18,8 @@ Query the temporal evolution of certain attributes of entities [Documentation] Check that you can query the temporal evolution of certain attributes of entities [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle - @{temporal_attributes_to_be_retrieved}= Create List speed + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 01253a3d..c80e431a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -18,7 +18,7 @@ Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 53380e1f..d262ea76 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -18,7 +18,7 @@ Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index 1955e003..03ef92a9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -19,7 +19,7 @@ Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle Bus + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 953470c1..c584dc69 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -18,8 +18,8 @@ Query the temporal evolution of entities matching the given identifier(s) [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle - @{entity_ids_to_be_retrieved}= Create List ${first_temporal_entity_representation_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index ec96446e..be089a35 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -18,7 +18,7 @@ Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index ef0c3a0f..7a2fc825 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -18,7 +18,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 9c5ab855..ba0e83ee 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -24,8 +24,8 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle - + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index 05bdf75f..d2b7dc00 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -18,7 +18,7 @@ Query the temporal evolution of entities matching the given NGSI-LD context sour [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Building + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index b1fdaa47..087be1fa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -27,7 +27,7 @@ Query the temporal evolution of entities with a limit to the number of entities [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved [Tags] mandatory - @{entity_types_to_be_retrieved}= Create List Vehicle Bus + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} -- GitLab From a00a7f7039fa8cfd1642324c7b2b312a39022858 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 10:53:16 +0100 Subject: [PATCH 164/442] fix: fix request parameters for check on batch entities --- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 3 ++- .../BatchEntities/CreateBatchOfEntities/003_02.robot | 4 +++- .../BatchEntities/DeleteBatchOfEntities/006_01.robot | 4 +++- .../BatchEntities/DeleteBatchOfEntities/006_02.robot | 4 +++- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 3 ++- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 3 ++- .../BatchEntities/UpdateBatchOfEntities/005_03.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_01.robot | 4 ++-- .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_05.robot | 4 ++-- 12 files changed, 27 insertions(+), 14 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 4de7f40a..7da5ac0c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -29,7 +29,8 @@ Batch Create Entity Scenarios Batch Create Entities @{entities_to_be_created} - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + ${expected_entities_ids}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index c7b24622..aa31e1fc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -30,7 +30,9 @@ Create a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index f2f36c0e..d5ff2372 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -20,7 +20,9 @@ Delete a batch of entities Check Response Status Code Set To 204 - Query Entities ${entities_ids_to_be_deleted} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} + + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index 7bd1b04f..c31a415a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -25,7 +25,9 @@ Delete a batch of non existing and existing entities Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 8f176978..df1dc42d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -38,7 +38,8 @@ Batch Update Entity Scenarios ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - Query Entities ${entities_ids_to_be_updated} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${updated_entities} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 1fc9498c..e16007bc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -38,7 +38,8 @@ Batch Update Entity With NoOverwrite Option Scenarios ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - Query Entities ${entities_ids_to_be_updated} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${updated_entities} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index c274b8be..d5c1c91e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -38,7 +38,8 @@ Update a batch of non existing and existing entities ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${updated_entities} Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index 710f4c13..c385d7a5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -31,8 +31,8 @@ Batch Upsert Entity Scenarios @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${entities_to_be_upserted} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 3c643b81..0272920d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -35,7 +35,8 @@ Batch Upsert Non-existing And Existing Entities Scenarios Check Response Body Containing Array Of URIs set to @{expected_entities_ids} @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} - Query Entities ${upserted_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 16a632e2..0e16528c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -31,7 +31,8 @@ Batch Upsert Existing Entities Scenarios Check Response Status Code Set To 204 @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Query Entities ${upserted_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${entities_to_be_upserted} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 43bcedfb..ebaa3ce3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -39,7 +39,8 @@ Batch Upsert Entities With Update Option Scenarios ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} - Query Entities ${entities_ids_to_be_upserted} Building context=${ngsild_test_suite_context} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 91426f04..dd6b8727 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -29,8 +29,8 @@ Upsert a batch of two valid entities and one invalid entity &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - - Query Entities ${expected_successful_entities_ids} Building context=${ngsild_test_suite_context} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} @{upserted_entities}= Create List ${first_entity} ${second_entity} Check Updated Resources Set To ${upserted_entities} -- GitLab From d6631f197de9c94e21ac48bfa0e82755e4645397 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 14:44:46 +0100 Subject: [PATCH 165/442] fix: fix subscription test cases --- .../DeleteSubscription/032_02.robot | 2 +- .../RetrieveSubscription/030_02.robot | 2 +- .../RetrieveSubscription/030_03.robot | 3 ++- .../UpdateSubscription/029_02.robot | 2 +- .../UpdateSubscription/029_05.robot | 4 ++-- .../040_01.robot | 3 ++- .../subscriptions-040-01-expectation.json | 18 ++++++++++++++++++ ...iption-vehicle-expanded-types-sample.jsonld | 0 .../subscription-vehicle-sample.jsonld | 0 .../subscriptions-030-03-expectation.json | 18 ++++++++++++++++++ .../subscriptions-031-01-expectation.json | 3 +++ resources/AssertionUtils.resource | 6 +++--- 12 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json rename data/subscriptions/{expected => expectations}/subscription-vehicle-expanded-types-sample.jsonld (100%) rename data/subscriptions/{expected => expectations}/subscription-vehicle-sample.jsonld (100%) create mode 100644 data/subscriptions/expectations/subscriptions-030-03-expectation.json diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index 5600e7a6..c83fdc6a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -8,7 +8,7 @@ Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] mandatory - Delete Subscription unknownSubscription + Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index bca57022..7c77ef6b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -8,7 +8,7 @@ Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] mandatory - Retrieve Subscription unknownSubscription + Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 1cfdfa2d..79aaaf51 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -10,6 +10,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json *** Test Case *** Retrieve Subscription @@ -19,7 +20,7 @@ Retrieve Subscription Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 3c64d310..2ad714bc 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -12,7 +12,7 @@ Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] mandatory - Update Subscription unknownSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 404 Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 60aca577..08d3fc89 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -11,8 +11,8 @@ Suite Teardown Delete Initial Subscriptions ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json -${expected_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-sample.jsonld -${expected_expanded_subscription_payload_file_path}= subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld +${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld +${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld *** Test Case *** Update Subscription With Term to Uri Expansion diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 065e4771..0da3e65b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -10,6 +10,7 @@ Suite Teardown Delete Created Context Source Registration Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json *** Test Case *** Retrieve Context Source Registration Subscription @@ -19,7 +20,7 @@ Retrieve Context Source Registration Subscription Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Context Source Registration Subscription diff --git a/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json b/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json new file mode 100644 index 00000000..6ebc6092 --- /dev/null +++ b/data/csourceSubscriptions/expectations/subscriptions-040-01-expectation.json @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "isActive": true, + "status": "active" +} \ No newline at end of file diff --git a/data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld similarity index 100% rename from data/subscriptions/expected/subscription-vehicle-expanded-types-sample.jsonld rename to data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld diff --git a/data/subscriptions/expected/subscription-vehicle-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld similarity index 100% rename from data/subscriptions/expected/subscription-vehicle-sample.jsonld rename to data/subscriptions/expectations/subscription-vehicle-sample.jsonld diff --git a/data/subscriptions/expectations/subscriptions-030-03-expectation.json b/data/subscriptions/expectations/subscriptions-030-03-expectation.json new file mode 100644 index 00000000..6ebc6092 --- /dev/null +++ b/data/subscriptions/expectations/subscriptions-030-03-expectation.json @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "isActive": true, + "status": "active" +} \ No newline at end of file diff --git a/data/subscriptions/expectations/subscriptions-031-01-expectation.json b/data/subscriptions/expectations/subscriptions-031-01-expectation.json index cd952e1f..a4ee40eb 100644 --- a/data/subscriptions/expectations/subscriptions-031-01-expectation.json +++ b/data/subscriptions/expectations/subscriptions-031-01-expectation.json @@ -14,6 +14,7 @@ "accept":"application/json" } }, + "isActive": true, "status": "active" }, { @@ -35,6 +36,7 @@ "accept":"application/json" } }, + "isActive": true, "status": "active" }, { @@ -52,6 +54,7 @@ "accept":"application/json" } }, + "isActive": false, "status": "paused" } ] \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 4573716b..a3384939 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -7,7 +7,6 @@ ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] ${context_regex_expr}= root\\['@context'\\] -${status_regex_expr}= root\\['status'\\] *** Keywords *** Check Response Status Code @@ -135,7 +134,7 @@ Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${ignored_keys}= Create List ${status_regex_expr} ${context_regex_expr} + ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} Should Be True ${comparison_result} msg=Subscription Comparison Failed @@ -147,7 +146,8 @@ Check Response Body Containing List Containing Subscription elements ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${EMPTY} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${ignored_keys} Should Be True ${comparison_result} msg=Subscription Comparison Failed # Since response body can be a json object if it contains one element -- GitLab From 659daf1f44a45da80cca81689644b9e585301b12 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Mon, 22 Mar 2021 14:59:03 +0000 Subject: [PATCH 166/442] added create subscriptions suite --- .../PartialAttribute/012_02.robot | 10 +++---- .../CreateSubscription/031_01.robot | 24 +++++++++++++++ .../CreateSubscription/031_02.robot | 22 ++++++++++++++ .../CreateSubscription/031_03.robot | 28 +++++++++++++++++ .../CreateSubscription/031_04.robot | 26 ++++++++++++++++ .../CreateSubscription/001_01.robot | 30 ------------------- .../subscription-empty-sample.jsonld | 2 ++ .../subscription-invalid-json-sample.jsonld | 19 ++++++++++++ resources/ApiUtils.resource | 7 +++++ 9 files changed, 133 insertions(+), 35 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot delete mode 100644 TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot create mode 100644 data/subscriptions/subscription-empty-sample.jsonld create mode 100644 data/subscriptions/subscription-invalid-json-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot index c01c314b..9dd3a92c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot @@ -13,12 +13,12 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${status_code}= 400 *** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -#012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld -#012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld 012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld -#012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld -#012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -#012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld +012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld +012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot new file mode 100644 index 00000000..948a9696 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Check that you can create a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Cases *** +Create Subscription + [Documentation] Check that you can create a subscription + [Tags] /entities/ 5_6_1 + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + ${created_subscription}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Created Resource Set To ${created_subscription} + + [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot new file mode 100644 index 00000000..41c18c20 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot create a subscription with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Subscription With Invalid Request + +*** Test Cases *** FILENAME +031_02_01_InvalidJson subscription-invalid-json-sample.jsonld +031_02_02_EmptyJson subscription-empty-sample.jsonld + +*** Keywords *** +Create Subscription With Invalid Request + [Arguments] ${filename} + [Documentation] Check that you cannot create a subscription with an invalid request + [Tags] /entities/ 5_6_1 + + Create Subscription From File ${filename} + + Check RL Response Status Code Set To Expected Code 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot new file mode 100644 index 00000000..6553c3a7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot @@ -0,0 +1,28 @@ +*** Settings *** +Documentation Check that you cannot create a subscription with an invalid/empty id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Subscription With Invalid/Empty Id + +*** Variables *** +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Cases *** ID +031_03_01_InvalidId invalidId +031_03_02_EmptyId ${EMPTY} + +*** Keywords *** +Create Subscription With Invalid/Empty Id + [Arguments] ${subscription_id} + [Documentation] Check that you cannot create a subscription with an invalid/empty id + [Tags] /entities/ 5_6_1 + + ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot new file mode 100644 index 00000000..0590c7d7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Check that you cannot create a subscription with an existing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Case *** +Create a subscription with an id known to the system + [Documentation] Check that you cannot create a subscription with an existing id + [Tags] /entities/ 5_6_1 + + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Subscription ${subscription_id} + diff --git a/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot b/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot deleted file mode 100644 index 7f4ed1cc..00000000 --- a/TP/NGSI-LD/ContextInformation/Subscriptions/CreateSubscription/001_01.robot +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Documentation Check that you can create an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Entity Scenarios - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json -001_01_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json -001_01_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -001_01_04_EntityWithLocationAttribute building-location-attribute-sample.jsonld application/ld+json - -*** Keywords *** -Create Entity Scenarios - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create an entity - [Tags] /entities/ 5_6_1 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} - - [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file diff --git a/data/subscriptions/subscription-empty-sample.jsonld b/data/subscriptions/subscription-empty-sample.jsonld new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/data/subscriptions/subscription-empty-sample.jsonld @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/data/subscriptions/subscription-invalid-json-sample.jsonld b/data/subscriptions/subscription-invalid-json-sample.jsonld new file mode 100644 index 00000000..bf9772f9 --- /dev/null +++ b/data/subscriptions/subscription-invalid-json-sample.jsonld @@ -0,0 +1,19 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID",, + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 218eaf1e..3d29e442 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -672,6 +672,13 @@ Create Subscription Output response [return] ${response} +Create Subscription From File + [Arguments] ${filename} + ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} + Create Session SubscriptionCreateRequest ${url} + ${response}= PATCH On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} expected_status=any + Set Test Variable ${response} + Update Subscription [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} -- GitLab From 09ad846c631e5a10fa0da512c40725141e6f0396 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 17:18:35 +0100 Subject: [PATCH 167/442] fix: fix batch entities tcs --- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 8 +++++--- .../BatchEntities/CreateBatchOfEntities/003_02.robot | 4 ++-- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 3 ++- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 3 ++- .../BatchEntities/UpdateBatchOfEntities/005_03.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_01.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_05.robot | 3 ++- 10 files changed, 23 insertions(+), 13 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 7da5ac0c..314dd96c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -29,12 +29,14 @@ Batch Create Entity Scenarios Batch Create Entities @{entities_to_be_created} - ${expected_entities_ids}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check Created Resources Set To ${entities_to_be_created} + Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} + ${ignored_keys}= Create List ${context_regex_expr} + Check Created Resources Set To ${entities_to_be_created} ${ignored_keys} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index aa31e1fc..9d44a5ed 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -34,8 +34,8 @@ Create a batch of two valid entities and one invalid entity Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} @{created_entities}= Create List ${first_entity} ${second_entity} - Check Created Resources Set To ${created_entities} - + ${ignored_keys}= Create List ${context_regex_expr} + Check Created Resources Set To ${created_entities} ${ignored_keys} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index df1dc42d..8d830ddd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -40,7 +40,8 @@ Batch Update Entity Scenarios @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${updated_entities} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${updated_entities} ${ignored_keys} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index e16007bc..e6ca0b0c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -40,7 +40,8 @@ Batch Update Entity With NoOverwrite Option Scenarios @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${updated_entities} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${updated_entities} ${ignored_keys} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index d5c1c91e..98ae8198 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -40,7 +40,8 @@ Update a batch of non existing and existing entities @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${updated_entities} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${updated_entities} ${ignored_keys} Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index c385d7a5..3f6f4480 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -33,6 +33,7 @@ Batch Upsert Entity Scenarios Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${entities_to_be_upserted} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 0272920d..bede8155 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -37,7 +37,8 @@ Batch Upsert Non-existing And Existing Entities Scenarios @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${entities_to_be_upserted} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 0e16528c..d4ee1825 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -33,7 +33,8 @@ Batch Upsert Existing Entities Scenarios @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${entities_to_be_upserted} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index ebaa3ce3..cc014f5a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -41,7 +41,8 @@ Batch Upsert Entities With Update Option Scenarios @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - Check Updated Resources Set To ${updated_entities} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${updated_entities} ${ignored_keys} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index dd6b8727..6875bbae 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -32,6 +32,7 @@ Upsert a batch of two valid entities and one invalid entity ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} @{upserted_entities}= Create List ${first_entity} ${second_entity} - Check Updated Resources Set To ${upserted_entities} + ${ignored_keys}= Create List ${context_regex_expr} + Check Updated Resources Set To ${upserted_entities} ${ignored_keys} Batch Delete Entities @{expected_successful_entities_ids} -- GitLab From 7499dd0016261359ab5581347b2263955a468af8 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 17:25:21 +0100 Subject: [PATCH 168/442] fix: add missing variable for 029-06 --- resources/AssertionUtils.resource | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index a3384939..54eac1a5 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -7,6 +7,7 @@ ${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] ${notification_timestamps_regex_expr}= root\\['last.*'\\] ${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] ${context_regex_expr}= root\\['@context'\\] +${status_regex_expr}= root\\['status'\\] *** Keywords *** Check Response Status Code -- GitLab From 21b9c3eabc92779c7afca1eba1524bbc8e904ec4 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 22 Mar 2021 10:32:59 +0100 Subject: [PATCH 169/442] fix: TCs to partially update an attribute instance in 012_01 --- .../EntityAttributes/PartialAttribute/012_01.robot | 2 +- .../vehicle-update-speed-expectation.jsonld | 6 +++--- .../fragmentEntities/vehicle-isparked-fragment.jsonld | 9 ++------- .../vehicle-speed-equal-datasetid-fragment.jsonld | 11 ++--------- .../vehicle-speed-two-datasetid-sample.jsonld | 4 ++-- .../vehicle-two-datasetid-attributes-sample.jsonld | 4 ++-- 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot index 3d58d8d1..22857925 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot @@ -13,7 +13,7 @@ ${status_code}= 204 *** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME 012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld +012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld *** Keywords *** Update Attributes diff --git a/data/entities/expectations/vehicle-update-speed-expectation.jsonld b/data/entities/expectations/vehicle-update-speed-expectation.jsonld index b44a810c..bb9dc338 100644 --- a/data/entities/expectations/vehicle-update-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-speed-expectation.jsonld @@ -10,13 +10,13 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" } }, "speed": [{ "type": "Property", - "value": 55, + "value": 56, "source": { "type": "Property", "value": "Speedometer" diff --git a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld index 1b59b6f2..c98cf139 100644 --- a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld @@ -1,12 +1,7 @@ { - "https://ngsi-ld-test-suite/context#isParked": { + "providedBy": { "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:JohnDoe" - } + "object": "urn:ngsi-ld:Person:JohnDoe" }, "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld index c61d72cb..251fc430 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld @@ -1,13 +1,6 @@ { - "https://ngsi-ld-test-suite/context#speed": { - "type": "Property", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometer" - }, + "value": 56, + "datasetId": "urn:ngsi-ld:Property:speedometer", "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] diff --git a/data/entities/vehicle-speed-two-datasetid-sample.jsonld b/data/entities/vehicle-speed-two-datasetid-sample.jsonld index b44a810c..72f4422b 100644 --- a/data/entities/vehicle-speed-two-datasetid-sample.jsonld +++ b/data/entities/vehicle-speed-two-datasetid-sample.jsonld @@ -10,8 +10,8 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" } }, "speed": [{ diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 729dd4ef..4b45ca83 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -10,8 +10,8 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" }, "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, -- GitLab From e43b8d1be2707628a8404de87ae3b6021bf7c98d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 22 Mar 2021 12:30:11 +0100 Subject: [PATCH 170/442] fix: TCs to update attribute in 011_01 --- .../UpdateEntityAttributes/011_01.robot | 1 - .../vehicle-multi-attributes-expectation.jsonld | 2 +- .../vehicle-update-attributes-expectation.jsonld | 4 ++-- ...-update-datasetid-attributes-expectation.jsonld | 4 ++-- .../vehicle-speed-two-datasetid-01-fragment.jsonld | 9 --------- .../vehicle-speed-two-datasetid-02-fragment.jsonld | 6 +++--- .../vehicle-speed-two-datasetid-03-fragment.jsonld | 4 ++-- .../vehicle-speed-two-datasetid-04-fragment.jsonld | 14 -------------- 8 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index c1b8013b..75dd966b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -14,7 +14,6 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld 011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld 011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld 011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld -011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld *** Keywords *** Update Attributes diff --git a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld index 08921f20..f04f1b36 100644 --- a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld @@ -28,7 +28,7 @@ "value": 99, "source": { "type": "Property", - "value": "GPS" + "value": "Speedometer" }, "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], diff --git a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld index 7d74f1b8..50d7f264 100644 --- a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld @@ -10,8 +10,8 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" }, "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, diff --git a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld index 2c2c11f9..23c7abfa 100644 --- a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld @@ -25,10 +25,10 @@ }, { "type": "Property", - "value": 54.5, + "value": 99, "source": { "type": "Property", - "value": "GPS" + "value": "Speedometer" }, "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld index 8c2d18b6..46a8756f 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld @@ -1,13 +1,4 @@ { - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:JohnDoe" - } - }, "speed": { "type": "Property", "value": 99, diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld index 0ae499d3..8edd2137 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld @@ -4,8 +4,8 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:JohnDoe" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" }, "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, @@ -16,7 +16,7 @@ "type": "Property", "value": "Speedometer" }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld index 375db489..016311cf 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld @@ -4,8 +4,8 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:JohnDoe" + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" }, "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld deleted file mode 100644 index addf83fb..00000000 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-04-fragment.jsonld +++ /dev/null @@ -1,14 +0,0 @@ -{ - "speed": { - "type": "Relationship", - "value": 99, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" - ] -} \ No newline at end of file -- GitLab From 9f7ea5938b5c82a538df59affecac345cc8ea847 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 22 Mar 2021 17:38:37 +0100 Subject: [PATCH 171/442] fix: bad usages of the ignored list of attributes when checking results of actions --- .../EntityAttributes/AppendEntityAttributes/010_01.robot | 5 ++--- .../EntityAttributes/DeleteEntityAttribute/013_01.robot | 4 ++-- .../Provision/EntityAttributes/PartialAttribute/012_01.robot | 4 ++-- .../EntityAttributes/UpdateEntityAttributes/011_01.robot | 4 ++-- .../UpdateTemporalRepresentationOfEntity/008_01.robot | 4 ++-- .../TemporalEntityAttributes/AppendAttributes/014_01.robot | 4 ++-- .../TemporalEntityAttributes/DeleteAttribute/015_01.robot | 4 ++-- .../DeleteAttributeInstance/017_01.robot | 4 ++-- .../PartialUpdateAttributeInstance/016_01.robot | 4 ++-- .../UpdateContextSourceRegistration/034_01.robot | 2 +- .../UpdateContextSourceRegistrationSubscription/039_01.robot | 1 - 11 files changed, 19 insertions(+), 21 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 13c7a69a..459ef3ae 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -33,7 +33,6 @@ Append Attributes Without Params ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -54,7 +53,7 @@ Append Attributes With Params ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${entity_expectation_payload} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 56cb12e6..ded9683c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -32,7 +32,7 @@ Delete Attributes ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${entity_expectation_payload} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot index 22857925..5f4cf328 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot @@ -30,8 +30,8 @@ Update Attributes ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${entity_expectation_payload} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 75dd966b..3383cc02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -31,7 +31,7 @@ Update Attributes ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${entity_expectation_payload} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 0afda983..648043e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -24,7 +24,7 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.jso ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 4faf3c8b..3ed13340 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -24,7 +24,7 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expect ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 9ab31c23..a28746d0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -32,7 +32,7 @@ Delete Attribute From A Temporal Entity ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 4ddd57c3..cfff449a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -28,7 +28,7 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index 68ceb697..fcd353c9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -40,7 +40,7 @@ ${attributeId}= speed ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 59cc7773..946d175e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -32,7 +32,7 @@ Update Context Source Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${registration_payload} + Check Updated Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index bca6b4d5..825a9c4c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -24,7 +24,6 @@ Update Context Source Registration Subscription ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} Check Updated Resource Set To ${subscription} *** Keywords *** -- GitLab From daaa643e1caba469a346beab683b857c5d951f83 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 22 Mar 2021 18:14:13 +0100 Subject: [PATCH 172/442] fix: fix batch entities expectations --- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 5 ++--- .../BatchEntities/CreateBatchOfEntities/003_02.robot | 5 ++--- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 5 ++--- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 5 ++--- .../BatchEntities/UpdateBatchOfEntities/005_03.robot | 5 ++--- .../BatchEntities/UpsertBatchOfEntities/004_01.robot | 5 ++--- .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 5 ++--- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 5 ++--- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 5 ++--- .../BatchEntities/UpsertBatchOfEntities/004_05.robot | 5 ++--- 10 files changed, 20 insertions(+), 30 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 314dd96c..21d1d9c3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -35,8 +35,7 @@ Batch Create Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Created Resources Set To ${entities_to_be_created} ${ignored_keys} + Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Created Resources Set To ${entities_to_be_created} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index 9d44a5ed..db1815a6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -32,10 +32,9 @@ Create a batch of two valid entities and one invalid entity ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} @{created_entities}= Create List ${first_entity} ${second_entity} - ${ignored_keys}= Create List ${context_regex_expr} - Check Created Resources Set To ${created_entities} ${ignored_keys} + Check Created Resources Set To ${created_entities} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 8d830ddd..3ba418cd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -39,9 +39,8 @@ Batch Update Entity Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${updated_entities} ${ignored_keys} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index e6ca0b0c..ae7849d4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -39,9 +39,8 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${updated_entities} ${ignored_keys} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 98ae8198..713e4a8d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -39,9 +39,8 @@ Update a batch of non existing and existing entities ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${updated_entities} ${ignored_keys} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index 3f6f4480..bfee1490 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -32,8 +32,7 @@ Batch Upsert Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index bede8155..8a4953f6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -36,9 +36,8 @@ Batch Upsert Non-existing And Existing Entities Scenarios @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index d4ee1825..b7ea1c59 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -32,9 +32,8 @@ Batch Upsert Existing Entities Scenarios @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${entities_to_be_upserted} ${ignored_keys} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index cc014f5a..c4539472 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -40,9 +40,8 @@ Batch Upsert Entities With Update Option Scenarios ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${updated_entities} ${ignored_keys} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 6875bbae..c5fcf6d4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -30,9 +30,8 @@ Upsert a batch of two valid entities and one invalid entity Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} - ${ignored_keys}= Create List ${context_regex_expr} - Check Updated Resources Set To ${upserted_entities} ${ignored_keys} + Check Updated Resources Set To ${upserted_entities} Batch Delete Entities @{expected_successful_entities_ids} -- GitLab From d10433af779ad0a7c6b68d2e6faa9891b07790a0 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 22 Mar 2021 18:51:28 +0100 Subject: [PATCH 173/442] fix: broken tests in 012_02 --- .../PartialAttribute/012_02.robot | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot index c01c314b..6e0455e7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot @@ -12,13 +12,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes-sample.jsonld ${status_code}= 400 -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -#012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld -#012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME +012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld 012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld -#012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld -#012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -#012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld +012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld +012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld *** Keywords *** Update Attributes @@ -26,8 +26,7 @@ Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 - ${init_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${init_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -35,7 +34,7 @@ Update Attributes Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - [Teardown] Delete Entity by Id Returning Response ${init_entity_id} + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} -- GitLab From 321c885914d682a68f91f0ed0053e54369b5f416 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 23 Mar 2021 09:43:44 +0100 Subject: [PATCH 174/442] fix: misc typos and bad references --- .../Consumption/Entity/QueryEntities/019_01_02.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_05.robot | 4 ++-- .../Provision/EntityAttributes/PartialAttribute/012_02.robot | 2 +- .../TemporalEntityAttributes/DeleteAttribute/015_02.robot | 4 ++-- .../CreateContextSourceRegistration/033_06.robot | 2 +- .../CreateContextSourceRegistration/033_07.robot | 2 +- .../CreateContextSourceRegistration/033_09.robot | 2 +- ...ion.jsonld => building-attributes-query-expectation.json} | 5 +---- 9 files changed, 11 insertions(+), 14 deletions(-) rename data/entities/expectations/{building-attributes-query-expectation.jsonld => building-attributes-query-expectation.json} (78%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 52cfd88a..68a4c229 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -33,7 +33,7 @@ Query several entities based on the entities types Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 907b16f2..f02a303a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-simple-attributes-sample.jsonld ${filename2}= building-minimal-sample.jsonld -${expectation_filename}= building-attributes-query-expectation.jsonld +${expectation_filename}= building-attributes-query-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index bfd336ed..cced0788 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -24,8 +24,8 @@ Query several entities based on a list of properties Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - @{entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot index 6e0455e7..a2e7311f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot @@ -18,7 +18,7 @@ ${status_code}= 400 012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld 012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld 012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.jsonld +012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.json *** Keywords *** Update Attributes diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index f6ca104a..92882e6e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -14,7 +14,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** ENTITY_ID ATTRIBUTE_ID 015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed -015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId speed 015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalidName *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index fcdaa412..92f758fc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration containing a JSON-LD @context with a JSON content type diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index e47a4400..ca15e145 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration using a JSON-LD @context obtained from the request payload diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index a7e8f6b3..53349e38 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration with a Link header and a JSON-LD content type diff --git a/data/entities/expectations/building-attributes-query-expectation.jsonld b/data/entities/expectations/building-attributes-query-expectation.json similarity index 78% rename from data/entities/expectations/building-attributes-query-expectation.jsonld rename to data/entities/expectations/building-attributes-query-expectation.json index a15e428c..30988db6 100644 --- a/data/entities/expectations/building-attributes-query-expectation.jsonld +++ b/data/entities/expectations/building-attributes-query-expectation.json @@ -11,8 +11,5 @@ "https://ngsi-ld-test-suite/context#subCategory": { "type": "Property", "value": "tourism" - }, - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] + } } \ No newline at end of file -- GitLab From 056029ff8649d0f9313afcbd216b2bd42e06178b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 23 Mar 2021 16:16:05 +0100 Subject: [PATCH 175/442] fix: response checks for 007_02 --- .../CreateTemporalRepresentationOfEntity/007_02.robot | 4 ++-- resources/ApiUtils.resource | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index a1b5b9b9..d2b25d75 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -26,8 +26,8 @@ Create Temporal Entity From File [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id [Tags] mandatory - ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response['status']} + Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 4c0e7d7f..fd1f48db 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -321,9 +321,9 @@ Create Temporal Representation Of Entity Selecting Content Type Using Session ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} - Output request - Output response + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any + Output ${response.json()} + Set Test Variable ${response} [return] ${response} Append Attribute To Temporal Entity -- GitLab From 21afd0e014b759f8b78c2d309cad27b0a9226add Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Tue, 23 Mar 2021 15:45:59 +0000 Subject: [PATCH 176/442] added tags --- TP/NGSI-LD/CommonBehaviours/043.robot | 7 ++++++- TP/NGSI-LD/CommonBehaviours/044_01.robot | 4 ++-- TP/NGSI-LD/CommonBehaviours/044_02.robot | 6 +++++- TP/NGSI-LD/CommonBehaviours/044_03.robot | 9 +++++++-- TP/NGSI-LD/CommonBehaviours/044_04.robot | 9 +++++---- TP/NGSI-LD/CommonBehaviours/044_05.robot | 14 +++++++------- .../Entity/QueryEntities/019_01_01.robot | 2 +- .../Entity/QueryEntities/019_01_02.robot | 2 +- .../Entity/QueryEntities/019_01_03.robot | 2 +- .../Entity/QueryEntities/019_01_04.robot | 2 +- .../Entity/QueryEntities/019_01_05.robot | 2 +- .../Entity/QueryEntities/019_02_01.robot | 2 +- .../Entity/QueryEntities/019_02_02.robot | 2 +- .../Entity/QueryEntities/019_02_03.robot | 2 +- .../Entity/QueryEntities/019_02_04.robot | 2 +- .../Entity/QueryEntities/019_02_05.robot | 2 +- .../Entity/QueryEntities/019_03_01.robot | 2 +- .../Entity/QueryEntities/019_03_02.robot | 2 +- .../Entity/QueryEntities/019_03_03.robot | 2 +- .../Entity/QueryEntities/019_03_04.robot | 2 +- .../Entity/QueryEntities/019_03_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_06.robot | 2 +- .../Entity/RetrieveEntity/018_01_01.robot | 2 +- .../Entity/RetrieveEntity/018_01_02.robot | 2 +- .../Entity/RetrieveEntity/018_01_03.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_02.robot | 2 +- .../Entity/RetrieveEntity/018_03_01.robot | 2 +- .../Entity/RetrieveEntity/018_03_02.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_04.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_05.robot | 2 +- .../Provision/Entities/CreateEntity/001_01.robot | 2 +- .../Provision/Entities/CreateEntity/001_02.robot | 2 +- .../Provision/Entities/CreateEntity/001_03.robot | 2 +- .../Provision/Entities/DeleteEntity/002_01.robot | 2 +- .../Provision/Entities/DeleteEntity/002_02.robot | 5 +---- .../Provision/Entities/DeleteEntity/002_03.robot | 2 +- .../AppendEntityAttributes/010_01.robot | 4 ++-- .../AppendEntityAttributes/010_02.robot | 4 ++-- .../AppendEntityAttributes/010_03.robot | 2 +- .../DeleteEntityAttribute/013_01.robot | 2 +- .../DeleteEntityAttribute/013_02.robot | 2 +- .../DeleteEntityAttribute/013_03.robot | 2 +- .../012_01.robot | 2 +- .../012_02.robot | 2 +- .../012_03.robot | 2 +- .../UpdateEntityAttributes/011_01.robot | 2 +- .../UpdateEntityAttributes/011_02.robot | 4 ++-- .../UpdateEntityAttributes/011_03.robot | 2 +- .../007_01.robot | 2 +- .../007_02.robot | 4 ++-- .../009_01.robot | 2 +- .../009_02.robot | 2 +- .../009_03.robot | 2 +- .../008_01.robot | 2 +- .../AppendAttributes/014_01.robot | 4 ++-- .../AppendAttributes/014_02.robot | 4 ++-- .../AppendAttributes/014_03.robot | 6 +++--- .../DeleteAttribute/015_01.robot | 2 +- .../DeleteAttribute/015_02.robot | 2 +- .../DeleteAttribute/015_03.robot | 2 +- .../DeleteAttributeInstance/017_01.robot | 2 +- .../DeleteAttributeInstance/017_02.robot | 2 +- .../DeleteAttributeInstance/017_03.robot | 2 +- .../PartialUpdateAttributeInstance/016_01.robot | 2 +- .../PartialUpdateAttributeInstance/016_02.robot | 2 +- .../PartialUpdateAttributeInstance/016_03.robot | 2 +- .../033_01_01.robot | 2 +- .../033_01_02.robot | 2 +- .../033_01_03.robot | 2 +- .../CreateContextSourceRegistration/033_02.robot | 4 ++-- .../CreateContextSourceRegistration/033_03.robot | 2 +- .../DeleteContextSourceRegistration/035_01.robot | 2 +- .../DeleteContextSourceRegistration/035_02.robot | 3 ++- .../DeleteContextSourceRegistration/035_03.robot | 3 ++- .../UpdateContextSourceRegistration/034_01.robot | 2 +- .../UpdateContextSourceRegistration/034_02.robot | 6 ++++-- .../UpdateContextSourceRegistration/034_03.robot | 3 ++- 79 files changed, 120 insertions(+), 103 deletions(-) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{PartialAttribute => PartialAttributeUpdate}/012_01.robot (97%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{PartialAttribute => PartialAttributeUpdate}/012_02.robot (96%) rename TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/{PartialAttribute => PartialAttributeUpdate}/012_03.robot (97%) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index b372613b..142e68f6 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -22,6 +22,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with *** Test Cases *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) + [Tags] cb ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -33,6 +34,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with 043_02 Create subscription [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) + [Tags] cb ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -45,6 +47,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with 043_03 Create Temporal Representation of Entities [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) + [Tags] cb ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} @@ -56,6 +59,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with 043_04 Batch entity create [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + [Tags] cb ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -72,7 +76,8 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) - + [Tags] cb + ${registration_id_prefix}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 76c1db84..d68d9a43 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -17,7 +17,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa *** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory + [Tags] cb ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -29,7 +29,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa 044_01_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] mandatory + [Tags] cb ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index df734374..575e1c28 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -27,6 +27,7 @@ ${teatype}= Vehicle *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) + [Tags] cb ${id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -41,6 +42,7 @@ ${teatype}= Vehicle 044_02_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) + [Tags] cb ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -55,6 +57,7 @@ ${teatype}= Vehicle 044_02_03_endpoint /csourceRegistrations/ [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) + [Tags] cb ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} @@ -71,7 +74,8 @@ ${teatype}= Vehicle 044_02_04_endpoint /temporal/entities [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) - + [Tags] cb + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index bf43562b..3528c706 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -23,6 +23,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) + [Tags] cb ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -35,6 +36,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld 044_03_02_endpoint patch /subscriptions/{subscriptionId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) + [Tags] cb ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -47,6 +49,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld 044_03_03_endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) + [Tags] cb ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} @@ -56,6 +59,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld 044_03_04_endpoint post /subscriptions/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) + [Tags] cb ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} @@ -64,8 +68,8 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) + [Tags] cb ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -82,7 +86,8 @@ ${building_filename}= building-simple-attributes-sample.jsonld 044_03_06_endpoint post /temporal/entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) - + [Tags] cb + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} Check Response Status Code 415 ${response['status']} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 29d07ad6..6c18ce19 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -17,7 +17,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_04_01_endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) - + [Tags] cb ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -29,7 +29,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_02_endpoint get /subscriptions/{subscriptionId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - + [Tags] cb ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -41,18 +41,19 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - + [Tags] cb Query Context Source Registrations type=Building accept=${accept} Check Response Status Code Set To ${status_code} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) - + [Tags] cb Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code Set To ${status_code} 044_04_05_endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] cb ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} Check Response Status Code Set To ${status_code} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index ff5b8b74..63a19792 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -31,7 +31,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** 044_05_01_endpoint create /entities/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) - + [Tags] cb ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} @@ -40,7 +40,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) - + [Tags] cb ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -52,7 +52,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_03_endpoint create /subscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) - + [Tags] cb ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} @@ -61,7 +61,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_04_endpoint update /subscriptions/{subscriptionId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) - + [Tags] cb ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -72,7 +72,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_05_endpoint create /temporal/entities/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) - + [Tags] cb ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} Check Response Status Code ${status_code} ${response['status']} @@ -81,7 +81,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_06_endpoint create /entityOperations/create [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) - + [Tags] cb ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${building_filename} ${first_entity_id} @@ -97,7 +97,7 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld 044_05_07_endpoint create /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) - + [Tags] cb ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index ecfc5ef3..2eb584fb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 68a4c229..1d50b403 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] /entities/ 5_7_2 + [Tags] e-query ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index 39ea8c61..2efbe8c7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index f02a303a..3ab17f1e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -16,7 +16,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index cced0788..ee5a040a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index ef79b489..44a06a01 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] /entityOperations/query 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index f6af3e50..2c7f38e8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -19,7 +19,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] /entityOperations/query 5_7_2 + [Tags] e-query ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 9aeaf9d1..5a03982a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] /entityOperations/query 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 7f452b27..abdf9277 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] /entityOperations/query 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 5d4e3b9c..ac3180e0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] /entityOperations/query 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index f1943fdf..df265e25 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index 11f6c57f..27999f71 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] /entities/ 5_7_2 + [Tags] e-query ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 6c68087d..0748e726 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 5d0d706a..e654127e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -14,7 +14,7 @@ ${invalid_attribute_two}= invalid_attribute_two *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 55dd7fd3..7ff6f582 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -13,7 +13,7 @@ ${invalid_geometry_property}= invalid_geometry_property *** Test Cases *** Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty - [Tags] /entities/ 5_7_2 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index a33aed3d..5dc141e1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] /entities/ 6_3_7 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 848bf7d7..f039491d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] /entities/ 6_3_7 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index c1c82572..24449d21 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] /entities/ 6_3_10 + [Tags] e-query ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index 30c74bf4..e24b6363 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -12,7 +12,7 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Test Cases *** 018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id - [Tags] /entities/{entityId} 5_7_1 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index ea8cacb9..8cf46a7a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity - [Tags] /entities/{entityId} 5_7_1 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index 5441bf70..84cbe8c8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -13,7 +13,7 @@ ${geometry_property}= location *** Test Cases *** 018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity - [Tags] /entities/{entityId} 5_7_1 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index b834764b..205cd45e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] /entities/{entityId} 5_7_1 + [Tags] e-retrieve ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 911bb58e..1c395b95 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] /entities/{entityId} 5_6_6 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 8e8567e3..fb98631f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] /entities/{entityId} 5_6_6 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 19e29198..6ed147c7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] /entities/{entityId} 6_3_7 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index c8f6e021..03e25d7a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] /entities/{entityId} 6_3_7 + [Tags] e-retrieve ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index b35b351b..e0110f98 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Create Entity Scenarios [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity - [Tags] /entities/ 5_6_1 + [Tags] e-create ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index f56d3171..08a08459 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -14,7 +14,7 @@ Test Template Create Entity With Invalid Request Scenarios Create Entity With Invalid Request Scenarios [Arguments] ${filename} [Documentation] Check that you cannot create an entity with an invalid request - [Tags] /entities/ 5_6_1 + [Tags] e-create Request Entity From File ${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index 9a8fdc7a..4bf9f692 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -12,7 +12,7 @@ ${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id - [Tags] /entities/ 5_6_1 + [Tags] e-create ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index c7529b70..18a6a726 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity [Documentation] Check that you can delete an entity by id - [Tags] /entities/{entityId} 5_6_6 + [Tags] e-delete ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 01389e53..06759db6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -6,18 +6,15 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Delete Entity Scenarios - *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 002_02_01_Delete an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 002_02_02_Delete an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} - - *** Keywords *** Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id - [Tags] /entities/{entityId} 5_6_6 + [Tags] e-delete ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index 3e24e854..173c2a9a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -11,7 +11,7 @@ ${expected_status_code}= 404 *** Test Case *** Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system - [Tags] /entities/{entityId} 5_6_6 + [Tags] e-delete ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 459ef3ae..47e7044b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -22,7 +22,7 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld Append Attributes Without Params [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] /entities/{entityId}/attrs/ 5_6_3 + [Tags] ea-append ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -40,7 +40,7 @@ Append Attributes Without Params Append Attributes With Params [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] /entities/{entityId}/attrs/ 5_6_3 + [Tags] ea-append ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index df72dac1..8c37dfa1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -23,7 +23,7 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] /entities/{entityId}/attrs/ 5_6_3 + [Tags] ea-append ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -38,7 +38,7 @@ Append Attributes Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] mandatory + [Tags] ea-append ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 6a44fa90..571c4776 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system - [Tags] /entities/{entityId}/attrs/ 5_6_3 + [Tags] ea-append ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index ded9683c..b1787fcf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} [Documentation] Check that you can delete an attribute from an entity - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 + [Tags] ea-delete ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index e936abc9..1fe60065 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 + [Tags] ea-delete ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 565357f3..44bcd412 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_5 + [Tags] ea-delete ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 5f4cf328..90b2e6c4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -19,7 +19,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 + [Tags] ea-partial-update ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index a2e7311f..a44b4b2c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 + [Tags] ea-partial-update ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot similarity index 97% rename from TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index 7e5d3c11..c272e8fe 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttribute/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] /entities/{entityId}/attrs/{attrId} 5_6_4 + [Tags] ea-partial-update ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 3383cc02..8c3814dc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -19,7 +19,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] /entities/{entityId}/attrs/ 5_6_2 + [Tags] ea-update ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index 139e8db4..caa56a98 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -19,7 +19,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Update Attributes [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] /entities/{entityId}/attrs/ 5_6_2 + [Tags] ea-update ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -35,7 +35,7 @@ Update Attributes Update entity attributes with invalid entity fragments [Arguments] ${filename} ${fragment_filename} [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] /entities/{entityId}/attrs/ 5_6_2 + [Tags] ea-update ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 84b9017a..a51364ad 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system - [Tags] /entities/{entityId}/attrs/ 5_6_2 + [Tags] ea-update ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 9f686e75..f571e11e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -17,7 +17,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Create Temporal Entity [Arguments] ${filename} ${content_type} [Documentation] Check that you can create a temporal representation of an entity - [Tags] mandatory + [Tags] te-create ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index a1b5b9b9..2181c640 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Create Temporal Entity From File [Arguments] ${filename} [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id - [Tags] mandatory + [Tags] te-create ${response}= Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${response['status']} @@ -34,7 +34,7 @@ Create Temporal Entity From File Create Temporal Entity [Arguments] ${entity_id} ${filename} [Documentation] Check that you cannot create a temporal entity with an invalid @context - [Tags] mandatory + [Tags] te-create ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index 31e14452..9e1cd15c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -11,7 +11,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** Delete a temporal representation of an entity with simple temporal properties [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties - [Tags] mandatory + [Tags] te-delete ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 4c713c74..7523ef73 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -17,7 +17,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Delete Temporal Entity [Arguments] ${status_code} ${id} [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId - [Tags] mandatory + [Tags] te-delete ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index c3a1e041..623dc548 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -11,7 +11,7 @@ ${status_code}= 404 *** Test Cases *** 009_03 Delete a temporal representation of an entity with a unknown entity id [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] mandatory + [Tags] te-delete ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 648043e1..92d0e973 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -13,7 +13,7 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.jso *** Test Cases *** 008_01_Update a temporal representation of an entity with simple temporal properties [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties - [Tags] mandatory + [Tags] te-update ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 3ed13340..0c6b8efa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -11,9 +11,9 @@ ${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld *** Test Cases *** -014_01_02_Add an attribute to a temporal entity with simple temporal properties +014_01_Add an attribute to a temporal entity with simple temporal properties [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity - [Tags] mandatory + [Tags] tea-append ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 962e1094..3f54d664 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -27,7 +27,7 @@ ${status_code}= 400 Add an Attribute To a Temporal Entity [Arguments] ${update_filename} [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content - [Tags] mandatory + [Tags] tea-append ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} @@ -41,7 +41,7 @@ Add an Attribute To a Temporal Entity Fail To Add Attribute To Temporal Entity [Arguments] ${id} [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] mandatory + [Tags] tea-append ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 1b99ecae..35dbef38 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with not found EnityId +Documentation Check that an error is raised if you delete a temporal enitity with not found Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -12,8 +12,8 @@ ${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you delete a temporal enitity with not found EnityId EnityId - [Tags] mandatory + [Documentation] Check that an error is raised if you delete a temporal enitity with not found + [Tags] tea-append ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index a28746d0..accfcc41 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= fuelLevel Delete Attribute From A Temporal Entity [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties - [Tags] mandatory + [Tags] tea-delete ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 92882e6e..a60ed2c6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld Delete attribute from temporal entity with unknow entity/attribute id [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id - [Tags] mandatory + [Tags] tea-delete ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 7623acb4..69b2a936 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -20,7 +20,7 @@ ${status_code}= 404 Delete Attribute [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId - [Tags] mandatory + [Tags] tea-delete ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index cfff449a..55ac920d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -13,7 +13,7 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei *** Test Cases *** 017_01_Delete an attribute instance in temporal representation of an entity [Documentation] Check that you can delete an attribute instance in temporal representation of an entity - [Tags] mandatory + [Tags] tea-instance-delete ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index c9818876..0c84cdde 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Delete attribute instance [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] mandatory + [Tags] tea-instance-delete ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index e0cbd05b..71c2f159 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -21,7 +21,7 @@ ${status_code}= 404 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] mandatory + [Tags] tea-instance-delete ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index fcd353c9..04bf35e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -14,7 +14,7 @@ ${attributeId}= speed *** Test Cases *** 016_01_Partially update an attribute instance of a temporal representation of an entity [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity - [Tags] mandatory + [Tags] tea-partial-update ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index 436e9a8a..c6b49eae 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -25,7 +25,7 @@ ${status_code}= 400 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] mandatory + [Tags] tea-partial-update ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index ccb1005e..29353298 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -22,7 +22,7 @@ ${status_code}= 404 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] mandatory + [Tags] tea-partial-update ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 8b55bf46..caea99db 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date - [Tags] /csourceRegistrations/ 5_9_2 + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 6df8fa4b..8e321c45 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires - [Tags] /csourceRegistrations/ 5_9_2 + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index ef0aec23..31c29796 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -11,7 +11,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create Context Source Registration Without A Sprecified ID [Documentation] Check that when creating a context source registration without specifying an ID - [Tags] /csourceRegistrations/ 5_9_2 + [Tags] csr-create ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} ${request} ${response}= Create Context Source Registration With Return ${payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 8be35651..02ca1da0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -20,7 +20,7 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample. Create Context Source With Invalid Content [Arguments] ${filename} [Documentation] Check that you cannot create a context source with invalid content - [Tags] /csourceRegistrations/ 5_9_2 + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} @@ -33,7 +33,7 @@ Create Context Source With Invalid Content Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file - [Tags] mandatory + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 823ba804..ad3fabdc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -12,7 +12,7 @@ ${filename}= csourceRegistrations/context-source-registration-simple-sample.jso *** Test Cases *** Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists - [Tags] /csourceRegistrations/ 5_9_2 + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index fc8f2502..0f07d4d2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j *** Test Case *** Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id - [Tags] /csourceRegistrations/{registrationId} 5_9_4 + [Tags] csr-delete ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 610c8100..34d7105a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -18,7 +18,8 @@ ${filename}= context-source-registration-simple-sample.jsonld Delete Context Source [Arguments] ${invalid_registration_id} [Documentation] Check that you cannot delete a context source registration under some conditions - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-delete + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index 1f44f028..484a96ee 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -12,7 +12,8 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j *** Test Case *** Delete a context source registration by id [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-delete + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 946d175e..74130707 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -17,7 +17,7 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: Update Context Source [Arguments] ${filename} ${update_filename} [Documentation] Check that you can update a context source registration by id - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 6b74a12d..203241be 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -27,7 +27,8 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample.j Update Context Source [Arguments] ${registration_id} ${fragment_filename} [Documentation] Check that you cannot update a context source registration under some conditions - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-update + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} @@ -43,7 +44,8 @@ Update Context Source Update a context source registration if the request body is invalid [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-update + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 63127614..e1714f64 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -11,7 +11,8 @@ ${filename}= context-source-registration-simple-sample.jsonld *** Test Case *** Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system - [Tags] /csourceRegistrations/{registrationId} 5_9_3 + [Tags] csr-update + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} -- GitLab From 2473b9d793470868d9f69ea0f263ec2d02cb9e62 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 08:28:11 +0100 Subject: [PATCH 177/442] fix: provide a context when deleting an temporal attribute in 015_01 --- .../DeleteAttribute/015_01.robot | 6 +++--- resources/ApiUtils.resource | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index a28746d0..df04dadf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -13,9 +13,9 @@ ${status_code}= 204 ${attribute_id}= fuelLevel *** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE -015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld 015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld -015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld +015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld *** Keywords *** Delete Attribute From A Temporal Entity @@ -27,7 +27,7 @@ Delete Attribute From A Temporal Entity ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll} + ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fd1f48db..0afbae81 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -355,9 +355,14 @@ Partial Update Attribute From Temporal Entity [return] ${response} Delete Attribute From Temporal Entity - [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} + [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?datasetId=${datasetId}&deleteAll=${deleteAll} headers=${headers} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + @{params}= Create List + Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} + Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} Output request Output response [return] ${response} -- GitLab From d5ac040c86ca2b87f5bc3980f2fdbc37d9862259 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 08:47:36 +0100 Subject: [PATCH 178/442] fix: use an invalid name for attribute in 015_02 (see 4.6.4) --- .../TemporalEntityAttributes/DeleteAttribute/015_02.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 92882e6e..e3de547a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -15,7 +15,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** ENTITY_ID ATTRIBUTE_ID 015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed 015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId speed -015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalidName +015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalid(Name *** Keywords *** Delete attribute from temporal entity with unknow entity/attribute id @@ -28,7 +28,7 @@ Delete attribute from temporal entity with unknow entity/attribute id Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false Check Response Status Code ${status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -- GitLab From d20cf3dc1b928c769d957ada6158f69f7a54065e Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 09:08:09 +0100 Subject: [PATCH 179/442] fix: missing contexts in 015_03 and 017_01 --- .../DeleteAttribute/015_03.robot | 4 ++-- .../DeleteAttributeInstance/017_01.robot | 4 ++-- resources/ApiUtils.resource | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 7623acb4..7e3ec60f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId +Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -25,7 +25,7 @@ Delete Attribute ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${EMPTY} false + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index cfff449a..19676246 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -20,10 +20,10 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 0afbae81..e6ddaac7 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -381,11 +381,12 @@ Delete Several Temporal Representations Of Entities END Get Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${accept}=${EMPTY} ${options}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${accept}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary ${options_length} = Get Length ${options} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request @@ -393,8 +394,10 @@ Get Temporal Representation Of Entity [return] ${response} Delete Attribute Instance From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} + &{headers}= Create Dictionary + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} headers=${headers} Output request Output response [return] ${response} -- GitLab From 3d10a30749c7da8904e1af980532176044eaecdc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 09:14:18 +0100 Subject: [PATCH 180/442] fix: missing contexts in 017_02 --- .../DeleteAttributeInstance/017_02.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index c9818876..9e09a23a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -17,7 +17,7 @@ ${status_code}= 400 017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} 017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId 017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} -017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} 017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} *** Keywords *** @@ -26,7 +26,7 @@ Delete attribute instance [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right [Tags] mandatory - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -37,6 +37,6 @@ Create Id ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} \ No newline at end of file -- GitLab From a87a2cca8bb68619c2c0c2d1fca5b0108e544e93 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 11:47:19 +0100 Subject: [PATCH 181/442] fix: missing contexts in 017_03 --- .../DeleteAttributeInstance/017_03.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index e0cbd05b..f161063f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -23,7 +23,7 @@ Partially Update Temporal Entity [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] mandatory - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON} + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -36,6 +36,6 @@ Create Id ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} \ No newline at end of file -- GitLab From cc1a3e2a22bf2b87e8c91d297d813512f79b621e Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 11:06:09 +0000 Subject: [PATCH 182/442] fixed 043_XX tests --- TP/NGSI-LD/CommonBehaviours/043.robot | 12 ++++++------ ...registration-unretrievable-context-sample.jsonld} | 5 ++++- .../building-unretrievable-context-sample.jsonld | 7 +++++++ ...subscription-unretrievable-context-sample.jsonld} | 5 ++++- ...presentation-unretrievable-context-sample.jsonld} | 3 +++ 5 files changed, 24 insertions(+), 8 deletions(-) rename data/csourceRegistrations/{context-source-registration-without-context-sample.jsonld => context-source-registration-unretrievable-context-sample.jsonld} (71%) create mode 100644 data/entities/building-unretrievable-context-sample.jsonld rename data/{csourceSubscriptions/subscription-without-context-sample.jsonld => subscriptions/subscription-unretrievable-context-sample.jsonld} (84%) rename data/temporalEntities/{bus-temporal-representation-without-context-sample.jsonld => bus-temporal-representation-unretrievable-context-sample.jsonld} (94%) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index b372613b..416fec3b 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -8,18 +8,18 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${expected_status_code}= 503 ${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-minimal-without-context-sample.jsonld +${building_filename}= building-unretrievable-context-sample.jsonld ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-without-context-sample.jsonld +${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld ${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= bus-temporal-representation-without-context-sample.jsonld +${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-without-context-sample.jsonld +${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** Test Cases *** +*** comments *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) @@ -69,7 +69,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} - +*** Test Cases *** 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) diff --git a/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld similarity index 71% rename from data/csourceRegistrations/context-source-registration-without-context-sample.jsonld rename to data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld index b4a6b06e..41532009 100644 --- a/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld @@ -10,5 +10,8 @@ ] } ], - "endpoint":"http://my.csource.org:1026" + "endpoint":"http://my.csource.org:1026", + "@context":[ + "unretrievableContext" + ] } \ No newline at end of file diff --git a/data/entities/building-unretrievable-context-sample.jsonld b/data/entities/building-unretrievable-context-sample.jsonld new file mode 100644 index 00000000..908a6b09 --- /dev/null +++ b/data/entities/building-unretrievable-context-sample.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "@context": [ + "unretrievableContext" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-context-sample.jsonld b/data/subscriptions/subscription-unretrievable-context-sample.jsonld similarity index 84% rename from data/csourceSubscriptions/subscription-without-context-sample.jsonld rename to data/subscriptions/subscription-unretrievable-context-sample.jsonld index 36860f5b..f4a60a81 100644 --- a/data/csourceSubscriptions/subscription-without-context-sample.jsonld +++ b/data/subscriptions/subscription-unretrievable-context-sample.jsonld @@ -12,5 +12,8 @@ "uri":"http://my.endpoint.org/notify", "accept":"application/json" } - } + }, + "@context":[ + "contextUnretrievable" + ] } \ No newline at end of file diff --git a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld similarity index 94% rename from data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld rename to data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld index 9a70e2bd..c6f12825 100644 --- a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld +++ b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld @@ -40,5 +40,8 @@ "value":124, "observedAt":"2020-08-01T14:07:00Z" } + ], + "@context":[ + "unretrievableContext" ] } \ No newline at end of file -- GitLab From 60256cf531ab394e6b43cf3fc57d94c18f1ee369 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 24 Mar 2021 12:08:37 +0100 Subject: [PATCH 183/442] fix: contexts and fragments in 016_XX --- .../PartialUpdateAttributeInstance/016_01.robot | 4 ++-- .../PartialUpdateAttributeInstance/016_02.robot | 6 +++--- .../PartialUpdateAttributeInstance/016_03.robot | 4 ++-- ...ehicle-temporal-instanceid-update-fragment.jsonld | 12 ++---------- resources/ApiUtils.resource | 3 ++- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index fcd353c9..8c14a013 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -21,12 +21,12 @@ ${attributeId}= speed ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index 436e9a8a..baee0486 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -18,7 +18,7 @@ ${status_code}= 400 016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} 016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId 016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} -016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalidId ${valid_instanceId} +016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} 016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} *** Keywords *** @@ -27,7 +27,7 @@ Partially Update Temporal Entity [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right [Tags] mandatory - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -38,6 +38,6 @@ Create Id ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index ccb1005e..081c8112 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -24,7 +24,7 @@ Partially Update Temporal Entity [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] mandatory - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -37,6 +37,6 @@ Create Id ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld index d7433ad6..df735987 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld @@ -1,12 +1,4 @@ { - "speed":[ - { - "type":"Property", - "value":129, - "observedAt":"2020-09-01T12:03:00Z" - } - ], - "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" - ] + "value":129, + "observedAt":"2020-09-01T12:03:00Z" } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e6ddaac7..b6e4bb36 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -346,8 +346,9 @@ Append Attribute To Temporal Entity Using Session [return] ${response} Partial Update Attribute From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} Output request -- GitLab From ec4db086139c5cc3dd0b6707c5a0c289e73c79bb Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 12:15:40 +0000 Subject: [PATCH 184/442] fixed 044_01 tests --- TP/NGSI-LD/CommonBehaviours/043.robot | 5 ++--- TP/NGSI-LD/CommonBehaviours/044_01.robot | 14 +++++++------- .../vehicle-brandname-fragment.json | 6 ++++++ .../vehicle-brandname-fragment.jsonld | 2 +- resources/ApiUtils.resource | 3 ++- 5 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 data/entities/fragmentEntities/vehicle-brandname-fragment.json diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 416fec3b..2e7a10d4 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -19,7 +19,7 @@ ${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonl ${registration_id_prefix}= urn:ngsi-ld:Registration: ${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** comments *** +*** Test Cases *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) @@ -42,7 +42,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre [Teardown] Delete Subscription ${subscription_id} - 043_03 Create Temporal Representation of Entities [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) @@ -69,7 +68,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} -*** Test Cases *** + 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 76c1db84..5aecce32 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -7,14 +7,14 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-brandname-fragment.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.json ${attribute_id}= brandName ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json -*** Test Cases *** +*** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory @@ -22,11 +22,11 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} - + 044_01_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory @@ -34,7 +34,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Subscription ${subscription_id} diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.json b/data/entities/fragmentEntities/vehicle-brandname-fragment.json new file mode 100644 index 00000000..2675db21 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.json @@ -0,0 +1,6 @@ +{ + "https://ngsi-ld-test-suite/context#brandName": { + "type": "Property", + "value": "BMW" + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index 14fcc171..8c229718 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -3,5 +3,5 @@ "type": "Property", "value": "BMW" }, - "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "@context": "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fd1f48db..06b03997 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -190,9 +190,10 @@ Delete Entity Attributes [return] ${response} Partial Update Entity Attributes - [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} + [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} Output request -- GitLab From 2ad06d030629ee678eacd4a74a632e61cab083a0 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 24 Mar 2021 16:09:17 +0100 Subject: [PATCH 185/442] fix: update subscription update fragments --- .../subscription-building-entities-sample.json | 10 +++++++++- .../subscription-expiresAt-future-update-sample.json | 10 +++++++++- .../subscription-expiresAt-update-sample.json | 10 +++++++++- ...cription-isActive-expiresAt-null-update-sample.json | 10 +++++++++- .../subscription-isActive-expiresAt-update-sample.json | 10 +++++++++- ...ion-isActive-null-expiresAt-null-update-sample.json | 10 +++++++++- ...cription-isActive-null-expiresAt-update-sample.json | 10 +++++++++- .../subscription-isActive-null-update-sample.json | 10 +++++++++- .../fragments/subscription-isActive-update-sample.json | 10 +++++++++- .../subscription-null-properties-update-sample.json | 1 + .../fragments/subscription-update-sample.json | 1 + .../subscription-vehicle-entities-sample.json | 10 +++++++++- 12 files changed, 92 insertions(+), 10 deletions(-) diff --git a/data/subscriptions/fragments/subscription-building-entities-sample.json b/data/subscriptions/fragments/subscription-building-entities-sample.json index 57564a2b..b6630a1f 100644 --- a/data/subscriptions/fragments/subscription-building-entities-sample.json +++ b/data/subscriptions/fragments/subscription-building-entities-sample.json @@ -1,7 +1,15 @@ { + "type":"Subscription", "entities":[ { "type":"Building" } - ] + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json index e4f92ec3..6fde92ed 100644 --- a/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json +++ b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json @@ -1,3 +1,11 @@ { - "expiresAt": "2030-08-01T22:07:00Z" + "type":"Subscription", + "expiresAt": "2030-08-01T22:07:00Z", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json index 237d2180..f2a5c090 100644 --- a/data/subscriptions/fragments/subscription-expiresAt-update-sample.json +++ b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json @@ -1,3 +1,11 @@ { - "expiresAt": "2020-08-01T22:07:00Z" + "type":"Subscription", + "expiresAt": "2020-08-01T22:07:00Z", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json index 5cc9b6ab..7680219d 100644 --- a/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json @@ -1,4 +1,12 @@ { + "type":"Subscription", "isActive": true, - "expiresAt": null + "expiresAt": null, + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json index f72957cd..dfe8088f 100644 --- a/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json @@ -1,4 +1,12 @@ { + "type":"Subscription", "isActive": true, - "expiresAt": "2030-08-01T22:07:00Z" + "expiresAt": "2030-08-01T22:07:00Z", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json index 1ec15711..7e55e792 100644 --- a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json @@ -1,4 +1,12 @@ { + "type":"Subscription", "isActive": null, - "expiresAt": null + "expiresAt": null, + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json index 1780d379..4b240e94 100644 --- a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json @@ -1,4 +1,12 @@ { + "type":"Subscription", "isActive": null, - "expiresAt": "2030-08-01T22:07:00Z" + "expiresAt": "2030-08-01T22:07:00Z", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-update-sample.json index fe8bb4e2..95e24778 100644 --- a/data/subscriptions/fragments/subscription-isActive-null-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-null-update-sample.json @@ -1,3 +1,11 @@ { - "isActive": null + "type":"Subscription", + "isActive": null, + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-update-sample.json b/data/subscriptions/fragments/subscription-isActive-update-sample.json index b432cbae..f8305c0c 100644 --- a/data/subscriptions/fragments/subscription-isActive-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-update-sample.json @@ -1,3 +1,11 @@ { - "isActive": false + "type":"Subscription", + "isActive": false, + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-null-properties-update-sample.json b/data/subscriptions/fragments/subscription-null-properties-update-sample.json index f044a4da..9e92aa01 100644 --- a/data/subscriptions/fragments/subscription-null-properties-update-sample.json +++ b/data/subscriptions/fragments/subscription-null-properties-update-sample.json @@ -1,4 +1,5 @@ { + "type":"Subscription", "notification":{ "format":"keyValues", "endpoint":null diff --git a/data/subscriptions/fragments/subscription-update-sample.json b/data/subscriptions/fragments/subscription-update-sample.json index 81f39078..694a088e 100644 --- a/data/subscriptions/fragments/subscription-update-sample.json +++ b/data/subscriptions/fragments/subscription-update-sample.json @@ -1,4 +1,5 @@ { + "type":"Subscription", "notification":{ "format":"keyValues", "endpoint":{ diff --git a/data/subscriptions/fragments/subscription-vehicle-entities-sample.json b/data/subscriptions/fragments/subscription-vehicle-entities-sample.json index ff01dca7..ce3a2d11 100644 --- a/data/subscriptions/fragments/subscription-vehicle-entities-sample.json +++ b/data/subscriptions/fragments/subscription-vehicle-entities-sample.json @@ -1,7 +1,15 @@ { + "type":"Subscription", "entities":[ { "type":"Vehicle" } - ] + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } } \ No newline at end of file -- GitLab From 976f6d2a0fda16d2e08fdba84d53340b4c437563 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 17:46:16 +0000 Subject: [PATCH 186/442] fixed 044_02 --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 30 +++++--- ...-simple-attributes-sample-expectation.json | 16 ++-- ...e-temporal-representation-expectation.json | 44 ----------- ...-representation-044-02-04-expectation.json | 76 +++++++++++++++++++ resources/AssertionUtils.resource | 9 +++ 5 files changed, 113 insertions(+), 62 deletions(-) delete mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index df734374..2294ca7c 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -11,7 +11,7 @@ ${building_expectation}= building-simple-attributes-sample-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_filename}= subscriptions/subscription-sample.jsonld ${subscription_expectation}= subscription-sample-expectation.json ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -21,9 +21,12 @@ ${registration_type}= Vehicle ${tea_id_prefix}= urn:ngsi-ld:Vehicle: ${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_expectation}= vehicle-temporal-representation-expectation.json +${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json ${teatype}= Vehicle +${content_type}= application/json +${accept}= application/json, */* + *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) @@ -31,14 +34,15 @@ ${teatype}= Vehicle ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${id} + ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Entity by Id Returning Response ${id} - 044_02_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) @@ -49,7 +53,9 @@ ${teatype}= Vehicle ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Subscription ${id} @@ -62,10 +68,12 @@ ${teatype}= Vehicle ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Context Source Registration ${registration_id} @@ -75,10 +83,12 @@ ${teatype}= Vehicle ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expectation.json index df3301bf..436ba724 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.json +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.json @@ -1,22 +1,22 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Building", - "https://ngsi-ld-test-suite/context#name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "https://ngsi-ld-test-suite/context#airQualityLevel": { + "type": "Building", + "airQualityLevel": { "type": "Property", "value": 4, "observedAt": "2020-09-09T16:40:00.000Z", "unitCode": "C62" }, - "https://ngsi-ld-test-suite/context#almostFull": { + "almostFull": { "type": "Property", "value": false }, - "https://ngsi-ld-test-suite/context#subCategory": { + "subCategory": { "type": "Property", "value": "tourism" + }, + "name": { + "type": "Property", + "value": "Eiffel Tower" } } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json b/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json deleted file mode 100644 index 7917df3c..00000000 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Vehicle", - "https://ngsi-ld-test-suite/context#brandName": { - "type": "Property", - "value": "BMW", - "instanceId": "urn:ngsi-ld:76739600-3d5c-4cfd-939d-34742a13b52d" - }, - "https://ngsi-ld-test-suite/context#fuelLevel": [ - { - "type": "Property", - "datasetId": "urn:ngsi-ld:Vehicle:12345-fuel", - "value": 40, - "instanceId": "urn:ngsi-ld:0f6e7514-e3ed-46a6-9e9f-6bb02ff687bf", - "observedAt": "2020-09-01T14:07:00Z" - }, - { - "type": "Property", - "value": 53, - "instanceId": "urn:ngsi-ld:59ebe244-14d6-4428-87e1-cd313748125c", - "observedAt": "2020-09-01T13:05:00Z" - }, - { - "type": "Property", - "value": 67, - "instanceId": "urn:ngsi-ld:8bfeea42-8ed3-4d4e-a942-c389229bd6ff", - "observedAt": "2020-09-01T12:03:00Z" - } - ], - "https://ngsi-ld-test-suite/context#speed": [ - { - "type": "Property", - "value": 120, - "instanceId": "urn:ngsi-ld:ec47b86f-656e-4182-b1c2-fbe5af5b4862", - "observedAt": "2020-09-01T12:03:00Z" - }, - { - "type": "Property", - "value": 80, - "instanceId": "urn:ngsi-ld:f3ffc7ad-e562-4081-bd8a-5dda92ab0ffd", - "observedAt": "2020-09-01T12:05:00Z" - } - ] -} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json b/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json new file mode 100644 index 00000000..6fb2bc95 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 54eac1a5..5a134a79 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -43,6 +43,14 @@ Check Request Containing Accept Header Set To Run Keyword If 'Accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['Accept']} ignore_order=True Run Keyword If 'accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['accept']} ignore_order=True +Check Response Headers Containing Content-Type set to + [Arguments] ${response} ${expected_content_type_content} + Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + +Check Response Headers Link Not Empty + [Arguments] ${response} + Should Not Be Empty ${response['headers']['Link']} + # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to @@ -53,6 +61,7 @@ Check Response Headers Containing URI set to # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers + Check Response Headers ID Not Empty [Arguments] ${response} -- GitLab From 3a71a84589536d36d13d00a1a3fa75f831107c4d Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 18:49:59 +0000 Subject: [PATCH 187/442] fixed 044_03 --- TP/NGSI-LD/CommonBehaviours/044_03.robot | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index bf43562b..814983fc 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.json +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${vehicle_attribute}= speed ${vehicle_fragment}= vehicle-brandname-fragment.jsonld @@ -20,6 +20,8 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-simple-attributes-sample.jsonld +${content_type}= application/xml + *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) @@ -28,7 +30,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${EMPTY} + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -40,7 +42,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${id} ${subscription_fragment} ${EMPTY} + ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Subscription ${id} @@ -49,7 +51,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -58,13 +60,12 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -73,7 +74,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${EMPTY} + Batch Create Entities @{entities_to_be_created} content_type=${content_type} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 415 @@ -84,7 +85,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file -- GitLab From 486edb7321c61885e30811316bd87bc9548fd178 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 25 Mar 2021 12:51:16 +0000 Subject: [PATCH 188/442] fixed 044_05 --- TP/NGSI-LD/CommonBehaviours/044_04.robot | 4 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 96 ++++-------------------- 2 files changed, 15 insertions(+), 85 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 29d07ad6..64e96436 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -42,8 +42,8 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - Query Context Source Registrations type=Building accept=${accept} - Check Response Status Code Set To ${status_code} + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index ff5b8b74..7b7662db 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -8,100 +8,30 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${accept}= application/geo+json ${status_code}= 406 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building - ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= context-source-registration-with-expiration-sample.jsonld -${registration_fragment}= context-source-registration-with-expiration-expectation.json - -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= brandName -${vehicle_fragment}= vehicle-brandname-fragment.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** -044_05_01_endpoint create /entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Entity by Id ${entity_id} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_05_03_endpoint create /subscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) - - ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${subscriptions_id} - -044_05_04_endpoint update /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) - +044_05_01 Retrieve subscription by id + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Subscription ${id} -044_05_05_endpoint create /temporal/entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - -044_05_06_endpoint create /entityOperations/create - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} accept=${accept} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} +044_05_02 Query temporal entities + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} Check Response Status Code Set To ${status_code} - [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_05_07_endpoint create /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file +044_05_03 Query context source registration + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} \ No newline at end of file -- GitLab From 537c99706d6d0a7117f2eeec9e8c7fb931d82d8c Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 25 Mar 2021 13:08:33 +0000 Subject: [PATCH 189/442] fixed 019_03_04 --- .../Consumption/Entity/QueryEntities/019_03_04.robot | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 5d0d706a..290bf36d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -8,9 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= invalid_attribute_one -${invalid_attribute_two}= invalid_attribute_two - +${invalid_attribute_one}= subCategory= +${invalid_attribute_two}= airQualityLevel= *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect -- GitLab From 4dd07760c43e9736c28d089ba9b6dc9b3d7bfae3 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 09:56:35 +0000 Subject: [PATCH 190/442] fixed 019_03_05 and 007_01_XX --- .../Entity/QueryEntities/019_03_05.robot | 12 +++++++---- .../007_01.robot | 5 +++-- ...building-invalid-geoproperty-sample.jsonld | 21 +++++++++++++++++++ resources/ApiUtils.resource | 5 ++++- 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 data/entities/building-invalid-geoproperty-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 55dd7fd3..8f061207 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -6,9 +6,12 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_geometry_property}= invalid_geometry_property +${filename}= building-location-attribute-sample.jsonld +${entity_type}= Building +${georel}= invalid +${geometry}= Point +${coordinates}= [-8.503,41.202] +${geoproperty}= location *** Test Cases *** Query entitites when the request has a wrong geometryProperty @@ -23,7 +26,8 @@ Query entitites when the request has a wrong geometryProperty Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${invalid_geometry_property} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geoproperty} georel=${georel} geometry=${geometry} coordinates=${coordinates} context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 9f686e75..a44a455f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -24,7 +24,8 @@ Create Temporal Entity Check Response Status Code 201 ${response['status']} ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Set Test Variable ${response} - Check Created Resource Set To ${created_temporal_entity} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context + Check Created Resource Set To ${created_temporal_entity} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/data/entities/building-invalid-geoproperty-sample.jsonld b/data/entities/building-invalid-geoproperty-sample.jsonld new file mode 100644 index 00000000..d3c8987d --- /dev/null +++ b/data/entities/building-invalid-geoproperty-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "geoQ":{ + "georel":"near;maxDistance==2000", + "geometry":"Point", + "coordinates":[-8.52,41.2], + "geoproperty": "location" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 06b03997..26d1fe61 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -68,7 +68,7 @@ Query Entity [return] ${request} ${response} Query Entities - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} + [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${georel}=${EMPTY} ${coordinates}=${EMPTY} ${geometry}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${accept_length} = Get Length ${accept} ${options_length} = Get Length ${options} @@ -85,6 +85,9 @@ Query Entities Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} ${response}= GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 4b8610a22f6e5137b1a4c596bf48aa794e5d4881 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 09:58:34 +0000 Subject: [PATCH 191/442] removed unused file --- ...building-invalid-geoproperty-sample.jsonld | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 data/entities/building-invalid-geoproperty-sample.jsonld diff --git a/data/entities/building-invalid-geoproperty-sample.jsonld b/data/entities/building-invalid-geoproperty-sample.jsonld deleted file mode 100644 index d3c8987d..00000000 --- a/data/entities/building-invalid-geoproperty-sample.jsonld +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "subCategory": { - "type": "Property", - "value": ["tourism"] - }, - "geoQ":{ - "georel":"near;maxDistance==2000", - "geometry":"Point", - "coordinates":[-8.52,41.2], - "geoproperty": "location" - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" - ] -} \ No newline at end of file -- GitLab From c0f0150a79a4616a0bfab63d48ae55089a54022d Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 10:21:06 +0000 Subject: [PATCH 192/442] fixed 019_03_04 --- .../Consumption/Entity/QueryEntities/019_03_04.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 290bf36d..fe88f51a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= subCategory= -${invalid_attribute_two}= airQualityLevel= +${invalid_attribute_one}= invalid +${invalid_attribute_two}= invalid *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect -- GitLab From 0abdc32eeee5dd94e58f05a11f4a21f754a2bcf8 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 12:46:42 +0000 Subject: [PATCH 193/442] removed check accept header request on 044_02 --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 5 ----- resources/AssertionUtils.resource | 6 ------ 2 files changed, 11 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 2294ca7c..8b853cdb 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -25,7 +25,6 @@ ${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json ${teatype}= Vehicle ${content_type}= application/json -${accept}= application/json, */* *** Test Cases *** 044_02_01_endpoint /entities/{entityId} @@ -37,7 +36,6 @@ ${accept}= application/json, */* ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -53,7 +51,6 @@ ${accept}= application/json, */* ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -71,7 +68,6 @@ ${accept}= application/json, */* ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -87,7 +83,6 @@ ${accept}= application/json, */* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5a134a79..431c61d0 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -37,12 +37,6 @@ Check Response Body Content ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${all_ignored_paths} Should Be True ${comparison_result} msg=Entity Comparison Failed -Check Request Containing Accept Header Set To - [Arguments] ${request} ${expected_accept_content} - - Run Keyword If 'Accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['Accept']} ignore_order=True - Run Keyword If 'accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['accept']} ignore_order=True - Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} -- GitLab From def6e219537638dd0a5e324d446b8913c695fc95 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 17:01:47 +0000 Subject: [PATCH 194/442] fixed tags --- TP/NGSI-LD/CommonBehaviours/043.robot | 10 +++++----- TP/NGSI-LD/CommonBehaviours/044_01.robot | 4 ++-- TP/NGSI-LD/CommonBehaviours/044_02.robot | 8 ++++---- TP/NGSI-LD/CommonBehaviours/044_03.robot | 12 ++++++------ TP/NGSI-LD/CommonBehaviours/044_04.robot | 10 +++++----- TP/NGSI-LD/CommonBehaviours/044_05.robot | 8 ++++++-- .../Consumption/Entity/QueryEntities/019_01_01.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_02.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_03.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_01_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_01.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_02.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_03.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_02_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_01.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_02.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_03.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_04.robot | 2 +- .../Consumption/Entity/QueryEntities/019_05.robot | 2 +- .../Consumption/Entity/QueryEntities/019_06.robot | 2 +- .../Entity/RetrieveEntity/018_01_01.robot | 2 +- .../Entity/RetrieveEntity/018_01_02.robot | 2 +- .../Entity/RetrieveEntity/018_01_03.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_02.robot | 2 +- .../Entity/RetrieveEntity/018_03_01.robot | 2 +- .../Entity/RetrieveEntity/018_03_02.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_04.robot | 2 +- .../Consumption/Entity/RetrieveEntity/018_05.robot | 2 +- .../Provision/Entities/CreateEntity/001_01.robot | 2 +- .../Provision/Entities/CreateEntity/001_02.robot | 2 +- .../Provision/Entities/CreateEntity/001_03.robot | 2 +- .../Provision/Entities/DeleteEntity/002_01.robot | 2 +- .../Provision/Entities/DeleteEntity/002_02.robot | 2 +- .../Provision/Entities/DeleteEntity/002_03.robot | 2 +- .../AppendEntityAttributes/010_01.robot | 4 ++-- .../AppendEntityAttributes/010_02.robot | 4 ++-- .../AppendEntityAttributes/010_03.robot | 2 +- .../DeleteEntityAttribute/013_01.robot | 2 +- .../DeleteEntityAttribute/013_02.robot | 2 +- .../DeleteEntityAttribute/013_03.robot | 2 +- .../PartialAttributeUpdate/012_01.robot | 2 +- .../PartialAttributeUpdate/012_02.robot | 2 +- .../PartialAttributeUpdate/012_03.robot | 2 +- .../UpdateEntityAttributes/011_01.robot | 2 +- .../UpdateEntityAttributes/011_02.robot | 4 ++-- .../UpdateEntityAttributes/011_03.robot | 2 +- .../007_01.robot | 2 +- .../007_02.robot | 4 ++-- .../009_01.robot | 2 +- .../009_02.robot | 2 +- .../009_03.robot | 2 +- .../008_01.robot | 2 +- .../AppendAttributes/014_01.robot | 2 +- .../AppendAttributes/014_02.robot | 4 ++-- .../AppendAttributes/014_03.robot | 2 +- .../DeleteAttribute/015_01.robot | 2 +- .../DeleteAttribute/015_02.robot | 2 +- .../DeleteAttribute/015_03.robot | 2 +- .../DeleteAttributeInstance/017_01.robot | 2 +- .../DeleteAttributeInstance/017_02.robot | 2 +- .../DeleteAttributeInstance/017_03.robot | 2 +- .../PartialUpdateAttributeInstance/016_01.robot | 2 +- .../PartialUpdateAttributeInstance/016_02.robot | 2 +- .../PartialUpdateAttributeInstance/016_03.robot | 2 +- 68 files changed, 95 insertions(+), 91 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index bc20343d..8d786bd8 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -22,7 +22,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre *** Test Cases *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) - [Tags] cb + [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -34,7 +34,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre 043_02 Create subscription [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) - [Tags] cb + [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -46,7 +46,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre 043_03 Create Temporal Representation of Entities [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) - [Tags] cb + [Tags] te-create 5_2_2 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} @@ -58,7 +58,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre 043_04 Batch entity create [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) - [Tags] cb + [Tags] be-create 5_2_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -75,7 +75,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) - [Tags] cb + [Tags] csr-create 5_2_2 ${registration_id_prefix}= Generate Random Entity Id ${registration_id_prefix} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 9388f0ea..7bac18a4 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -17,7 +17,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-sample.js *** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] cb + [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -29,7 +29,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-sample.js 044_01_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] cb + [Tags] sub-update 6_3_4 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 4c394567..452f1283 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -29,7 +29,7 @@ ${content_type}= application/json *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) - [Tags] cb + [Tags] e-query 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -44,7 +44,7 @@ ${content_type}= application/json 044_02_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) - [Tags] cb + [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -60,7 +60,7 @@ ${content_type}= application/json 044_02_03_endpoint /csourceRegistrations/ [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) - [Tags] cb + [Tags] csr-query 6_3_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} @@ -78,7 +78,7 @@ ${content_type}= application/json 044_02_04_endpoint /temporal/entities [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) - [Tags] cb + [Tags] te-query 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index 7714b5b8..48921ab8 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -25,7 +25,7 @@ ${content_type}= application/xml *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) - [Tags] cb + [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -38,7 +38,7 @@ ${content_type}= application/xml 044_03_02_endpoint patch /subscriptions/{subscriptionId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) - [Tags] cb + [Tags] sub-update 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} @@ -51,7 +51,7 @@ ${content_type}= application/xml 044_03_03_endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) - [Tags] cb + [Tags] e-create 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} @@ -61,7 +61,7 @@ ${content_type}= application/xml 044_03_04_endpoint post /subscriptions/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) - [Tags] cb + [Tags] sub-create 6_3_4 ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} @@ -71,7 +71,7 @@ ${content_type}= application/xml 044_03_05_endpoint post /entityOperations/create [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) - [Tags] cb + [Tags] be-create 6_3_4 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -88,7 +88,7 @@ ${content_type}= application/xml 044_03_06_endpoint post /temporal/entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) - [Tags] cb + [Tags] te-create 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index ed60727d..e583bee4 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -17,7 +17,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_04_01_endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) - [Tags] cb + [Tags] e-query 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -29,7 +29,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_02_endpoint get /subscriptions/{subscriptionId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - [Tags] cb + [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -41,19 +41,19 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - + [Tags] csr-query 6_3_4 ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} Check Response Status Code ${status_code} ${response['status']} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) - [Tags] cb + [Tags] csrsub-query Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code Set To ${status_code} 044_04_05_endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - [Tags] cb + [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} Check Response Status Code Set To ${status_code} \ No newline at end of file diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index 7b7662db..cfc518b7 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -14,7 +14,8 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_05_01 Retrieve subscription by id [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - + [Tags] sub-retrieve 6_3_4 + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @@ -26,12 +27,15 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_05_02 Query temporal entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] te-query 6_3_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} Check Response Status Code Set To ${status_code} - 044_05_03 Query context source registration [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] csr-query 6_3_4 + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} Check Response Status Code ${status_code} ${response['status']} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index 2eb584fb..a4e05bf8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 1d50b403..62e392a1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -20,7 +20,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types - [Tags] e-query + [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index 2efbe8c7..0bbd5057 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 3ab17f1e..82c16cf3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -16,7 +16,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index ee5a040a..a5195181 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index 44a06a01..5c91b7df 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -13,7 +13,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index 2c7f38e8..a7f62d5d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -19,7 +19,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] e-query + [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 5a03982a..20051903 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -14,7 +14,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index abdf9277..83e0c229 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index ac3180e0..1329bdcd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -14,7 +14,7 @@ ${geometry_property}= location *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index df265e25..98d7157b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -14,7 +14,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index 27999f71..97f6fb4d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -16,7 +16,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] e-query + [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 0748e726..0f9e28ae 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -13,7 +13,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern* *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index fda25b0a..94a4bb55 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -13,7 +13,7 @@ ${invalid_attribute_two}= invalid *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 5aac5efb..cc4acfca 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -16,7 +16,7 @@ ${geoproperty}= location *** Test Cases *** Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty - [Tags] e-query + [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index 5dc141e1..a815d4bd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -14,7 +14,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] e-query + [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index f039491d..2631f1c6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] e-query + [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 24449d21..8673edcf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -14,7 +14,7 @@ ${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] e-query + [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index e24b6363..e7223e10 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -12,7 +12,7 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Test Cases *** 018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id - [Tags] e-retrieve + [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 8cf46a7a..11f04b74 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -14,7 +14,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity - [Tags] e-retrieve + [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index 84cbe8c8..657ec527 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -13,7 +13,7 @@ ${geometry_property}= location *** Test Cases *** 018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity - [Tags] e-retrieve + [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index 205cd45e..e770eb73 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -13,7 +13,7 @@ Test Template Get Entity With Invalid/Missing Id Get Entity With Invalid/Missing Id [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] e-retrieve + [Tags] e-retrieve 5_7_1 ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 1c395b95..d6a3d98e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] e-retrieve + [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index fb98631f..985577af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -12,7 +12,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] e-retrieve + [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 6ed147c7..fd5a4e10 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -13,7 +13,7 @@ ${options_parameter}= keyValues *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] e-retrieve + [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 03e25d7a..4c2fe22f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -14,7 +14,7 @@ ${accept_header}= application/geo+json *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] e-retrieve + [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index e0110f98..977f9e32 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: Create Entity Scenarios [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity - [Tags] e-create + [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 08a08459..67ecf66c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -14,7 +14,7 @@ Test Template Create Entity With Invalid Request Scenarios Create Entity With Invalid Request Scenarios [Arguments] ${filename} [Documentation] Check that you cannot create an entity with an invalid request - [Tags] e-create + [Tags] e-create 5_6_1 Request Entity From File ${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index 4bf9f692..94ec7535 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -12,7 +12,7 @@ ${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id - [Tags] e-create + [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 18a6a726..ae6a22b2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity [Documentation] Check that you can delete an entity by id - [Tags] e-delete + [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 06759db6..180f5383 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -14,7 +14,7 @@ Test Template Delete Entity Scenarios Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id - [Tags] e-delete + [Tags] e-delete 5_6_6 ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index 173c2a9a..bd0f6b98 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -11,7 +11,7 @@ ${expected_status_code}= 404 *** Test Case *** Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system - [Tags] e-delete + [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 47e7044b..649db970 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -22,7 +22,7 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld Append Attributes Without Params [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] ea-append + [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -40,7 +40,7 @@ Append Attributes Without Params Append Attributes With Params [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} [Documentation] Check that you can append entity attributes - [Tags] ea-append + [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 8c37dfa1..8ac8bd78 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -23,7 +23,7 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld Append Attributes [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] ea-append + [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -38,7 +38,7 @@ Append Attributes Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] ea-append + [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 571c4776..9bd68f13 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system - [Tags] ea-append + [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index b1787fcf..b351933a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= speed Delete Attributes [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} [Documentation] Check that you can delete an attribute from an entity - [Tags] ea-delete + [Tags] ea-delete 5_6_5 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 1fe60065..fa408e24 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] ea-delete + [Tags] ea-delete 5_6_5 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 44bcd412..a5c0045a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] ea-delete + [Tags] ea-delete 5_6_5 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 90b2e6c4..34be12a3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -19,7 +19,7 @@ ${status_code}= 204 Update Attributes [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] ea-partial-update + [Tags] ea-partial-update 5_6_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index a44b4b2c..5a2e8d9a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Update Attributes [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] ea-partial-update + [Tags] ea-partial-update 5_6_4 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index c272e8fe..ccc3f787 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -23,7 +23,7 @@ ${attribute_id}= speed Partial Update Attributes [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] ea-partial-update + [Tags] ea-partial-update 5_6_4 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 8c3814dc..6c3023bc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -19,7 +19,7 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld Update Attributes [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes - [Tags] ea-update + [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index caa56a98..5a841877 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -19,7 +19,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Update Attributes [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] ea-update + [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} @@ -35,7 +35,7 @@ Update Attributes Update entity attributes with invalid entity fragments [Arguments] ${filename} ${fragment_filename} [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] ea-update + [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index a51364ad..a7b8f8c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -11,7 +11,7 @@ ${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system - [Tags] ea-update + [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index a27aea71..44068231 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -17,7 +17,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Create Temporal Entity [Arguments] ${filename} ${content_type} [Documentation] Check that you can create a temporal representation of an entity - [Tags] te-create + [Tags] te-create 5_6_11 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 6f24a410..a0bb98c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Create Temporal Entity From File [Arguments] ${filename} [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id - [Tags] te-create + [Tags] te-create 5_6_11 Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To 400 @@ -34,7 +34,7 @@ Create Temporal Entity From File Create Temporal Entity [Arguments] ${entity_id} ${filename} [Documentation] Check that you cannot create a temporal entity with an invalid @context - [Tags] te-create + [Tags] te-create 5_6_11 ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index 9e1cd15c..86be87ab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -11,7 +11,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** Delete a temporal representation of an entity with simple temporal properties [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties - [Tags] te-delete + [Tags] te-delete 5_6_16 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 7523ef73..febcab1b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -17,7 +17,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: Delete Temporal Entity [Arguments] ${status_code} ${id} [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId - [Tags] te-delete + [Tags] te-delete 5_6_16 ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 623dc548..ca1ddecc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -11,7 +11,7 @@ ${status_code}= 404 *** Test Cases *** 009_03 Delete a temporal representation of an entity with a unknown entity id [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] te-delete + [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 92d0e973..187b4fdd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -13,7 +13,7 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.jso *** Test Cases *** 008_01_Update a temporal representation of an entity with simple temporal properties [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties - [Tags] te-update + [Tags] te-update 5_6_11 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 0c6b8efa..5ba687cb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -13,7 +13,7 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expect *** Test Cases *** 014_01_Add an attribute to a temporal entity with simple temporal properties [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity - [Tags] tea-append + [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 3f54d664..6f74360a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -27,7 +27,7 @@ ${status_code}= 400 Add an Attribute To a Temporal Entity [Arguments] ${update_filename} [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content - [Tags] tea-append + [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} @@ -41,7 +41,7 @@ Add an Attribute To a Temporal Entity Fail To Add Attribute To Temporal Entity [Arguments] ${id} [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] tea-append + [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 35dbef38..ca6a91d8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -13,7 +13,7 @@ ${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity [Documentation] Check that an error is raised if you delete a temporal enitity with not found - [Tags] tea-append + [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 877040ba..3195ddde 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -21,7 +21,7 @@ ${attribute_id}= fuelLevel Delete Attribute From A Temporal Entity [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties - [Tags] tea-delete + [Tags] tea-delete 5_6_13 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 0700e964..549b6db5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -21,7 +21,7 @@ ${filename}= vehicle-temporal-representation-sample.jsonld Delete attribute from temporal entity with unknow entity/attribute id [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id - [Tags] tea-delete + [Tags] tea-delete 5_6_13 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 3c8ad64e..9cf8171c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -20,7 +20,7 @@ ${status_code}= 404 Delete Attribute [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId - [Tags] tea-delete + [Tags] tea-delete 5_6_13 ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 4cd3b075..06362ab8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -13,7 +13,7 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instancei *** Test Cases *** 017_01_Delete an attribute instance in temporal representation of an entity [Documentation] Check that you can delete an attribute instance in temporal representation of an entity - [Tags] tea-instance-delete + [Tags] tea-instance-delete 5_6_15 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 3318e277..100e5074 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -24,7 +24,7 @@ ${status_code}= 400 Delete attribute instance [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] tea-instance-delete + [Tags] tea-instance-delete 5_6_15 ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 98a78c7e..978a63ee 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -21,7 +21,7 @@ ${status_code}= 404 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] tea-instance-delete + [Tags] tea-instance-delete 5_6_15 ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index 9a5e330f..fdc04f72 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -14,7 +14,7 @@ ${attributeId}= speed *** Test Cases *** 016_01_Partially update an attribute instance of a temporal representation of an entity [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity - [Tags] tea-partial-update + [Tags] tea-partial-update 5_6_14 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index d761f966..2af24e34 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -25,7 +25,7 @@ ${status_code}= 400 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] tea-partial-update + [Tags] tea-partial-update 5_6_14 ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index 7c915c91..f3de30c0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -22,7 +22,7 @@ ${status_code}= 404 Partially Update Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] tea-partial-update + [Tags] tea-partial-update 5_6_14 ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} -- GitLab From 92d30505b9c1ec4dd29691f635870a0f79f7f99f Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 27 Mar 2021 12:08:32 +0100 Subject: [PATCH 195/442] feat: prefer a non-existing URL to check for 503 in 043 series of TCs --- ...text-source-registration-unretrievable-context-sample.jsonld | 2 +- data/entities/building-unretrievable-context-sample.jsonld | 2 +- .../subscription-unretrievable-context-sample.jsonld | 2 +- ...-temporal-representation-unretrievable-context-sample.jsonld | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld index 41532009..5d6274a8 100644 --- a/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld @@ -12,6 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "unretrievableContext" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-non-existing.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-unretrievable-context-sample.jsonld b/data/entities/building-unretrievable-context-sample.jsonld index 908a6b09..0393ff05 100644 --- a/data/entities/building-unretrievable-context-sample.jsonld +++ b/data/entities/building-unretrievable-context-sample.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "unretrievableContext" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-non-existing.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-unretrievable-context-sample.jsonld b/data/subscriptions/subscription-unretrievable-context-sample.jsonld index f4a60a81..76af1393 100644 --- a/data/subscriptions/subscription-unretrievable-context-sample.jsonld +++ b/data/subscriptions/subscription-unretrievable-context-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "contextUnretrievable" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-non-existing.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld index c6f12825..7eaec7d1 100644 --- a/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld +++ b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "unretrievableContext" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-non-existing.jsonld" ] } \ No newline at end of file -- GitLab From 4df7044590bf52b4dab28ee663d58f0af5194edc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 27 Mar 2021 12:13:06 +0100 Subject: [PATCH 196/442] fix: use a wildcard Accept header to avoid default application/json added by the lib --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 9 +++++---- resources/ApiUtils.resource | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 452f1283..27dc3527 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -34,7 +34,7 @@ ${content_type}= application/json ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} + ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} @@ -50,7 +50,7 @@ ${content_type}= application/json ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} + ${request} ${response}= Retrieve Subscription ${id} accept=*/* Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} @@ -68,7 +68,7 @@ ${content_type}= application/json ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} @@ -82,8 +82,9 @@ ${content_type}= application/json ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index da2b42ac..51761cdb 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -571,7 +571,7 @@ Query Context Source Registrations &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} accept=${accept} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} @@ -824,7 +824,7 @@ Query Context Source Registrations With Return &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} accept=${accept} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} -- GitLab From 5704e0de5dfef55954fa465a5820d8bc687fa3b3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 29 Mar 2021 11:54:51 +0200 Subject: [PATCH 197/442] fix: link to utils script --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5e60d8a..ea65593b 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Launch the tests with the following command: ```$ robot --outputdir ./results .``` -For more running instructions please consult [scripts/run_tests.sh](https://github.com/easy-global-market/isg-cim-tpdl-demo/blob/rf-demo/scripts/run_tests.sh). +For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh). # Frameworks and libraries used in the project -- GitLab From 952f985aaceabb0d4f608b389610ed1161b26295 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 29 Mar 2021 15:21:55 +0200 Subject: [PATCH 198/442] fix: typo in error title for not available JSON-LD context --- resources/ApiUtils.resource | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 51761cdb..36efc472 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -30,7 +30,7 @@ ${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadReque ${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest ${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists -${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LDContextNotAvailable +${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable ${response} -- GitLab From 8a86b65ee9953ec53e2987809d6054c1b537a547 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 1 Apr 2021 17:46:27 +0100 Subject: [PATCH 199/442] fixed 043_05 --- TP/NGSI-LD/CommonBehaviours/043.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 8d786bd8..9635a7eb 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -77,12 +77,12 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) [Tags] csr-create 5_2_2 - ${registration_id_prefix}= Generate Random Entity Id ${registration_id_prefix} + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id_prefix} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - [Teardown] Delete Context Source Registration ${registration_id_prefix} \ No newline at end of file + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file -- GitLab From c58f5c7baca3de19f704be481d569da82966ebba Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 1 Apr 2021 18:11:27 +0100 Subject: [PATCH 200/442] added tags --- .../Subscription/CreateSubscription/031_01.robot | 2 +- .../Subscription/CreateSubscription/031_02.robot | 2 +- .../Subscription/CreateSubscription/031_03.robot | 2 +- .../Subscription/CreateSubscription/031_04.robot | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot index 948a9696..8b5a464c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot @@ -11,7 +11,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Cases *** Create Subscription [Documentation] Check that you can create a subscription - [Tags] /entities/ 5_6_1 + [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot index 41c18c20..120b7fd2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot @@ -13,7 +13,7 @@ Test Template Create Subscription With Invalid Request Create Subscription With Invalid Request [Arguments] ${filename} [Documentation] Check that you cannot create a subscription with an invalid request - [Tags] /entities/ 5_6_1 + [Tags] sub-create 5_8_1 Create Subscription From File ${filename} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot index 6553c3a7..661afb52 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld Create Subscription With Invalid/Empty Id [Arguments] ${subscription_id} [Documentation] Check that you cannot create a subscription with an invalid/empty id - [Tags] /entities/ 5_6_1 + [Tags] sub-create 5_8_1 ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot index 0590c7d7..76d279d7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot @@ -11,7 +11,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Case *** Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id - [Tags] /entities/ 5_6_1 + [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} -- GitLab From fcd34d768450ddab181ad004193a133bc3afce5f Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Fri, 2 Apr 2021 14:28:42 +0200 Subject: [PATCH 201/442] feat: add tags to test cases --- .../RetrieveAvailableAttributeInformation/027_01_01.robot | 2 +- .../RetrieveAvailableAttributeInformation/027_01_02.robot | 2 +- .../Discovery/RetrieveAvailableAttributes/025_01.robot | 3 ++- .../RetrieveAvailableEntityTypeInformation/024_01_01.robot | 2 +- .../RetrieveAvailableEntityTypeInformation/024_01_02.robot | 2 +- .../Discovery/RetrieveAvailableEntityTypes/022_01.robot | 3 ++- .../RetrieveDetailsOfAvailableAttributes/026_01.robot | 3 ++- .../RetrieveDetailsOfAvailableEntityTypes/023_01.robot | 3 ++- .../Consumption/Entity/RetrieveEntity/018_06.robot | 3 ++- .../QueryTemporalEvolutionOfEntities/021_01.robot | 4 ++-- .../QueryTemporalEvolutionOfEntities/021_02.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_03.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_04.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_05.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_06.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_07.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_08.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_09.robot | 3 ++- .../QueryTemporalEvolutionOfEntities/021_10.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_11.robot | 3 ++- .../QueryTemporalEvolutionOfEntities/021_12.robot | 2 +- .../QueryTemporalEvolutionOfEntities/021_13.robot | 3 ++- .../RetrieveTemporalEvolutionOfEntity/020_01.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_02.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_03.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_04.robot | 4 +++- .../RetrieveTemporalEvolutionOfEntity/020_05.robot | 3 ++- .../RetrieveTemporalEvolutionOfEntity/020_06.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_07.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_08.robot | 2 +- .../RetrieveTemporalEvolutionOfEntity/020_09.robot | 4 +++- .../RetrieveTemporalEvolutionOfEntity/020_10.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 5 ++++- .../BatchEntities/CreateBatchOfEntities/003_02.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_03.robot | 3 ++- .../BatchEntities/CreateBatchOfEntities/003_04.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_05.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_06.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_07.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_08.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_09.robot | 2 +- .../BatchEntities/DeleteBatchOfEntities/006_01.robot | 2 +- .../BatchEntities/DeleteBatchOfEntities/006_02.robot | 2 +- .../BatchEntities/DeleteBatchOfEntities/006_03.robot | 3 ++- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 4 +++- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 4 +++- .../BatchEntities/UpdateBatchOfEntities/005_03.robot | 2 +- .../BatchEntities/UpdateBatchOfEntities/005_04.robot | 3 ++- .../BatchEntities/UpsertBatchOfEntities/004_01.robot | 4 +++- .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 4 +++- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 4 +++- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 4 +++- .../BatchEntities/UpsertBatchOfEntities/004_05.robot | 2 +- .../BatchEntities/UpsertBatchOfEntities/004_06.robot | 3 ++- .../Provision/Entities/CreateEntity/001_04.robot | 2 +- .../Provision/Entities/CreateEntity/001_05.robot | 2 +- .../Provision/Entities/CreateEntity/001_06.robot | 2 +- .../Provision/Entities/CreateEntity/001_07.robot | 2 +- .../Provision/Entities/CreateEntity/001_08.robot | 2 +- .../Provision/Entities/CreateEntity/001_09.robot | 2 +- .../Subscription/DeleteSubscription/032_01.robot | 3 ++- .../Subscription/DeleteSubscription/032_02.robot | 2 +- .../Subscription/DeleteSubscription/032_03.robot | 2 +- .../Subscription/QuerySubscriptions/031_01.robot | 2 +- .../Subscription/QuerySubscriptions/031_02.robot | 4 +++- .../Subscription/RetrieveSubscription/030_01.robot | 3 ++- .../Subscription/RetrieveSubscription/030_02.robot | 2 +- .../Subscription/RetrieveSubscription/030_03.robot | 2 +- .../Subscription/UpdateSubscription/029_01.robot | 3 ++- .../Subscription/UpdateSubscription/029_02.robot | 2 +- .../Subscription/UpdateSubscription/029_03.robot | 2 +- .../Subscription/UpdateSubscription/029_04.robot | 2 +- .../Subscription/UpdateSubscription/029_05.robot | 2 +- .../Subscription/UpdateSubscription/029_06.robot | 2 +- .../Subscription/UpdateSubscription/029_07.robot | 3 ++- .../Subscription/UpdateSubscription/029_08.robot | 5 ++++- .../Subscription/UpdateSubscription/029_09.robot | 2 +- .../Subscription/UpdateSubscription/029_10.robot | 2 +- .../Subscription/UpdateSubscription/029_11.robot | 2 +- .../CreateContextSourceRegistration/033_04.robot | 2 +- .../CreateContextSourceRegistration/033_05.robot | 2 +- .../CreateContextSourceRegistration/033_06.robot | 2 +- .../CreateContextSourceRegistration/033_07.robot | 2 +- .../CreateContextSourceRegistration/033_08.robot | 2 +- .../CreateContextSourceRegistration/033_09.robot | 2 +- .../QueryContextSourceRegistrations/037_01.robot | 3 ++- .../QueryContextSourceRegistrations/037_02.robot | 2 +- .../QueryContextSourceRegistrations/037_03.robot | 5 ++++- .../QueryContextSourceRegistrations/037_04.robot | 2 +- .../QueryContextSourceRegistrations/037_05.robot | 3 ++- .../QueryContextSourceRegistrations/037_06.robot | 3 ++- .../QueryContextSourceRegistrations/037_07.robot | 3 ++- .../QueryContextSourceRegistrations/037_08.robot | 2 +- .../QueryContextSourceRegistrations/037_09.robot | 5 ++++- .../QueryContextSourceRegistrations/037_10.robot | 4 +++- .../QueryContextSourceRegistrations/037_11.robot | 4 +++- .../RetrieveContextSourceRegistration/036_01.robot | 3 ++- .../RetrieveContextSourceRegistration/036_02.robot | 2 +- .../RetrieveContextSourceRegistration/036_03.robot | 2 +- .../RetrieveContextSourceRegistration/036_04.robot | 2 +- .../RetrieveContextSourceRegistration/036_05.robot | 3 ++- .../CreateContextSourceRegistrationSubscription/038_01.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_02.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_03.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_04.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_05.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_06.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_07.robot | 2 +- .../CreateContextSourceRegistrationSubscription/038_08.robot | 5 ++++- .../CreateContextSourceRegistrationSubscription/038_09.robot | 2 +- .../DeleteContextSourceRegistrationSubscription/042_01.robot | 2 +- .../DeleteContextSourceRegistrationSubscription/042_02.robot | 2 +- .../DeleteContextSourceRegistrationSubscription/042_03.robot | 2 +- .../NotificationBehaviour/047_01.robot | 2 +- .../NotificationBehaviour/047_02.robot | 2 +- .../NotificationBehaviour/047_03.robot | 2 +- .../NotificationBehaviour/047_04.robot | 2 +- .../NotificationBehaviour/047_05.robot | 2 +- .../NotificationBehaviour/047_06.robot | 2 +- .../NotificationBehaviour/047_07.robot | 3 ++- .../NotificationBehaviour/047_08.robot | 2 +- .../NotificationBehaviour/047_09.robot | 2 +- .../NotificationBehaviour/047_10.robot | 2 +- .../NotificationBehaviour/047_11.robot | 3 ++- .../NotificationBehaviour/047_12.robot | 2 +- .../NotificationBehaviour/047_13.robot | 2 +- .../NotificationBehaviour/047_14.robot | 2 +- .../NotificationBehaviour/047_15.robot | 2 +- .../NotificationBehaviour/047_16.robot | 4 +++- .../QueryContextSourceRegistrationSubscriptions/041_01.robot | 2 +- .../QueryContextSourceRegistrationSubscriptions/041_02.robot | 4 +++- .../QueryContextSourceRegistrationSubscriptions/041_03.robot | 5 +++-- .../QueryContextSourceRegistrationSubscriptions/041_04.robot | 5 +++-- .../040_01.robot | 2 +- .../040_02.robot | 2 +- .../040_03.robot | 2 +- .../UpdateContextSourceRegistrationSubscription/039_01.robot | 2 +- .../UpdateContextSourceRegistrationSubscription/039_02.robot | 2 +- .../UpdateContextSourceRegistrationSubscription/039_03.robot | 2 +- .../UpdateContextSourceRegistrationSubscription/039_04.robot | 3 ++- .../UpdateContextSourceRegistrationSubscription/039_05.robot | 2 +- 141 files changed, 213 insertions(+), 144 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index 8a474bff..2fadeb4c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -14,7 +14,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Case *** Retrieve Detailed Representation Of Available Attribute Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute - [Tags] mandatory + [Tags] ed-attr 5_7_10 Retrieve Attribute attribute_name=airQualityLevel diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index 9540d0e0..34c6949b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -15,7 +15,7 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json *** Test Case *** Retrieve Detailed Representation Of Available Attribute [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes - [Tags] mandatory + [Tags] ed-attr 5_7_10 Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 1ac097d1..ce78ce6b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -14,13 +14,14 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json + [Tags] ed-attrs 5_7_8 WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json + [Tags] ed-attrs 5_7_8 *** Keywords *** Retrieve Available Attributes [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD attributes - [Tags] mandatory Retrieve Attributes ${context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index 24e0143b..f58d3b95 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -14,7 +14,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Case *** Retrieve Detailed Representation Of Available Entity Type Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type - [Tags] mandatory + [Tags] ed-type 5_7_7 Retrieve Entity Type type=Building diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index 7b0c3efe..be6d2581 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -15,7 +15,7 @@ ${expectation_file}= types/expectations/entity-type-info-024-01-expectation.jso *** Test Case *** Retrieve Detailed Representation Of Available Entity Type [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type - [Tags] mandatory + [Tags] ed-type 5_7_7 Retrieve Entity Type type=Building context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 3fd3571d..50c1d452 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -16,13 +16,14 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json + [Tags] ed-types 5_7_5 WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json + [Tags] ed-types 5_7_5 *** Keywords *** Retrieve Available Entity Types [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD entity types - [Tags] mandatory Retrieve Entity Types ${context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index b0660b73..bf74cec7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -14,13 +14,14 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext ${EMPTY} types/expectations/attribute-026-01-01-expectation.json + [Tags] ed-attrs-details 5_7_9 WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json + [Tags] ed-attrs-details 5_7_9 *** Keywords *** Retrieve Details Of Available Attributes [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes - [Tags] mandatory Retrieve Attributes context=${context} details=${TRUE} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index 4fa7b912..5ea6183a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -16,13 +16,14 @@ ${second_filename}= vehicle-simple-attributes-sample.json *** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json + [Tags] ed-types-details 5_7_6 WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json + [Tags] ed-types-details 5_7_6 *** Keywords *** Retrieve Details Of Available Entity Types [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types - [Tags] mandatory Retrieve Entity Types context=${context} details=${TRUE} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index c380f352..3c731c3f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -17,13 +17,14 @@ ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-comp *** Test Cases *** CONTEXT EXPECTED_PAYLOAD EmptyJsonLdContext ${EMPTY} ${empty_jsonld_expectation_filename} + [Tags] e-retrieve 6_3_5 CreationTimeJsonLdContext ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} + [Tags] e-retrieve 6_3_5 *** Keywords *** Check Json-LD Resolution When retrieving an entity [Arguments] ${context} ${expected_payload} [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present - [Tags] mandatory ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 456e926e..a30567dc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -17,14 +17,14 @@ ${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld + [Tags] te-query 5_7_4 Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld - + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities [Arguments] ${timerel} ${timeAt} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities - [Tags] mandatory ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index 2b06f805..fe9fe306 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expectation.json *** Test Case *** Query the temporal evolution of certain attributes of entities [Documentation] Check that you can query the temporal evolution of certain attributes of entities - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index c80e431a..cf73e3fc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expectation.json *** Test Case *** Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index d262ea76..86b566cf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-04-expectation.json *** Test Case *** Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index 03ef92a9..11c1b0fd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-05-expectation.json *** Test Case *** Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index c584dc69..7b6ce083 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-06-expectation.json *** Test Case *** Query the temporal evolution of entities matching the given identifier(s) [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index be089a35..f3f3f739 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-07-expectation.json *** Test Case *** Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 7a2fc825..5615c6fc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -16,7 +16,7 @@ ${expectation_file}= vehicles-temporal-representation-021-08-expectation.json *** Test Case *** Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index ba0e83ee..4672ab2e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -16,13 +16,14 @@ ${expectation_file}= vehicles-temporal-representation-021-09-expectation.json *** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld + [Tags] te-query 5_7_4 Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities matching the given NGSI-LD geo-query [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query - [Tags] mandatory ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index d2b7dc00..d5a4af7f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -16,7 +16,7 @@ ${context_source_url}= http://${context_source_host}:${context_source_port} *** Test Case *** Query the temporal evolution of entities matching the given NGSI-LD context source filter [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter - [Tags] mandatory + [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 087be1fa..401b89fa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -19,13 +19,14 @@ ${expectation_file}= vehicles-temporal-representation-021-11-expectation.json *** Test Cases *** LIMIT EXPECTATION_FILE TEMPORAL_ENTITIES_REPRESENTATION_IDS Query Some entities ${2} vehicles-temporal-representation-021-11-01-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + [Tags] te-query 5_7_4 Query All entities ${20} vehicles-temporal-representation-021-11-02-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} ${third_temporal_entity_representation_id} + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities with a limit to the number of entities to be retrieved [Arguments] ${limit} ${expectation_file} @{temporal_entities_representation_ids} [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved - [Tags] mandatory ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index 6bfb3e01..91865dfc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -14,7 +14,7 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Query the temporal evolution of entities with an invalid request [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request - [Tags] mandatory + [Tags] te-query 5_7_4 Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index fddc62ad..b3b4994e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -15,13 +15,14 @@ ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample *** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld + [Tags] te-query 5_7_4 Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities using the entityOperations method [Arguments] ${payload_file} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method - [Tags] mandatory Query Temporal Representation Of Entities Via Post ${payload_file} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index d6ffc50b..cb7b5412 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -15,7 +15,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation *** Test Case *** Retrieve the temporal evolution of an entity [Documentation] Check that you can retrieve the temporal evolution of an entity - [Tags] mandatory + [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 80aaad87..c6a92e2a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -15,7 +15,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation *** Test Case *** Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context - [Tags] mandatory + [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index a23dc00b..22a0e539 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -15,7 +15,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation *** Test Case *** Retrieve the temporal evolution of certain attributes of an entity [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity - [Tags] mandatory + [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index f3b5cf89..0554218e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -14,14 +14,16 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld + [Tags] te-retrieve 5_7_3 Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld + [Tags] te-retrieve 5_7_3 Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld + [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Tags] mandatory Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index d7d6e7c3..780edef0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -14,13 +14,14 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-inst *** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld + [Tags] te-retrieve 5_7_3 Retrieve All Instances ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of the last N instances of entity attributes [Arguments] ${lastN} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes - [Tags] mandatory Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 9c591968..604b4340 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve the temporal evolution of an entity with an invalid id [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) - [Tags] mandatory + [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity invalidUri diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 2b5393ff..8d576807 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve the temporal evolution of a non-existing entity [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity - [Tags] mandatory + [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 909493fc..cdc0934c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -14,7 +14,7 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Retrieve the temporal evolution of non-existing entity attributes [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes - [Tags] mandatory + [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index b93dc652..ca17f3e2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -14,14 +14,16 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT After after ${EMPTY} ${EMPTY} + [Tags] te-retrieve 5_7_3 Before before ${EMPTY} ${EMPTY} + [Tags] te-retrieve 5_7_3 Between between 2020-08-01T12:00:00Z ${EMPTY} + [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity with an invalid request content [Arguments] ${timerel} ${timeAt} ${endTimeAt} [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content - [Tags] mandatory Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index bd14fb81..4cba1f70 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -15,7 +15,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation *** Test Case *** Retrieve the temporal evolution of an entity with the simplified temporal representation [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation - [Tags] mandatory + [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 21d1d9c3..4ec63d94 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -11,15 +11,18 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME MinimalEntity building-minimal-sample.jsonld + [Tags] be-create 5_6_7 EntityWithSimpleProperties building-simple-attributes-sample.jsonld + [Tags] be-create 5_6_7 EntityWithSimpleRelationships building-relationship-sample.jsonld + [Tags] be-create 5_6_7 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + [Tags] be-create 5_6_7 *** Keywords *** Batch Create Entity Scenarios [Arguments] ${filename} [Documentation] Check that you can create a batch of entities - [Tags] mandatory entityOperations ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index db1815a6..f16d0112 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -12,7 +12,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of two valid entities and one invalid entity [Documentation] Check that you can create a batch of two valid entities and one invalid entity - [Tags] mandatory + [Tags] be-create 5_6_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index e169e6fa..0999854a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -7,13 +7,14 @@ Test Template Create Batch Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-create 5_6_7 EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-create 5_6_7 *** Keywords *** Create Batch Entity With Invalid Request Scenarios [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot create a batch of entities with an invalid request - [Tags] mandatory Batch Request Entities From File create filename=${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index 484baea7..5f86d21a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 9a489158..61cef9ef 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index b67ba32e..fcbccc0f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index 89d4cfde..c0ca0545 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index 7646496a..694d22ee 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 88ebf3ac..049755b3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] mandatory + [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index d5ff2372..3c15fde6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -12,7 +12,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities - [Tags] mandatory + [Tags] be-delete 5_6_10 @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index c31a415a..7b51d982 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -12,7 +12,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of non existing and existing entities [Documentation] Check that you can delete a batch of non existing and existing entities - [Tags] mandatory + [Tags] be-delete 5_6_10 ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index 1cdbba5b..94af9bfb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -7,13 +7,14 @@ Test Template Batch Delete Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-delete 5_6_10 EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-delete 5_6_10 *** Keywords *** Batch Delete Entity With Invalid Request Scenarios [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot delete a batch of entities with an invalid request - [Tags] mandatory Batch Request Entities From File delete filename=${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 3ba418cd..078ef6d7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -14,14 +14,16 @@ ${entity_payload_filename}= building-simple-attributes-sample.jsonld *** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-update 5_6_9 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json + [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity Scenarios [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities - [Tags] mandatory ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index ae7849d4..aedeb79f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -14,14 +14,16 @@ ${entity_payload_filename}= building-simple-attributes-sample.jsonld *** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-update 5_6_9 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With NoOverwrite Option Scenarios [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities with noOverwrite option - [Tags] mandatory ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 713e4a8d..18b923e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -14,7 +14,7 @@ ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of *** Test Case *** Update a batch of non existing and existing entities [Documentation] Check that you can update a batch of non existing and existing entities - [Tags] mandatory + [Tags] be-update 5_6_9 ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index a3195d45..f2cc856b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -7,13 +7,14 @@ Test Template Batch Update Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-update 5_6_9 InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With Invalid Request Scenarios [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot update a batch of entities with an invalid request - [Tags] mandatory Batch Request Entities From File update filename=${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index bfee1490..bd4f8d86 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -11,14 +11,16 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithSimpleRelationships building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entity Scenarios [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing entities - [Tags] mandatory ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 8a4953f6..a41391e4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -13,14 +13,16 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithSimpleRelationships building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Non-existing And Existing Entities Scenarios [Arguments] ${filename} [Documentation] Check that you can upsert a batch of non existing and existing entities - [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index b7ea1c59..858bbca1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -13,14 +13,16 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithSimpleRelationships building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Existing Entities Scenarios [Arguments] ${filename} [Documentation] Check that you can upsert a batch of existing entities - [Tags] mandatory ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index c4539472..5c60cddd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -14,14 +14,16 @@ ${existing_entity_payload_filename}= building-minimal-sample.jsonld *** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json + [Tags] be-upsert 5_6_8 EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-upsert 5_6_8 EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entities With Update Option Scenarios [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can upsert a batch of entities with update option - [Tags] mandatory ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index c5fcf6d4..9a7b0f90 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -10,7 +10,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of two valid entities and one invalid entity [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity - [Tags] mandatory + [Tags] be-upsert 5_6_8 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 8bf80f0f..f9c0d8a5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -7,13 +7,14 @@ Test Template Batch Upsert Entity With Invalid Request Scenarios *** Test Cases *** FILENAME PROBLEM_TYPE InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-upsert 5_6_8 InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot upsert a batch of entities with an invalid request - [Tags] mandatory Batch Request Entities From File upsert filename=${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index 1491771a..64c1226e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index 61060456..fb132623 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index 1cbed680..7970e73a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index 4126526c..971ee448 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index e0e609f4..b405e5a4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index aa738d4c..bf5114df 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -11,7 +11,7 @@ ${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] mandatory + [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 3820ebe7..860cee57 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -7,13 +7,14 @@ Test Template Delete Subscription With Non present Or Invalid Id *** Test Cases *** id NotPresentId ${EMPTY} + [Tags] sub-delete 5_8_5 InvalidId InvalidUri + [Tags] sub-delete 5_8_5 *** Keywords *** Delete Subscription With Non present Or Invalid Id [Arguments] ${id} [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - [Tags] mandatory Delete Subscription ${id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index c83fdc6a..16f09b54 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Case *** Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised - [Tags] mandatory + [Tags] sub-delete 5_8_5 Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 2abec456..13fadfbf 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Case *** Delete Subscription [Documentation] Check that you can delete a subscription - [Tags] mandatory + [Tags] sub-delete 5_8_5 Delete Subscription ${subscription_id} Check Response Status Code Set To 204 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index 4507b2df..2959d7db 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -17,7 +17,7 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expe *** Test Case *** Query Subscriptions [Documentation] Check that you can query a list of subscriptions - [Tags] mandatory + [Tags] sub-query 5_8_4 Query Subscriptions context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 15078a31..36015301 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -16,14 +16,16 @@ ${third_subscription_payload_file_path}= subscriptions/subscription-inactive-s *** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] sub-query 5_8_4 Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] sub-query 5_8_4 Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] sub-query 5_8_4 *** Keywords *** Query Subscriptions With Limit And Page Parameters [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place - [Tags] mandatory Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index d039eb9f..e26e7665 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -7,13 +7,14 @@ Test Template Retrieve Subscription With Non present Or Invalid Id *** Test Cases *** id NotPresentId ${EMPTY} + [Tags] sub-retrieve 5_8_3 InvalidId InvalidUri + [Tags] sub-retrieve 5_8_3 *** Keywords *** Retrieve Subscription With Non present Or Invalid Id [Arguments] ${id} [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - [Tags] mandatory Retrieve Subscription ${id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 7c77ef6b..3962869f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Case *** Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised - [Tags] mandatory + [Tags] sub-retrieve 5_8_3 Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 79aaaf51..9dd2b497 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expe *** Test Case *** Retrieve Subscription [Documentation] Check that you can retrieve a subscription - [Tags] mandatory + [Tags] sub-retrieve 5_8_3 Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 679523a4..9c00bd02 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -8,7 +8,9 @@ Test Template Update Subscription With Non present Or Invalid Id *** Test Cases *** id NotPresentId ${EMPTY} + [Tags] sub-update 5_8_2 InvalidId InvalidUri + [Tags] sub-update 5_8_2 *** Variable *** ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json @@ -17,7 +19,6 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio Update Subscription With Non present Or Invalid Id [Arguments] ${id} [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - [Tags] mandatory Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 2ad714bc..d33f7d26 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -10,7 +10,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 9a787102..5e9c90a6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Subscription With Invalid Fragment [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index e22a5f35..86af83ff 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Subscription With Null Mandatory Properties [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 08d3fc89..c4ea7b8b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -17,7 +17,7 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectation *** Test Case *** Update Subscription With Term to Uri Expansion [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 606931b9..1c57168d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Subscription [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index bfbb5d6d..8d5f5033 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -10,7 +10,9 @@ Suite Teardown Delete Initial Subscriptions *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json + [Tags] sub-update 5_8_2 ActiveNull subscriptions/fragments/subscription-isActive-null-update-sample.json + [Tags] sub-update 5_8_2 *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: @@ -20,7 +22,6 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample. Activate Paused Subscription With isActive Member [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" - [Tags] mandatory Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index 2472613f..ba7fb8e4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -10,9 +10,13 @@ Suite Teardown Delete Initial Subscriptions *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH ActiveTrueExpiresAtNull subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json + [Tags] sub-update 5_8_2 ActiveTrueExpiresAt subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json + [Tags] sub-update 5_8_2 ActiveNullExpiresAtNull subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json + [Tags] sub-update 5_8_2 ActiveNullExpiresAt subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json + [Tags] sub-update 5_8_2 *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: @@ -22,7 +26,6 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample. Activate Paused Subscription With isActive And ExpiresAt Members [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" - [Tags] mandatory Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index b414200e..c105c651 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Subscription Status To Paused [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 6cdf122f..7705fc99 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Activate Expired Subscription [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" - [Tags] mandatory + [Tags] sub-update 5_8_2 # Update subscription to expired Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 4c38313d..6413dac1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscriptio *** Test Case *** Update Subscription With ExpiresAt In The Past [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised - [Tags] mandatory + [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index c03dae1e..f6626258 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index 3d0410e9..60108a49 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index 92f758fc..6a8dba17 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index ca15e145..7dac576d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index f09aaf23..5beb1a4a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index 53349e38..4ff9a5d8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -12,7 +12,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-registr *** Test Case *** Create one context source registration with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] mandatory + [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 6f13b972..11c4692a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -15,13 +15,14 @@ ${second_context_source_registration_payload_file_path}= csourceRegistrations/ *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS With list of entity types type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} + [Tags] csr-query 5_10_2 With list of attribute names attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 99bee923..245aa9eb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Query Context Source Registrations Without Entity Types and Attribute Names [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type - [Tags] mandatory + [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index 8199b09f..babb59c5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -8,15 +8,18 @@ Test Template Query Context Source Registration With Invalid Query Param *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE Invalid URI id invalidUri + [Tags] csr-query 5_10_2 Invalid Query q invalidQuery + [Tags] csr-query 5_10_2 Invalid GeoQuery georel within + [Tags] csr-query 5_10_2 Invalid Temporal Query timerel before + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration With Invalid Query Param [Arguments] ${query_param_name} ${query_param_value} [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index 78dadc23..b8bac84b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= csourceRegistrations/expectations/context-source-reg *** Test Case *** Query Context Source Registrations Without Context [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context - [Tags] mandatory + [Tags] csr-query 5_10_2 Query Context Source Registrations id=${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index 399fa003..79fa92d4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -11,13 +11,14 @@ ${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration *** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH Registration With EntityInfo Matching The Query csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json + [Tags] csr-query 5_10_2 Registration Without EntityInfo csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching EntityInfo of RegistrationInfo [Arguments] ${registration_file_path} ${expectation_file_path} [Documentation] Check that you can query context source registrations matching EntityInfo of RegistrationInfo - [Tags] mandatory ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${registration_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 97f25291..f5cb05ca 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -14,13 +14,14 @@ ${context_source_registration_payload_file_path}= csourceRegistrations/context *** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH Query With Matching Properties And Relationships name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + [Tags] csr-query 5_10_2 Query Without Properties And Relationships ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo [Arguments] ${attrs_value} ${expectation_file_path} [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index efcd3952..4414dfd8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -15,13 +15,14 @@ ${expectation_file_path}= csourceRegistrations/expectations/context-source-reg *** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} + [Tags] csr-query 5_10_2 Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Geoquery [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index 256d3393..cbc1fc83 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= csourceRegistrations/expectations/context-source-reg *** Test Case *** Query Context Source Registration Without Temporal Query [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered - [Tags] mandatory + [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} type=Building diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index 8b0f1f10..1c9948f9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -15,15 +15,18 @@ ${management_interval_expectation_file_path}= csourceRegistrations/expectation *** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH Observation Interval With observedAt ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} + [Tags] csr-query 5_10_2 Observation Interval Without timeproperty ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} + [Tags] csr-query 5_10_2 Mqnagement Interval With createdAt ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} + [Tags] csr-query 5_10_2 Mqnagement Interval With modifiedAt ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Temporal Query [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} [Documentation] Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval - [Tags] mandatory ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index 94076c1f..1df91252 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -16,14 +16,16 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations/c *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS With list of Entity Ids id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 With NGSI-LD Query q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 With Context Source Filter csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration With Query Params [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index ee83a7d7..10f8e0ec 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -16,14 +16,16 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations/c *** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] csr-query 5_10_2 Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] csr-query 5_10_2 Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration With Limit And Page Parameters [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. - [Tags] mandatory Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 41981066..b0f524e4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -8,7 +8,9 @@ Test Template Retrieve Context Source Registration With A Not Present Or Invali *** Test Cases *** ID Not Present Id ${EMPTY} + [Tags] csr-retrieve 5_10_1 Invalid Id invalidUri + [Tags] csr-retrieve 5_10_1 *** Keywords *** @@ -16,7 +18,6 @@ Retrieve Context Source Registration With A Not Present Or Invalid Id [Arguments] ${id} [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI - [Tags] mandatory Retrieve Context Source Registration ${id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index bdc90d76..10b9e3f5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Unknown Context Source Registration [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent - [Tags] mandatory + [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index c1fc4b2e..0b2e26a2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= csourceRegistrations/expectations/context-source-reg *** Test Case *** Retrieve Context Source Registration With Default Core Context [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. - [Tags] mandatory + [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 3577a1e7..e895d117 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= csourceRegistrations/expectations/context-source-reg *** Test Case *** Retrieve Context Source Registration [Documentation] Check that you can retrieve a Context Source Registration - [Tags] mandatory + [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 368f6259..14e668ed 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -17,13 +17,14 @@ ${expectation_file_path_expanded}= csourceRegistrations/expectations/context-s *** Test Cases *** CONTEXT EXPECTED_PAYLOAD EmptyJsonLdContext ${EMPTY} ${expectation_file_path_expanded} + [Tags] csr-retrieve 6_3_5 CreationTimeJsonLdContext ${ngsild_test_suite_context} ${expectation_file_path_compacted} + [Tags] csr-retrieve 6_3_5 *** Keywords *** Check JSON-LD resolution when retrieving a context source registration [Arguments] ${context} ${expected_payload} [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present - [Tags] mandatory Retrieve Context Source Registration ${context_source_registration_id} context=${context} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index aeb55b3c..31cb75e7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Create Context Source Registration Subscription [Documentation] Check that you can create a minimal context source registration subscription - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index d7019a98..d6b0c567 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -13,7 +13,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Create Context Source Registration Subscription Without An Id [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index bb635568..22801be6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Create Context Source Registration Subscription Without isActive Member [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index ee2c08b5..73747b2f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive- *** Test Case *** Create Inactive Context Source Registration Subscription [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 4bb7737a..a41813d2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt *** Test Case *** Create Context Source Registration Subscription With expiresAt Member [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index e6c70610..414e0fee 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Create Context Source Registration Subscription Without expiresAt Member [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 11d1ab96..f38c99e3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -14,7 +14,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Create Existing Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index 7bbdbcf3..6c1cc514 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -12,15 +12,18 @@ ${subscription_payload_file_path}= *** Test Cases *** FILEPATH WithoutNotification csourceSubscriptions/subscription-without-notification-sample.jsonld + [Tags] csrsub-create 5_11_2 InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld + [Tags] csrsub-create 5_11_2 InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld + [Tags] csrsub-create 5_11_2 EmptyWatchedAttributes csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld + [Tags] csrsub-create 5_11_2 *** Keywords *** Create Invalid Context Source Registration Subscription [Arguments] ${filepath} [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met - [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 9a0f4450..2788ed16 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -11,7 +11,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-s *** Test Case *** Create Expired Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time - [Tags] mandatory + [Tags] csrsub-create 5_11_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 53629a0f..651d8a29 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -13,7 +13,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Delete Context Source Registration Subscription [Documentation] Check that you can delete a context source registration subscription - [Tags] mandatory + [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index 61755ee6..5ff3f69e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Delete Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI - [Tags] mandatory + [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription invalidUri diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index 8156d8f9..ea4afc67 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Delete Unknown Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete an unknown context source registration subscription - [Tags] mandatory + [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index 09b5e1f6..912b2fbd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInter *** Test Case *** Receive cSourceNotification Periodically And Initially On Subscription [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index 04e6f2ac..1470fdbc 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -18,7 +18,7 @@ ${update_fragment_file_path}= csourceRegistrations/fragments/context-source-re *** Test Case *** Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 8531a45f..8cbebca2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Receive cSourceNotification With Relevant Information [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index c61dd058..2f4bb447 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Receive cSourceNotification With Compliant Structure [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index 61af8f1d..852dec85 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -18,7 +18,7 @@ ${notification_expectation_file_path}= notifications/expectations/1-timesSent- *** Test Case *** If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index 594793d5..4208e21f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -18,7 +18,7 @@ ${notification_expectation_file_path}= notifications/expectations/1-timesSent- *** Test Case *** If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index 6b244861..11309d9c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -17,13 +17,14 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Cases *** FILEPATH PausedSubscription csourceSubscriptions/fragments/subscription-isActive-update-sample.json + [Tags] csrsub-notification 5_11_7 ExpiredSubscription csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json + [Tags] csrsub-notification 5_11_7 *** Keywords *** Do Not Receive cSourceNotification If Subscription Status Is Not Active [Arguments] ${filepath} [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired - [Tags] mandatory ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index 16b9cb92..957e126e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -18,7 +18,7 @@ ${update_fragment_file_path}= csourceRegistrations/fragments/context-source-re *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index 834ab1ae..893cada7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -18,7 +18,7 @@ ${update_fragment_file_path}= csourceRegistrations/fragments/context-source-re *** Test Case *** Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 6d2d3a1b..35e64443 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Observation Interval [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index 64dca133..b77708bd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -16,13 +16,14 @@ ${context_source_registration_payload_file_path}= csourceRegistrations/context *** Test Cases *** FILEPATH CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld + [Tags] csrsub-notification 5_11_7 ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld + [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Matching Context Source Registrations On Management Interval [Arguments] ${filepath} [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations - [Tags] mandatory ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index 995a53c9..271aadf3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAt *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index 3317b4f6..7cc6abe3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index bb978005..6ac56802 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-samp *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Location [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index ae8bc477..850dce58 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -17,7 +17,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-with *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Location As Default [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member - [Tags] mandatory + [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index cc397045..e725453a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -18,14 +18,16 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS MatchFirstContextSourceRegistration csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 MatchSecondContextSourceRegistration csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 MatchBothContextSourceRegistrations csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Newly Matching Context Source Registrations [Arguments] ${filepath} @{notification_csr_ids} [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations - [Tags] mandatory ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 2c2d24c3..4d3a53ed 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -16,7 +16,7 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035- *** Test Case *** Query Context Source Registration Subscriptions [Documentation] Check that you can query context source registration subscriptions - [Tags] mandatory + [Tags] csrsub-query 5_11_5 Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 2a250414..078d352c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -17,15 +17,17 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035- *** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER Query One Subscription ${1} ${1} + [Tags] csrsub-query 5_11_5 Query Two Subscription ${2} ${2} + [Tags] csrsub-query 5_11_5 Query All Subscriptions ${15} ${3} + [Tags] csrsub-query 5_11_5 *** Keywords *** Query Context Source Registration Subscriptions With Limit Parameter [Arguments] ${limit} ${expectation_subscription_number} [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved - [Tags] mandatory Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index 86147fd5..31140a59 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -16,15 +16,16 @@ ${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geo *** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] csrsub-query 5_11_5 Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] csrsub-query 5_11_5 Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] csrsub-query 5_11_5 *** Keywords *** Query Context Source Registration Subscriptions With Limit And Page Parameters [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} - [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination - [Tags] mandatory Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index 136ff6fd..57b439c8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -8,15 +8,16 @@ Test Template Query Context Source Registration Subscriptions With Invalid Limi *** Test Cases *** LIMIT PAGE Invalid Limit ${-5} ${2} + [Tags] csrsub-query 5_11_5 Invalid Page ${2} ${-3} + [Tags] csrsub-query 5_11_5 Invalid Limit And Page ${0} ${0} + [Tags] csrsub-query 5_11_5 *** Keywords *** Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters [Arguments] ${limit} ${page} - [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters - [Tags] mandatory Query Context Source Registration Subscriptions limit=${limit} page=${page} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 0da3e65b..9478f37e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -15,7 +15,7 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040- *** Test Case *** Retrieve Context Source Registration Subscription [Documentation] Check that you can retrieve a context source registration subscription - [Tags] mandatory + [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index f256820e..537342ae 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Context Source Registration Subscription With An Invalid Id [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised - [Tags] mandatory + [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription invalidUri diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index d48f640a..42230d60 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Unknown Context Source Registration Subscription [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised - [Tags] mandatory + [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 825a9c4c..6dabc291 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subs *** Test Case *** Update Context Source Registration Subscription [Documentation] Check that you can update a context source registration subscription - [Tags] mandatory + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index c62c0d80..004e78c7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -10,7 +10,7 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subs *** Test Case *** Update Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot update a context source registration subscription with an invalid URI - [Tags] mandatory + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index 58da0713..bd70c92b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -10,7 +10,7 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subs *** Test Case *** Update Unknown Context Source Registration Subscription [Documentation] Check that you cannot update an unknown context source registration subscription - [Tags] mandatory + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 54d969c6..cbe22fce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -14,13 +14,14 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.js *** Test Cases *** FILEPATH InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json + [Tags] csrsub-update 5_11_3 InvalidNotification csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json + [Tags] csrsub-update 5_11_3 *** Keywords *** Update Context Source Registration Subscription With Invalid Fragment [Arguments] ${filepath} [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 - [Tags] mandatory ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index b646740c..d71bdb16 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -15,7 +15,7 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subs *** Test Case *** Update Context Source Registration Subscription With Invalid JSON Fragment [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) - [Tags] mandatory + [Tags] csrsub-update 5_11_3 Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} -- GitLab From b18fe8b95856ab2a65abac15744cddc654c017a9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 15 Apr 2021 12:24:40 +0200 Subject: [PATCH 202/442] feat: improve display of payloads comparisons checks - ensure expected is on the left, and actual is on the right - display the difference (if any) as part of the check (not in a separate keyword, less readable) - pretty print the difference when one is found --- libraries/assertionUtils.py | 16 +++--- resources/AssertionUtils.resource | 86 +++++++++++++++---------------- 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py index fb7e614e..b9dde5a7 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -1,11 +1,15 @@ from deepdiff import DeepDiff -def compare_dictionaries_ignoring_keys(dict1, dict2, exclude_regex_paths): +def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, group_by=None): """Function exposed as a keyword to compare two dictionaries - :param dict1: actual dictionary - :param dict2: expected dictionary + :param expected: expected dictionary + :param actual: actual dictionary :param exclude_regex_paths: list of regex paths of keys to be ignored + :param group_by: a key to group the results, useful for lists of results """ - res = DeepDiff(dict1, dict2, exclude_regex_paths=exclude_regex_paths, ignore_order=True) - print(res) - return not res + res = {} + if group_by is not None: + res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1, group_by=group_by) + else: + res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1) + return res diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 431c61d0..5600908c 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -34,8 +34,8 @@ Check Response Body Content ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} Output ${response_body} Output ${entity_payload} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${all_ignored_paths} - Should Be True ${comparison_result} msg=Entity Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_payload} ${response_body} ${all_ignored_paths} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} @@ -93,8 +93,8 @@ Check Response Body Containing Entity element [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity} ${instance_id_regex_expr} - Should Be True ${comparison_result} msg=Entity Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity} ${response_body} ${instance_id_regex_expr} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Entity Elements [Arguments] ${expectation_filename} ${entities_ids} ${response_body} @@ -111,17 +111,15 @@ Check Response Body Containing List Containing Entity Elements With Different Ty ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} ${index}= Evaluate ${index} + 1 END - Log ${response_body} - Log ${entities_representation_payload} - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entities_representation_payload} ${instance_id_regex_expr} - Should Be True ${comparaison_result} msg=Entity List Comparaison Failed + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} - Should Be True ${comparison_result} msg=EntityTemporal Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entity_representation} ${response['body']} ${instance_id_regex_expr} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements [Arguments] ${filename} ${temporal_entities_representation_ids} @@ -131,16 +129,16 @@ Check Response Body Containing List Containing EntityTemporal elements ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} - Should Be True ${comparison_result} msg=EntityTemporal List Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entities_representation_payload} ${response['body']} ${instance_id_regex_expr} group_by=id + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription} ${ignored_keys} - Should Be True ${comparison_result} msg=Subscription Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Subscription elements [Arguments] ${expectation_file_path} ${subscription_ids} @@ -151,8 +149,8 @@ Check Response Body Containing List Containing Subscription elements ${index}= Evaluate ${index} + 1 END ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${subscription_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=Subscription Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} # Since response body can be a json object if it contains one element # A check on the response body type is needed @@ -175,43 +173,43 @@ Check Response Body Containing Context Source Registration element ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${context_source_registration} ${ignored_keys} - Should Be True ${comparison_result} msg=Context Source Registration Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${context_source_registration} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeList element [Arguments] ${expectation_filename} ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_list_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=EntityTypeList Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_list_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityType element [Arguments] ${expectation_filename} ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=EntityType Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeInfo element [Arguments] ${expectation_filename} ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${entity_type_info_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=EntityTypeInfo Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_info_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing AttributeList element [Arguments] ${expectation_filename} ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${attribute_list_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=AttributeList Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_list_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing Attribute element [Arguments] ${expectation_filename} ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${attribute_payload} ${ignored_keys} - Should Be True ${comparison_result} msg=Attribute Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_payload} ${response['body']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Context Source Registrations elements [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} @@ -221,8 +219,8 @@ Check Response Body Containing List Containing Context Source Registrations elem ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${expected_context_source_registrations_payload} ${EMPTY} - Should Be True ${comparaison_result} msg=Context Source Registration Comparaison Failed + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request [Arguments] ${response} ${type} @@ -278,8 +276,8 @@ Check NotificationParams ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']['notification']} ${expected_notification} ${ignored_keys} - Should Be True ${comparison_result} msg=NotificationParams Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_notification} ${response['body']['notification']} ${ignored_keys} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} @@ -296,41 +294,41 @@ Check Response Body Containing One Subscription element [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${subscription} ${instance_id_regex_expr} - Should Be True ${comparison_result} msg=Entity Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response_body} ${instance_id_regex_expr} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing One Registration element [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${registration} ${instance_id_regex_expr} - Should Be True ${comparison_result} msg=Entity Comparison Failed + ${comparison_result}= Compare Dictionaries Ignoring Keys ${registration} ${response_body} ${instance_id_regex_expr} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Resource Set To - [Arguments] ${resource} ${ignored_keys}=${None} ${error_message}=${EMPTY} + [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${resource} ${ignored_keys} - Should Be True ${comparison_result} msg=${error_message} + ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_resource} ${response['body']} ${ignored_keys} ${group_by} + Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Created Resource Set To [Arguments] ${created_resource} ${ignored_keys}=${None} - Check Resource Set To ${created_resource} ${ignored_keys} Created Resource Comparison Failed + Check Resource Set To ${created_resource} ${ignored_keys} Check Created Resources Set To - [Arguments] ${created_resources} ${ignored_keys}=${None} + [Arguments] ${expected_resources} ${ignored_keys}=${None} - Check Resource Set To ${created_resources} ${ignored_keys} Created Resources Comparison Failed + Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id Check Updated Resource Set To [Arguments] ${updated_resource} ${ignored_keys}=${None} - Check Resource Set To ${updated_resource} ${ignored_keys} Updated Resource Comparison Failed + Check Resource Set To ${updated_resource} ${ignored_keys} Check Updated Resources Set To [Arguments] ${updated_resources} ${ignored_keys}=${None} - Check Resource Set To ${updated_resources} ${ignored_keys} Updated Resources Comparison Failed + Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id Check SUT Not Containing Resource ${response_status}= convert to string ${response['status']} -- GitLab From 0e6d4cb3c6d495d7d83f9c409cdd3e83f37b2f46 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Apr 2021 17:10:12 +0200 Subject: [PATCH 203/442] feat: integrate metrics report library --- README.md | 8 ++++++++ requirements.txt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index ea65593b..cf88d720 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,14 @@ Launch the tests with the following command: For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh). +## Generate metrics from the tests results + +Optionally, you can generate metrics from the results of tests: + +```$ robotmetrics --inputpath -k True -s True``` + +A sample report can be seen at https://robotmetrics.netlify.app/# + # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) diff --git a/requirements.txt b/requirements.txt index c62307ce..95fc1974 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,5 @@ robotframework-jsonlibrary==0.3.1 robotframework-requests==0.8.0 deepdiff==5.2.1 robotframework-httpctrl==0.1.6 +robotframework-metrics==3.2.0 + -- GitLab From 29f0407931e84c1646cadda6be2158ecb2c47367 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 18 Apr 2021 11:48:04 +0200 Subject: [PATCH 204/442] chore: tidy the Test Cases for a consistent code formatting --- README.md | 12 ++ TP/NGSI-LD/CommonBehaviours/043.robot | 122 +++++++-------- TP/NGSI-LD/CommonBehaviours/044_01.robot | 62 ++++---- TP/NGSI-LD/CommonBehaviours/044_02.robot | 141 ++++++++---------- TP/NGSI-LD/CommonBehaviours/044_03.robot | 140 ++++++++--------- TP/NGSI-LD/CommonBehaviours/044_04.robot | 82 +++++----- TP/NGSI-LD/CommonBehaviours/044_05.robot | 54 +++---- .../027_01_01.robot | 39 +++-- .../027_01_02.robot | 41 +++-- .../RetrieveAvailableAttributes/025_01.robot | 53 ++++--- .../024_01_01.robot | 47 +++--- .../024_01_02.robot | 49 +++--- .../RetrieveAvailableEntityTypes/022_01.robot | 65 ++++---- .../026_01.robot | 53 ++++--- .../023_01.robot | 65 ++++---- .../Entity/QueryEntities/019_01_01.robot | 70 ++++----- .../Entity/QueryEntities/019_01_02.robot | 79 +++++----- .../Entity/QueryEntities/019_01_03.robot | 54 ++++--- .../Entity/QueryEntities/019_01_04.robot | 58 ++++--- .../Entity/QueryEntities/019_01_05.robot | 56 ++++--- .../Entity/QueryEntities/019_02_01.robot | 64 ++++---- .../Entity/QueryEntities/019_02_02.robot | 71 +++++---- .../Entity/QueryEntities/019_02_03.robot | 53 ++++--- .../Entity/QueryEntities/019_02_04.robot | 54 ++++--- .../Entity/QueryEntities/019_02_05.robot | 54 ++++--- .../Entity/QueryEntities/019_03_01.robot | 58 ++++--- .../Entity/QueryEntities/019_03_02.robot | 61 ++++---- .../Entity/QueryEntities/019_03_03.robot | 52 +++---- .../Entity/QueryEntities/019_03_04.robot | 55 ++++--- .../Entity/QueryEntities/019_03_05.robot | 61 ++++---- .../Entity/QueryEntities/019_04.robot | 64 ++++---- .../Entity/QueryEntities/019_05.robot | 68 ++++----- .../Entity/QueryEntities/019_06.robot | 68 ++++----- .../Entity/RetrieveEntity/018_01_01.robot | 33 ++-- .../Entity/RetrieveEntity/018_01_02.robot | 39 +++-- .../Entity/RetrieveEntity/018_01_03.robot | 35 ++--- .../Entity/RetrieveEntity/018_02.robot | 31 ++-- .../Entity/RetrieveEntity/018_03_01.robot | 27 ++-- .../Entity/RetrieveEntity/018_03_02.robot | 39 +++-- .../Entity/RetrieveEntity/018_04.robot | 37 +++-- .../Entity/RetrieveEntity/018_05.robot | 39 +++-- .../Entity/RetrieveEntity/018_06.robot | 55 ++++--- .../021_01.robot | 72 +++++---- .../021_02.robot | 50 +++---- .../021_03.robot | 48 +++--- .../021_04.robot | 48 +++--- .../021_05.robot | 50 +++---- .../021_06.robot | 50 +++---- .../021_07.robot | 48 +++--- .../021_08.robot | 48 +++--- .../021_09.robot | 61 ++++---- .../021_10.robot | 48 +++--- .../021_11.robot | 73 +++++---- .../021_12.robot | 35 ++--- .../021_13.robot | 59 ++++---- .../020_01.robot | 37 +++-- .../020_02.robot | 37 +++-- .../020_03.robot | 39 +++-- .../020_04.robot | 53 ++++--- .../020_05.robot | 50 +++---- .../020_06.robot | 20 ++- .../020_07.robot | 20 ++- .../020_08.robot | 37 +++-- .../020_09.robot | 53 ++++--- .../020_10.robot | 39 +++-- .../CreateBatchOfEntities/003_01.robot | 71 +++++---- .../CreateBatchOfEntities/003_02.robot | 64 ++++---- .../CreateBatchOfEntities/003_03.robot | 30 ++-- .../CreateBatchOfEntities/003_04.robot | 42 +++--- .../CreateBatchOfEntities/003_05.robot | 42 +++--- .../CreateBatchOfEntities/003_06.robot | 29 ++-- .../CreateBatchOfEntities/003_07.robot | 42 +++--- .../CreateBatchOfEntities/003_08.robot | 29 ++-- .../CreateBatchOfEntities/003_09.robot | 29 ++-- .../DeleteBatchOfEntities/006_01.robot | 45 +++--- .../DeleteBatchOfEntities/006_02.robot | 49 +++--- .../DeleteBatchOfEntities/006_03.robot | 30 ++-- .../UpdateBatchOfEntities/005_01.robot | 91 ++++++----- .../UpdateBatchOfEntities/005_02.robot | 91 ++++++----- .../UpdateBatchOfEntities/005_03.robot | 81 +++++----- .../UpdateBatchOfEntities/005_04.robot | 30 ++-- .../UpsertBatchOfEntities/004_01.robot | 66 ++++---- .../UpsertBatchOfEntities/004_02.robot | 92 ++++++------ .../UpsertBatchOfEntities/004_03.robot | 79 +++++----- .../UpsertBatchOfEntities/004_04.robot | 92 ++++++------ .../UpsertBatchOfEntities/004_05.robot | 57 ++++--- .../UpsertBatchOfEntities/004_06.robot | 30 ++-- .../Entities/CreateEntity/001_01.robot | 56 +++---- .../Entities/CreateEntity/001_02.robot | 34 +++-- .../Entities/CreateEntity/001_03.robot | 36 ++--- .../Entities/CreateEntity/001_04.robot | 35 ++--- .../Entities/CreateEntity/001_05.robot | 35 ++--- .../Entities/CreateEntity/001_06.robot | 27 ++-- .../Entities/CreateEntity/001_07.robot | 35 ++--- .../Entities/CreateEntity/001_08.robot | 27 ++-- .../Entities/CreateEntity/001_09.robot | 27 ++-- .../Entities/DeleteEntity/002_01.robot | 29 ++-- .../Entities/DeleteEntity/002_02.robot | 31 ++-- .../Entities/DeleteEntity/002_03.robot | 26 ++-- .../AppendEntityAttributes/010_01.robot | 81 +++++----- .../AppendEntityAttributes/010_02.robot | 68 ++++----- .../AppendEntityAttributes/010_03.robot | 28 ++-- .../DeleteEntityAttribute/013_01.robot | 62 ++++---- .../DeleteEntityAttribute/013_02.robot | 53 +++---- .../DeleteEntityAttribute/013_03.robot | 57 +++---- .../PartialAttributeUpdate/012_01.robot | 55 ++++--- .../PartialAttributeUpdate/012_02.robot | 69 +++++---- .../PartialAttributeUpdate/012_03.robot | 65 ++++---- .../UpdateEntityAttributes/011_01.robot | 56 +++---- .../UpdateEntityAttributes/011_02.robot | 64 ++++---- .../UpdateEntityAttributes/011_03.robot | 28 ++-- .../007_01.robot | 47 +++--- .../007_02.robot | 45 +++--- .../009_01.robot | 33 ++-- .../009_02.robot | 37 ++--- .../009_03.robot | 32 ++-- .../008_01.robot | 48 +++--- .../AppendAttributes/014_01.robot | 44 +++--- .../AppendAttributes/014_02.robot | 64 ++++---- .../AppendAttributes/014_03.robot | 37 +++-- .../DeleteAttribute/015_01.robot | 62 ++++---- .../DeleteAttribute/015_02.robot | 58 +++---- .../DeleteAttribute/015_03.robot | 55 ++++--- .../DeleteAttributeInstance/017_01.robot | 53 +++---- .../DeleteAttributeInstance/017_02.robot | 73 +++++---- .../DeleteAttributeInstance/017_03.robot | 63 ++++---- .../016_01.robot | 70 ++++----- .../016_02.robot | 75 +++++----- .../016_03.robot | 65 ++++---- .../CreateSubscription/031_01.robot | 34 ++--- .../CreateSubscription/031_02.robot | 30 ++-- .../CreateSubscription/031_03.robot | 38 +++-- .../CreateSubscription/031_04.robot | 33 ++-- .../DeleteSubscription/032_01.robot | 30 ++-- .../DeleteSubscription/032_02.robot | 18 +-- .../DeleteSubscription/032_03.robot | 37 ++--- .../QuerySubscriptions/031_01.robot | 63 ++++---- .../QuerySubscriptions/031_02.robot | 82 +++++----- .../RetrieveSubscription/030_01.robot | 30 ++-- .../RetrieveSubscription/030_02.robot | 18 +-- .../RetrieveSubscription/030_03.robot | 41 +++-- .../UpdateSubscription/029_01.robot | 34 ++--- .../UpdateSubscription/029_02.robot | 22 ++- .../UpdateSubscription/029_03.robot | 41 +++-- .../UpdateSubscription/029_04.robot | 41 +++-- .../UpdateSubscription/029_05.robot | 53 +++---- .../UpdateSubscription/029_06.robot | 52 +++---- .../UpdateSubscription/029_07.robot | 52 +++---- .../UpdateSubscription/029_08.robot | 70 ++++----- .../UpdateSubscription/029_09.robot | 43 +++--- .../UpdateSubscription/029_10.robot | 46 +++--- .../UpdateSubscription/029_11.robot | 41 +++-- .../033_01_01.robot | 38 +++-- .../033_01_02.robot | 38 +++-- .../033_01_03.robot | 33 ++-- .../033_02.robot | 62 ++++---- .../033_03.robot | 33 ++-- .../033_04.robot | 39 +++-- .../033_05.robot | 39 +++-- .../033_06.robot | 29 ++-- .../033_07.robot | 39 +++-- .../033_08.robot | 29 ++-- .../033_09.robot | 29 ++-- .../035_01.robot | 34 ++--- .../035_02.robot | 47 +++--- .../035_03.robot | 25 ++-- .../037_01.robot | 68 ++++----- .../037_02.robot | 20 ++- .../037_03.robot | 43 +++--- .../037_04.robot | 45 +++--- .../037_05.robot | 52 ++++--- .../037_06.robot | 58 ++++--- .../037_07.robot | 58 ++++--- .../037_08.robot | 45 +++--- .../037_09.robot | 70 ++++----- .../037_10.robot | 86 +++++------ .../037_11.robot | 88 +++++------ .../036_01.robot | 34 ++--- .../036_02.robot | 20 ++- .../036_03.robot | 43 +++--- .../036_04.robot | 43 +++--- .../036_05.robot | 61 ++++---- .../034_01.robot | 55 ++++--- .../034_02.robot | 98 ++++++------ .../034_03.robot | 30 ++-- .../038_01.robot | 45 +++--- .../038_02.robot | 44 +++--- .../038_03.robot | 42 +++--- .../038_04.robot | 42 +++--- .../038_05.robot | 50 +++---- .../038_06.robot | 44 +++--- .../038_07.robot | 45 +++--- .../038_08.robot | 51 +++---- .../038_09.robot | 29 ++-- .../042_01.robot | 38 ++--- .../042_02.robot | 20 ++- .../042_03.robot | 20 ++- .../NotificationBehaviour/047_01.robot | 55 +++---- .../NotificationBehaviour/047_02.robot | 66 ++++---- .../NotificationBehaviour/047_03.robot | 61 ++++---- .../NotificationBehaviour/047_04.robot | 58 ++++--- .../NotificationBehaviour/047_05.robot | 62 ++++---- .../NotificationBehaviour/047_06.robot | 61 ++++---- .../NotificationBehaviour/047_07.robot | 71 ++++----- .../NotificationBehaviour/047_08.robot | 61 ++++---- .../NotificationBehaviour/047_09.robot | 61 ++++---- .../NotificationBehaviour/047_10.robot | 58 ++++--- .../NotificationBehaviour/047_11.robot | 69 ++++----- .../NotificationBehaviour/047_12.robot | 58 ++++--- .../NotificationBehaviour/047_13.robot | 58 ++++--- .../NotificationBehaviour/047_14.robot | 58 ++++--- .../NotificationBehaviour/047_15.robot | 58 ++++--- .../NotificationBehaviour/047_16.robot | 91 ++++++----- .../041_01.robot | 57 ++++--- .../041_02.robot | 89 ++++++----- .../041_03.robot | 88 +++++------ .../041_04.robot | 38 ++--- .../040_01.robot | 43 +++--- .../040_02.robot | 20 ++- .../040_03.robot | 20 ++- .../039_01.robot | 50 +++---- .../039_02.robot | 22 ++- .../039_03.robot | 22 ++- .../039_04.robot | 55 ++++--- .../039_05.robot | 43 +++--- 225 files changed, 5269 insertions(+), 6025 deletions(-) diff --git a/README.md b/README.md index cf88d720..45f30139 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,18 @@ Optionally, you can generate metrics from the results of tests: A sample report can be seen at https://robotmetrics.netlify.app/# +## Generate a documentation for the support keywords + +```$ python3 -m robot.libdoc resources/ApiUtils.resource api_docs/ApiUtils.html``` + +## Generate a documentation for the Test Cases + +```$ python3 -m robot.testdoc TP/NGSI-LD api_docs/TestCases.html``` + +## Tidy the Test Cases + +```$ python3 -m robot.tidy --recursive TP/NGSI-LD``` + # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 9635a7eb..b9bdd011 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -1,88 +1,72 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${expected_status_code}= 503 - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-unretrievable-context-sample.jsonld - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld - -*** Test Cases *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-unretrievable-context-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld + +*** Test Cases *** 043_01 Create entity - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) - [Tags] e-create 5_2_2 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) + [Tags] e-create 5_2_2 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id ${entity_id} + [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) - [Tags] sub-create 5_2_2 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) + [Tags] sub-create 5_2_2 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Subscription ${subscription_id} + [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) - [Tags] te-create 5_2_2 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) + [Tags] te-create 5_2_2 + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) - [Tags] be-create 5_2_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To ${expected_status_code} - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + [Tags] be-create 5_2_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code Set To ${expected_status_code} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Batch Delete Entities @{entities_to_be_created} + [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) - [Tags] csr-create 5_2_2 - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) + [Tags] csr-create 5_2_2 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code ${expected_status_code} ${response['status']} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code ${expected_status_code} ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 7bac18a4..6101bbdb 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -1,41 +1,35 @@ *** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-brandname-fragment.json -${attribute_id}= brandName - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json - -*** Test Cases *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.json +${attribute_id}= brandName +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json + +*** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] ea-partial-update 6_3_4 - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] ea-partial-update 6_3_4 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} + Check Response Status Code 204 ${response['status']} + [Teardown] Delete Entity by Id ${entity_id} -044_01_02_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type - [Tags] sub-update 6_3_4 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} +044_01_02_endpoint /subscriptions/{subscriptionId} + [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + [Tags] sub-update 6_3_4 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} - - [Teardown] Delete Subscription ${subscription_id} - + Check Response Status Code 201 ${response['status']} + ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response['status']} + [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 27dc3527..bc7c3cd2 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -1,94 +1,79 @@ *** Settings *** -Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${building_expectation}= building-simple-attributes-sample-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${subscription_expectation}= subscription-sample-expectation.json - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld -${registration_expectation}= context-source-registration-with-expiration-expectation.json -${registration_type}= Vehicle - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json -${teatype}= Vehicle - -${content_type}= application/json +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${building_expectation}= building-simple-attributes-sample-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_expectation}= subscription-sample-expectation.json +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +${registration_expectation}= context-source-registration-with-expiration-expectation.json +${registration_type}= Vehicle +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json +${teatype}= Vehicle +${content_type}= application/json *** Test Cases *** 044_02_01_endpoint /entities/{entityId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) - [Tags] e-query 6_3_4 - ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* - Check Response Status Code 200 ${response['status']} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) + [Tags] e-query 6_3_4 + ${id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} + [Teardown] Delete Entity by Id Returning Response ${id} - [Teardown] Delete Entity by Id Returning Response ${id} - 044_02_02_endpoint /subscriptions/{subscriptionId} - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) - [Tags] sub-retrieve 6_3_4 - - ${id}= Generate Random Entity Id ${subscription_id_prefix} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) + [Tags] sub-retrieve 6_3_4 + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Retrieve Subscription ${id} accept=*/* - Check Response Status Code 200 ${response['status']} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Retrieve Subscription ${id} accept=*/* + Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} - - [Teardown] Delete Subscription ${id} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} + [Teardown] Delete Subscription ${id} 044_02_03_endpoint /csourceRegistrations/ - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) - [Tags] csr-query 6_3_4 - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) + [Tags] csr-query 6_3_4 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* + Check Response Status Code 200 ${response['status']} + Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} + [Teardown] Delete Context Source Registration ${registration_id} 044_02_04_endpoint /temporal/entities - [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) - [Tags] te-query 6_3_4 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* - Check Response Status Code 200 ${response['status']} - Set Test Variable ${response} - Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) + [Tags] te-query 6_3_4 + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* + Check Response Status Code 200 ${response['status']} + Set Test Variable ${response} + Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index 48921ab8..efc916b2 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -1,97 +1,77 @@ *** Settings *** -Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= speed -${vehicle_fragment}= vehicle-brandname-fragment.jsonld - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld - -${content_type}= application/xml +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_attribute}= speed +${vehicle_fragment}= vehicle-brandname-fragment.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${content_type}= application/xml *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) - [Tags] ea-partial-update 6_3_4 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) + [Tags] ea-partial-update 6_3_4 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${content_type} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code 415 ${response['status']} + [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_03_02_endpoint patch /subscriptions/{subscriptionId} - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) - [Tags] sub-update 6_3_4 - - ${id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Subscription ${id} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) + [Tags] sub-update 6_3_4 + ${id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} + Check Response Status Code 415 ${response['status']} + [Teardown] Delete Subscription ${id} 044_03_03_endpoint post /entities/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) - [Tags] e-create 6_3_4 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) + [Tags] e-create 6_3_4 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} + Check Response Status Code 415 ${response['status']} + [Teardown] Delete Entity by Id ${entity_id} 044_03_04_endpoint post /subscriptions/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) - [Tags] sub-create 6_3_4 - - ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Subscription ${subscriptions_id} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) + [Tags] sub-create 6_3_4 + ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} + Check Response Status Code 415 ${response['status']} + [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) - [Tags] be-create 6_3_4 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${content_type} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 415 - - [Teardown] Batch Delete Entities @{expected_entities_ids} + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) + [Tags] be-create 6_3_4 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${building_filename} ${first_entity_id} + ${second_entity}= Load Entity ${building_filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + Batch Create Entities @{entities_to_be_created} content_type=${content_type} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 415 + [Teardown] Batch Delete Entities @{expected_entities_ids} 044_03_06_endpoint post /temporal/entities/ - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) - [Tags] te-create 6_3_4 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} - Check Response Status Code 415 ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) + [Tags] te-create 6_3_4 + ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} + Check Response Status Code 415 ${response['status']} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index e583bee4..a46c31c4 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -1,59 +1,53 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${accept}= application/xml -${status_code}= 406 - -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${accept}= application/xml +${status_code}= 406 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_04_01_endpoint get /entities/{entityId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) - [Tags] e-query 6_3_4 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Query Entity ${entity_id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) + [Tags] e-query 6_3_4 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Query Entity ${entity_id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_04_02_endpoint get /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - [Tags] sub-retrieve 6_3_4 - ${id}= Generate Random Entity Id ${subscription_id_prefix} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + [Tags] sub-retrieve 6_3_4 + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${id} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Subscription ${id} 044_04_03_endpoint get /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - [Tags] csr-query 6_3_4 - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) + [Tags] csr-query 6_3_4 + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} 044_04_04_endpoint get /csourceSubscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) - [Tags] csrsub-query - Query Context Source Registration Subscriptions accept=${accept} - Check Response Status Code Set To ${status_code} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) + [Tags] csrsub-query + Query Context Source Registration Subscriptions accept=${accept} + Check Response Status Code Set To ${status_code} 044_04_05_endpoint get /temporal/entities - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - [Tags] te-query 6_3_4 - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} - Check Response Status Code Set To ${status_code} \ No newline at end of file + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] te-query 6_3_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Check Response Status Code Set To ${status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index cfc518b7..4fa70f5e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -1,41 +1,35 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${accept}= application/geo+json -${status_code}= 406 - -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${accept}= application/geo+json +${status_code}= 406 +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_05_01 Retrieve subscription by id - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) - [Tags] sub-retrieve 6_3_4 - - ${id}= Generate Random Entity Id ${subscription_id_prefix} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + [Tags] sub-retrieve 6_3_4 + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${id} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Subscription ${id} 044_05_02 Query temporal entities - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - [Tags] te-query 6_3_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} - Check Response Status Code Set To ${status_code} + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] te-query 6_3_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Check Response Status Code Set To ${status_code} 044_05_03 Query context source registration - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) - [Tags] csr-query 6_3_4 - - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} \ No newline at end of file + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Tags] csr-query 6_3_4 + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index 2fadeb4c..f4cf0a39 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -1,34 +1,29 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json *** Test Case *** Retrieve Detailed Representation Of Available Attribute Without Context - [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute - [Tags] ed-attr 5_7_10 - - Retrieve Attribute attribute_name=airQualityLevel - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute + [Tags] ed-attr 5_7_10 + Retrieve Attribute attribute_name=airQualityLevel + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Entities - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${entity_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index 34c6949b..1cf3cc6c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -1,34 +1,29 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/attribute-027-01-expectation.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/attribute-027-01-expectation.json *** Test Case *** Retrieve Detailed Representation Of Available Attribute - [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes - [Tags] ed-attr 5_7_10 - - Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing Attribute element ${expectation_file} + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + [Tags] ed-attr 5_7_10 + Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing Attribute element ${expectation_file} *** Keywords *** Setup Initial Entities - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${entity_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index ce78ce6b..be48c9dd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -1,39 +1,36 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Retrieve Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a list of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Retrieve Available Attributes +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext + ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json + [Tags] ed-attrs 5_7_8 -*** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json - [Tags] ed-attrs 5_7_8 -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json - [Tags] ed-attrs 5_7_8 +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json + [Tags] ed-attrs 5_7_8 *** Keywords *** Retrieve Available Attributes - [Arguments] ${context} ${expectation_file} - [Documentation] Check that you can retrieve a list of NGSI-LD attributes - - Retrieve Attributes ${context} - - Check Response Status Code Set To 200 - Check Response Body Containing AttributeList element ${expectation_file} + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list of NGSI-LD attributes + Retrieve Attributes ${context} + Check Response Status Code Set To 200 + Check Response Body Containing AttributeList element ${expectation_file} Setup Initial Entities - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${entity_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index f58d3b95..850b8d6f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -1,38 +1,33 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json *** Test Case *** Retrieve Detailed Representation Of Available Entity Type Without Context - [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type - [Tags] ed-type 5_7_7 - - Retrieve Entity Type type=Building - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type + [Tags] ed-type 5_7_7 + Retrieve Entity Type type=Building + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index be6d2581..fe997933 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -1,38 +1,33 @@ *** Settings *** -Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json *** Test Case *** Retrieve Detailed Representation Of Available Entity Type - [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type - [Tags] ed-type 5_7_7 - - Retrieve Entity Type type=Building context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTypeInfo element ${expectation_file} + [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type + [Tags] ed-type 5_7_7 + Retrieve Entity Type type=Building context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeInfo element ${expectation_file} *** Keywords *** Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 50c1d452..e3a33a8e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -1,45 +1,42 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Retrieve Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a list of NGSI-LD entity types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Retrieve Available Entity Types +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext + ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json + [Tags] ed-types 5_7_5 -*** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json - [Tags] ed-types 5_7_5 -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json - [Tags] ed-types 5_7_5 +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json + [Tags] ed-types 5_7_5 *** Keywords *** Retrieve Available Entity Types - [Arguments] ${context} ${expectation_file} - [Documentation] Check that you can retrieve a list of NGSI-LD entity types - - Retrieve Entity Types ${context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTypeList element ${expectation_file} + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list of NGSI-LD entity types + Retrieve Entity Types ${context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTypeList element ${expectation_file} Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - - Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index bf74cec7..e6df2a5c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -1,39 +1,36 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Retrieve Details Of Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Retrieve Details Of Available Attributes +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext + ${EMPTY} types/expectations/attribute-026-01-01-expectation.json + [Tags] ed-attrs-details 5_7_9 -*** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext ${EMPTY} types/expectations/attribute-026-01-01-expectation.json - [Tags] ed-attrs-details 5_7_9 -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json - [Tags] ed-attrs-details 5_7_9 +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json + [Tags] ed-attrs-details 5_7_9 *** Keywords *** Retrieve Details Of Available Attributes - [Arguments] ${context} ${expectation_file} - [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes - - Retrieve Attributes context=${context} details=${TRUE} - - Check Response Status Code Set To 200 - Check Response Body Containing Attribute element ${expectation_file} + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + Retrieve Attributes context=${context} details=${TRUE} + Check Response Status Code Set To 200 + Check Response Body Containing Attribute element ${expectation_file} Setup Initial Entities - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${entity_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${entity_id} + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index 5ea6183a..b03c52f3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -1,45 +1,42 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Retrieve Details Of Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Retrieve Details Of Available Entity Types +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + +*** Test Cases *** CONTEXT EXPECTATION_FILE +WithoutJsonLdContext + ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json + [Tags] ed-types-details 5_7_6 -*** Test Cases *** CONTEXT EXPECTATION_FILE -WithoutJsonLdContext ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json - [Tags] ed-types-details 5_7_6 -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json - [Tags] ed-types-details 5_7_6 +WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json + [Tags] ed-types-details 5_7_6 *** Keywords *** Retrieve Details Of Available Entity Types - [Arguments] ${context} ${expectation_file} - [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types - - Retrieve Entity Types context=${context} details=${TRUE} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityType element ${expectation_file} + [Arguments] ${context} ${expectation_file} + [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + Retrieve Entity Types context=${context} details=${TRUE} + Check Response Status Code Set To 200 + Check Response Body Containing EntityType element ${expectation_file} Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - - Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index a4e05bf8..ddecc8f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -1,45 +1,39 @@ *** Settings *** -Documentation Check that you can query several entities based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building - -*** Test Cases *** -Query several entities based on ids - [Documentation] Check that you can query several entities based on ids - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building + +*** Test Cases *** +Query several entities based on ids + [Documentation] Check that you can query several entities based on ids + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 62e392a1..1bbc2efd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -1,49 +1,44 @@ *** Settings *** -Documentation Check that you can query several entities based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the entities types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld -${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld -${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking - - -*** Test Cases *** -Query several entities based on the entities types - [Documentation] Check that you can query several entities based on the entities types - [Tags] e-query 5_7_2 - - ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld +${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld +${building_entity_type}= https://ngsi-ld-test-suite/context#Building +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking + +*** Test Cases *** +Query several entities based on the entities types + [Documentation] Check that you can query several entities based on the entities types + [Tags] e-query 5_7_2 + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 200 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} - + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} - Delete Entity by Id Returning Response ${parking_entity_id} \ No newline at end of file + [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id Returning Response ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index 0bbd5057..9e10a94a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query several entities based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* -*** Test Cases *** +*** Test Cases *** Query several entities based on the given id pattern - [Documentation] Check that you can query several entities based on the given id pattern - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} + [Documentation] Check that you can query several entities based on the given id pattern + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 82c16cf3..65ac3884 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -1,41 +1,37 @@ *** Settings *** -Documentation Check that you can query several entities based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on attribute names +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${filename2}= building-minimal-sample.jsonld -${expectation_filename}= building-attributes-query-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Test Cases *** +*** Test Cases *** Query several entities based on attribute names - [Documentation] Check that you can query several entities based on attribute names - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_compared}= Create List ${first_entity_id} + [Documentation] Check that you can query several entities based on attribute names + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index a5195181..364607e5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you can query entitites based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites based on a list of properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-geoproperty-query-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-geoproperty-query-expectation.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location -*** Test Cases *** +*** Test Cases *** Query several entities based on a list of properties - [Documentation] Check that you can query entitites based on a list of properties - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + [Documentation] Check that you can query entitites based on a list of properties + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index 5c91b7df..f194aab7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -1,43 +1,39 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building -*** Test Cases *** +*** Test Cases *** Query several entities via POST Interaction based on ids - [Documentation] Check that you can query several entities via POST Interaction based on ids - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + [Documentation] Check that you can query several entities via POST Interaction based on ids + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index a7f62d5d..f5a903a5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -1,47 +1,44 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the entities types +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld -${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld -${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld +${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld +${building_entity_type}= https://ngsi-ld-test-suite/context#Building +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking -*** Test Cases *** +*** Test Cases *** Query several entities via POST Interaction based on the entities types - [Documentation] Check that you can query several entities via POST Interaction based on the entities types - [Tags] e-query 5_7_2 - - ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} + [Documentation] Check that you can query several entities via POST Interaction based on the entities types + [Tags] e-query 5_7_2 + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} - Delete Entity by Id Returning Response ${parking_entity_id} \ No newline at end of file + [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} + Delete Entity by Id Returning Response ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 20051903..38397fdf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -1,38 +1,35 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* -*** Test Cases *** +*** Test Cases *** Query several entities via POST Interaction based on the given id pattern - [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 83e0c229..04edd2e6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on attribute names +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Test Cases *** +*** Test Cases *** Query several entities via POST Interaction based on attribute names - [Documentation] Check that you can query several entities via POST Interaction based on attribute names - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} + [Documentation] Check that you can query several entities via POST Interaction based on attribute names + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 1329bdcd..8a7c4828 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query entitites via POST Interaction based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites via POST Interaction based on a list of properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location -*** Test Cases *** +*** Test Cases *** Query several entities via POST Interaction based on a list of properties - [Documentation] Check that you can query entitites via POST Interaction based on a list of properties - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - @{entity_types_to_be_retrieved}= Create List ${entity_type} + [Documentation] Check that you can query entitites via POST Interaction based on a list of properties + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + @{entity_types_to_be_retrieved}= Create List ${entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index 98d7157b..b1fe0765 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested ids are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested ids are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_invalid_id_one}= thisisaninvaliduri1 -${entity_invalid_id_two}= thisisaninvaliduri2 +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_invalid_id_one}= thisisaninvaliduri1 +${entity_invalid_id_two}= thisisaninvaliduri2 -*** Test Cases *** -Query entities based on incorrect ids - [Documentation] Check that you cannot query entities if the requested ids are incorrect - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} +*** Test Cases *** +Query entities based on incorrect ids + [Documentation] Check that you cannot query entities if the requested ids are incorrect + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index 97f6fb4d..f80a098a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -1,41 +1,36 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested entity types are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested entity types are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${invalid_entity_type_one}= invalid_entity_type_one -${invalid_entity_type_two}= invalid_entity_type_two - - -*** Test Cases *** -Query entities based on incorrect entity types - [Documentation] Check that you cannot query entities if the requested entity types are incorrect - [Tags] e-query 5_7_2 - - ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_entity_type_one} ${invalid_entity_type_two} +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${invalid_entity_type_one}= invalid_entity_type_one +${invalid_entity_type_two}= invalid_entity_type_two + +*** Test Cases *** +Query entities based on incorrect entity types + [Documentation] Check that you cannot query entities if the requested entity types are incorrect + [Tags] e-query 5_7_2 + ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_entity_type_one} ${invalid_entity_type_two} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} - + [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} - Delete Entity by Id Returning Response ${building_entity_id} - Delete Entity by Id Returning Response ${vehicle_entity_id} \ No newline at end of file + [Arguments] ${building_entity_id} ${vehicle_entity_id} + Delete Entity by Id Returning Response ${building_entity_id} + Delete Entity by Id Returning Response ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 0f9e28ae..70b83b93 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -1,38 +1,34 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested id pattern is incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested id pattern is incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_entity_id_pattern}= invalid_entity_id_pattern* +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_entity_id_pattern}= invalid_entity_id_pattern* -*** Test Cases *** +*** Test Cases *** Query several entities based on incorrect id pattern - [Documentation] Check that you cannot query entities if the requested id pattern is incorrect - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + [Documentation] Check that you cannot query entities if the requested id pattern is incorrect + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_id_pattern=${invalid_entity_id_pattern} entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 94a4bb55..66f6cea8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -1,38 +1,35 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested attribute names are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested attribute names are incorrect +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= invalid -${invalid_attribute_two}= invalid -*** Test Cases *** -Query several entities based on incorrect attribute names - [Documentation] Check that you cannot query entities if the requested attribute names are incorrect - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_attribute_one}= invalid +${invalid_attribute_two}= invalid - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} +*** Test Cases *** +Query several entities based on incorrect attribute names + [Documentation] Check that you cannot query entities if the requested attribute names are incorrect + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index cc4acfca..f603c3f1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -1,42 +1,37 @@ *** Settings *** -Documentation Check that you cannot query entitites if the request has a wrong geometryProperty -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entitites if the request has a wrong geometryProperty +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${entity_type}= Building -${georel}= invalid -${geometry}= Point -${coordinates}= [-8.503,41.202] -${geoproperty}= location - -*** Test Cases *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${entity_type}= Building +${georel}= invalid +${geometry}= Point +${coordinates}= [-8.503,41.202] +${geoproperty}= location + +*** Test Cases *** Query entitites when the request has a wrong geometryProperty - [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty - [Tags] e-query 5_7_2 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty + [Tags] e-query 5_7_2 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geoproperty} georel=${georel} geometry=${geometry} coordinates=${coordinates} context=${ngsild_test_suite_context} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index a815d4bd..4dd311ff 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -1,44 +1,40 @@ *** Settings *** -Documentation Check that the queried entities by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by Id can be returned in a simplified representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${entity_type}= https://ngsi-ld-test-suite/context#Building +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json +${options_parameter}= keyValues +${entity_type}= https://ngsi-ld-test-suite/context#Building -*** Test Cases *** +*** Test Cases *** Query entities in a simplified representation - [Documentation] Check that the queried entities by Id can be returned in a simplified representation - [Tags] e-query 6_3_7 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + [Documentation] Check that the queried entities by Id can be returned in a simplified representation + [Tags] e-query 6_3_7 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} options=${options_parameter} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 2631f1c6..9fa6c4eb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -1,44 +1,40 @@ *** Settings *** -Documentation Check that the queried entities by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by id can be returned in a geoJSON format +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${accept_header}= application/geo+json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${accept_header}= application/geo+json -*** Test Cases *** -Get an entity by id that can be returned in a geoJSON format - [Documentation] Check that the queried entities by id can be returned in a geoJSON format - [Tags] e-query 6_3_7 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} - Check Response Status Code 200 ${response['status']} +*** Test Cases *** +Get an entity by id that can be returned in a geoJSON format + [Documentation] Check that the queried entities by id can be returned in a geoJSON format + [Tags] e-query 6_3_7 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} + Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 8673edcf..ab1e9a76 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -1,44 +1,40 @@ *** Settings *** -Documentation Check that you can query entities specifying a maximum number of results -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entities specifying a maximum number of results +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${limit}= 2 +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${limit}= 2 -*** Test Cases *** -Query entities specifying a maximum number of results - [Documentation] Check that you can query entities specifying a maximum number of results - [Tags] e-query 6_3_10 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} - Check Response Status Code 200 ${response['status']} - @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} +*** Test Cases *** +Query entities specifying a maximum number of results + [Documentation] Check that you can query entities specifying a maximum number of results + [Tags] e-query 6_3_10 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} + ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} + Check Response Status Code 200 ${response['status']} + @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} - - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} - + [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} - Delete Entity by Id Returning Response ${first_entity_id} - Delete Entity by Id Returning Response ${second_entity_id} - Delete Entity by Id Returning Response ${third_entity_id} \ No newline at end of file + [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} + Delete Entity by Id Returning Response ${first_entity_id} + Delete Entity by Id Returning Response ${second_entity_id} + Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index e7223e10..f1d81a93 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -1,25 +1,22 @@ *** Settings *** -Documentation Check that you can get an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can get an entity by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-expectation.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-expectation.jsonld -*** Test Cases *** +*** Test Cases *** 018_01_01_Get an entity by id - [Documentation] Check that you can get an entity by id - [Tags] e-retrieve 5_7_1 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Documentation] Check that you can get an entity by id + [Tags] e-retrieve 5_7_1 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 11f04b74..a4badafb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -1,28 +1,25 @@ *** Settings *** -Documentation Check that you can query some attributes from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query some attributes from an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-query-expectation.jsonld -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-query-expectation.jsonld +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Test Cases *** +*** Test Cases *** 018_01_02_Query some attributes from an entity - [Documentation] Check that you can query some attributes from an entity - [Tags] e-retrieve 5_7_1 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + [Documentation] Check that you can query some attributes from an entity + [Tags] e-retrieve 5_7_1 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index 657ec527..ba2888ba 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -1,26 +1,23 @@ *** Settings *** -Documentation Check that you can query the geometry property from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query the geometry property from an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-geoproperty-query-expectation.jsonld -${geometry_property}= location +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-geoproperty-query-expectation.jsonld +${geometry_property}= location -*** Test Cases *** +*** Test Cases *** 018_01_03_Query the geometry property from an entity - [Documentation] Check that you can query the geometry property from an entity - [Tags] e-retrieve 5_7_1 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Documentation] Check that you can query the geometry property from an entity + [Tags] e-retrieve 5_7_1 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index e770eb73..e03d9525 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -1,21 +1,22 @@ *** Settings *** -Documentation Check that you cannot get an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot get an entity with invalid/missing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Get Entity With Invalid/Missing Id -Test Template Get Entity With Invalid/Missing Id +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +018_02_01_Get an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01_Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -018_02_02_Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +018_02_02_Get an entity if the Entity Id is not a valid URI + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -*** Keywords *** +*** Keywords *** Get Entity With Invalid/Missing Id - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - [Documentation] Check that you cannot get an entity with invalid/missing id - [Tags] e-retrieve 5_7_1 - + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} + [Documentation] Check that you cannot get an entity with invalid/missing id + [Tags] e-retrieve 5_7_1 ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index d6a3d98e..50e53357 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -1,19 +1,18 @@ *** Settings *** -Documentation Check that you cannot get an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if the entity id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Cases *** -Get an entity if the Entity Id is not known to the system - [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system - [Tags] e-retrieve 5_6_6 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +*** Test Cases *** +Get an entity if the Entity Id is not known to the system + [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system + [Tags] e-retrieve 5_6_6 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 985577af..01e547bb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -1,27 +1,24 @@ *** Settings *** -Documentation Check that you cannot get an entity if an attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if an attribute is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${attribute_not_known}= property_not_found +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${attribute_not_known}= property_not_found -*** Test Cases *** -Get an entity if an attribute is not known to the system - [Documentation] Check that you cannot get an entity if an attribute is not known to the system - [Tags] e-retrieve 5_6_6 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} +*** Test Cases *** +Get an entity if an attribute is not known to the system + [Documentation] Check that you cannot get an entity if an attribute is not known to the system + [Tags] e-retrieve 5_6_6 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index fd5a4e10..1b623a6e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -1,26 +1,23 @@ *** Settings *** -Documentation Check that the queried entity by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by Id can be returned in a simplified representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld -${options_parameter}= keyValues - -*** Test Cases *** -Get an entity in a simplified representation - [Documentation] Check that the queried entity by Id can be returned in a simplified representation - [Tags] e-retrieve 6_3_7 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld +${options_parameter}= keyValues +*** Test Cases *** +Get an entity in a simplified representation + [Documentation] Check that the queried entity by Id can be returned in a simplified representation + [Tags] e-retrieve 6_3_7 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 4c2fe22f..828c3b0d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -1,27 +1,24 @@ *** Settings *** -Documentation Check that the queried entity by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by id can be returned in a geoJSON format +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${accept_header}= application/geo+json - -*** Test Cases *** -Get an entity by id that can be returned in a geoJSON format - [Documentation] Check that the queried entity by id can be returned in a geoJSON format - [Tags] e-retrieve 6_3_7 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${expectation_filename}= building-simple-attributes-simplified-expectation.json +${options_parameter}= keyValues +${accept_header}= application/geo+json +*** Test Cases *** +Get an entity by id that can be returned in a geoJSON format + [Documentation] Check that the queried entity by id can be returned in a geoJSON format + [Tags] e-retrieve 6_3_7 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 3c731c3f..5854b089 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -1,40 +1,39 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entity -Suite Teardown Delete Created Entity - -Test Template Check Json-LD Resolution When retrieving an entity +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entity +Suite Teardown Delete Created Entity +Test Template Check Json-LD Resolution When retrieving an entity *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json -${creation_jsonld_expectation_filename}= building-simple-attributes-sample-compacted-expectation.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json +${creation_jsonld_expectation_filename}= building-simple-attributes-sample-compacted-expectation.json + +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + ${EMPTY} ${empty_jsonld_expectation_filename} + [Tags] e-retrieve 6_3_5 -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext ${EMPTY} ${empty_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 -CreationTimeJsonLdContext ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 +CreationTimeJsonLdContext + ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} + [Tags] e-retrieve 6_3_5 *** Keywords *** Check Json-LD Resolution When retrieving an entity - [Arguments] ${context} ${expected_payload} - [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present - - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} - Check Response Status Code 200 ${response['status']} + [Arguments] ${context} ${expected_payload} + [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} Setup Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} - - Set Suite Variable ${entity_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Set Suite Variable ${entity_id} Delete Created Entity - Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index a30567dc..9c30ce15 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -1,50 +1,46 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities +Documentation Check that you can query the temporal evolution of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld + [Tags] te-query 5_7_4 -*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld - [Tags] te-query 5_7_4 -Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld - [Tags] te-query 5_7_4 +Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities - [Arguments] ${timerel} ${timeAt} ${expectation_file} - [Documentation] Check that you can query the temporal evolution of entities - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} - + [Arguments] ${timerel} ${timeAt} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} - Set Suite Variable ${third_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index fe9fe306..c9ddf4ea 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of certain attributes of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of certain attributes of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld *** Test Case *** Query the temporal evolution of certain attributes of entities - [Documentation] Check that you can query the temporal evolution of certain attributes of entities - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of certain attributes of entities + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index cf73e3fc..8e4ae663 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of the last N instances of entities attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of the last N instances of entities attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld *** Test Case *** Query the temporal evolution of the last N instances of entities attributes - [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 86b566cf..91ec8bba 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of entities using a context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld *** Test Case *** Query the temporal evolution of entities using a context - [Documentation] Check that you can query the temporal evolution of entities using a context - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities using a context + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index 11c1b0fd..dba78de4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given type(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of entities matching the given type(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld *** Test Case *** Query the temporal evolution of entities matching the given type(s) - [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 7b6ce083..a7109959 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld *** Test Case *** Query the temporal evolution of entities matching the given identifier(s) - [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index f3f3f739..4c55cf96 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of entities matching the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld *** Test Case *** Query the temporal evolution of entities matching the given id pattern - [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 5615c6fc..55b03d74 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -1,39 +1,35 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld *** Test Case *** Query the temporal evolution of entities matching the given NGSI-LD query - [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} *** Keywords *** Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 4672ab2e..ff1be30b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -1,45 +1,42 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld - [Tags] te-query 5_7_4 -Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld - [Tags] te-query 5_7_4 +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE +Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld + [Tags] te-query 5_7_4 + +Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities matching the given NGSI-LD geo-query - [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} - [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index d5a4af7f..ea947e1d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -1,42 +1,34 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource - -Suite Setup Create Initial Context Source Registration -Suite Teardown Delete Initial Context Source Registration +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource +Suite Setup Create Initial Context Source Registration +Suite Teardown Delete Initial Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_url}= http://${context_source_host}:${context_source_port} +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_url}= http://${context_source_host}:${context_source_port} *** Test Case *** Query the temporal evolution of entities matching the given NGSI-LD context source filter - [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter - [Tags] te-query 5_7_4 - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter + [Tags] te-query 5_7_4 + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} Wait for redirected request - Check Response Status Code Set To 200 + Check Response Status Code Set To 200 *** Keywords *** Create Initial Context Source Registration Start Context Source Mock Server - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Initial Context Source Registration Stop Context Source Mock Server - - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 401b89fa..90a849e3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -1,51 +1,48 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved +Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld - +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-11-expectation.jsonld -*** Test Cases *** LIMIT EXPECTATION_FILE TEMPORAL_ENTITIES_REPRESENTATION_IDS -Query Some entities ${2} vehicles-temporal-representation-021-11-01-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - [Tags] te-query 5_7_4 -Query All entities ${20} vehicles-temporal-representation-021-11-02-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} ${third_temporal_entity_representation_id} - [Tags] te-query 5_7_4 +*** Test Cases *** LIMIT EXPECTATION_FILE TEMPORAL_ENTITIES_REPRESENTATION_IDS +Query Some entities + ${2} vehicles-temporal-representation-021-11-01-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + [Tags] te-query 5_7_4 + +Query All entities + ${20} vehicles-temporal-representation-021-11-02-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} ${third_temporal_entity_representation_id} + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities with a limit to the number of entities to be retrieved - [Arguments] ${limit} ${expectation_file} @{temporal_entities_representation_ids} - [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved - - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus - - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Arguments] ${limit} ${expectation_file} @{temporal_entities_representation_ids} + [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} - Set Suite Variable ${third_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index 91865dfc..8aea5ab2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -1,32 +1,29 @@ *** Settings *** -Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Query the temporal evolution of entities with an invalid request - [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request - [Tags] te-query 5_7_4 - - Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request + [Tags] te-query 5_7_4 + Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index b3b4994e..a63eda6c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -1,43 +1,40 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using the entityOperations method -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities using the entityOperations method +Documentation Check that you can query the temporal evolution of entities using the entityOperations method +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities using the entityOperations method *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE +After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld + [Tags] te-query 5_7_4 -*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE -After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld - [Tags] te-query 5_7_4 -Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld - [Tags] te-query 5_7_4 +Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld + [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities using the entityOperations method - [Arguments] ${payload_file} ${expectation_file} - [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method - - Query Temporal Representation Of Entities Via Post ${payload_file} - - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} - - Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + [Arguments] ${payload_file} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method + Query Temporal Representation Of Entities Via Post ${payload_file} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} Setup Initial Entities - ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index cb7b5412..357363c8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -1,32 +1,29 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve the temporal evolution of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity - [Documentation] Check that you can retrieve the temporal evolution of an entity - [Tags] te-retrieve 5_7_3 - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Documentation] Check that you can retrieve the temporal evolution of an entity + [Tags] te-retrieve 5_7_3 + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index c6a92e2a..6f72293b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -1,32 +1,29 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve the temporal evolution of an entity using a context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity using a context - [Documentation] Check that you can retrieve the temporal evolution of an entity using a context - [Tags] te-retrieve 5_7_3 - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Documentation] Check that you can retrieve the temporal evolution of an entity using a context + [Tags] te-retrieve 5_7_3 + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 22a0e539..bc181809 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -1,33 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of certain attributes of an entity - [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity - [Tags] te-retrieve 5_7_3 - - @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity + [Tags] te-retrieve 5_7_3 + @{temporal_attributes_to_be_retrieved}= Create List fuelLevel + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 0554218e..558a569e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -1,39 +1,38 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query +Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE +After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld + [Tags] te-retrieve 5_7_3 -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 -Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 -Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld - [Tags] te-retrieve 5_7_3 +Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld + [Tags] te-retrieve 5_7_3 + +Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld + [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} - [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} + [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 780edef0..16a2ec54 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -1,37 +1,37 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of the last N instances of entity attributes +Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of the last N instances of entity attributes *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld + +*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE +Retrieve Some Instances + ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld + [Tags] te-retrieve 5_7_3 -*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE -Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 -Retrieve All Instances ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 +Retrieve All Instances + ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of the last N instances of entity attributes - [Arguments] ${lastN} ${vehicle_expectation_file} - [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Arguments] ${lastN} ${vehicle_expectation_file} + [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 604b4340..7354c0af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve the temporal evolution of an entity with an invalid id - [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) - [Tags] te-retrieve 5_7_3 - - Retrieve Temporal Representation Of Entity invalidUri - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) + [Tags] te-retrieve 5_7_3 + Retrieve Temporal Representation Of Entity invalidUri + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 8d576807..762b54f1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve the temporal evolution of a non-existing entity - [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity - [Tags] te-retrieve 5_7_3 - - Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity + [Tags] te-retrieve 5_7_3 + Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index cdc0934c..11ece9f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -1,33 +1,30 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Retrieve the temporal evolution of non-existing entity attributes - [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes - [Tags] te-retrieve 5_7_3 - - @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes + [Tags] te-retrieve 5_7_3 + @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index ca17f3e2..24c23044 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -1,40 +1,39 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity with an invalid request content +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity with an invalid request content *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT -After after ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 -Before before ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 -Between between 2020-08-01T12:00:00Z ${EMPTY} - [Tags] te-retrieve 5_7_3 +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT +After after ${EMPTY} ${EMPTY} + [Tags] te-retrieve 5_7_3 -*** Keywords *** -Retrieve the temporal evolution of an entity with an invalid request content - [Arguments] ${timerel} ${timeAt} ${endTimeAt} - [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content +Before before ${EMPTY} ${EMPTY} + [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} +Between between 2020-08-01T12:00:00Z ${EMPTY} + [Tags] te-retrieve 5_7_3 - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Keywords *** +Retrieve the temporal evolution of an entity with an invalid request content + [Arguments] ${timerel} ${timeAt} ${endTimeAt} + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 4cba1f70..3a8e53a5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -1,33 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld *** Test Case *** Retrieve the temporal evolution of an entity with the simplified temporal representation - [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation - [Tags] te-retrieve 5_7_3 - - @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation + [Tags] te-retrieve 5_7_3 + @{options}= Create List temporalValues + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} *** Keywords *** Setup Initial Entities - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 4ec63d94..6e57f39b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -1,44 +1,43 @@ *** Settings *** -Documentation Check that you can create a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Batch Create Entity Scenarios +Documentation Check that you can create a batch of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Batch Create Entity Scenarios *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME -MinimalEntity building-minimal-sample.jsonld - [Tags] be-create 5_6_7 -EntityWithSimpleProperties building-simple-attributes-sample.jsonld - [Tags] be-create 5_6_7 -EntityWithSimpleRelationships building-relationship-sample.jsonld - [Tags] be-create 5_6_7 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld - [Tags] be-create 5_6_7 - -*** Keywords *** -Batch Create Entity Scenarios - [Arguments] ${filename} - [Documentation] Check that you can create a batch of entities - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${filename} ${first_entity_id} - ${second_entity}= Load Entity ${filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} +${building_id_prefix}= urn:ngsi-ld:Building: - Batch Create Entities @{entities_to_be_created} +*** Test Cases *** FILENAME +MinimalEntity building-minimal-sample.jsonld + [Tags] be-create 5_6_7 - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld + [Tags] be-create 5_6_7 - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} +EntityWithSimpleRelationships + building-relationship-sample.jsonld + [Tags] be-create 5_6_7 - Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Created Resources Set To ${entities_to_be_created} +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld + [Tags] be-create 5_6_7 - Batch Delete Entities @{expected_entities_ids} +*** Keywords *** +Batch Create Entity Scenarios + [Arguments] ${filename} + [Documentation] Check that you can create a batch of entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + Batch Create Entities @{entities_to_be_created} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Created Resources Set To ${entities_to_be_created} + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index f16d0112..f5533c25 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -1,45 +1,39 @@ *** Settings *** -Documentation Check that you can create a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities +Documentation Check that you can create a batch of entities where some will succeed and others will fail +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of two valid entities and one invalid entity - [Documentation] Check that you can create a batch of two valid entities and one invalid entity - [Tags] be-create 5_6_7 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + [Documentation] Check that you can create a batch of two valid entities and one invalid entity + [Tags] be-create 5_6_7 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} # TODO: Use Load Test Sample keyword instead - ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} - ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} - - Batch Create Entities @{entities_to_be_created} - - @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - @{expected_failed_entities_ids}= Create List ${existing_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} - Check Response Status Code Set To 207 - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - - ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - @{created_entities}= Create List ${first_entity} ${second_entity} - Check Created Resources Set To ${created_entities} - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} + Batch Create Entities @{entities_to_be_created} + @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + @{expected_failed_entities_ids}= Create List ${existing_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + @{created_entities}= Create List ${first_entity} ${second_entity} + Check Created Resources Set To ${created_entities} + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** Setup Initial Entities - ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${existing_entity_id} - Set Suite Variable ${existing_entity_id} + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${existing_entity_id} + Set Suite Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index 0999854a..e60bc441 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot create a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot create a batch of entities with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Create Batch Entity With Invalid Request Scenarios -Test Template Create Batch Entity With Invalid Request Scenarios +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-create 5_6_7 -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-create 5_6_7 -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-create 5_6_7 +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-create 5_6_7 *** Keywords *** Create Batch Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} - [Documentation] Check that you cannot create a batch of entities with an invalid request - - Batch Request Entities From File create filename=${filename} - - Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + [Arguments] ${filename} ${problem_type} + [Documentation] Check that you cannot create a batch of entities with an invalid request + Batch Request Entities From File create filename=${filename} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index 5f86d21a..1a547522 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -1,32 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using a provided Link header with JSON content type - [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 201 - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Check Response Status Code Set To 201 + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this attribute - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - - @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 61cef9ef..5bc75782 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -1,32 +1,26 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using the default context with JSON content type - [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 201 - - Retrieve Entity by Id ${entity_id} + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code Set To 201 + Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://uri.etsi.org/ngsi-ld/default-context/almostFull - - @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Body Containing an Attribute set to https://uri.etsi.org/ngsi-ld/default-context/almostFull + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index fcbccc0f..3c8855f2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -1,23 +1,20 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity containing a JSON-LD @context with a JSON content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index c0ca0545..29ba557f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -1,32 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity using a JSON-LD @context obtained from the request payload - [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - - Check Response Status Code Set To 201 - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code Set To 201 + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - - @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + @{entities_ids_to_be_deleted}= Create List ${entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index 694d22ee..e9f550f6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -1,23 +1,20 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 049755b3..6db7bf66 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -1,23 +1,20 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Create a batch of one entity with a Link header and a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] be-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} - @{entities_to_be_created}= Create List ${entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] be-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} + @{entities_to_be_created}= Create List ${entity} + Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 3c15fde6..b305333c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -1,36 +1,29 @@ *** Settings *** -Documentation Check that you can delete a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities +Documentation Check that you can delete a batch of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of entities - [Documentation] Check that you can delete a batch of entities - [Tags] be-delete 5_6_10 - - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - - Batch Delete Entities @{entities_ids_to_be_deleted} - - Check Response Status Code Set To 204 - - ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} - - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + [Documentation] Check that you can delete a batch of entities + [Tags] be-delete 5_6_10 + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Status Code Set To 204 + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources *** Keywords *** Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} - Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index 7b51d982..f37b0f36 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -1,38 +1,31 @@ *** Settings *** -Documentation Check that you can delete a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities +Documentation Check that you can delete a batch of entities where some will succeed and others will fail +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of non existing and existing entities - [Documentation] Check that you can delete a batch of non existing and existing entities - [Tags] be-delete 5_6_10 - - ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} - - Batch Delete Entities @{entities_ids_to_be_deleted} - - @{expected_successful_entities_ids}= Create List ${existing_entity_id} - @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} - Check Response Status Code Set To 207 - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - - ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + [Documentation] Check that you can delete a batch of non existing and existing entities + [Tags] be-delete 5_6_10 + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} + @{expected_successful_entities_ids}= Create List ${existing_entity_id} + @{expected_failed_entities_ids}= Create List ${new_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources *** Keywords *** Setup Initial Entities - ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} - - Set Suite Variable ${existing_entity_id} + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} + Set Suite Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index 94af9bfb..bf013682 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot delete a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot delete a batch of entities with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Batch Delete Entity With Invalid Request Scenarios -Test Template Batch Delete Entity With Invalid Request Scenarios +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-delete 5_6_10 -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-delete 5_6_10 -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-delete 5_6_10 +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-delete 5_6_10 *** Keywords *** Batch Delete Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} - [Documentation] Check that you cannot delete a batch of entities with an invalid request - - Batch Request Entities From File delete filename=${filename} - - Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + [Arguments] ${filename} ${problem_type} + [Documentation] Check that you cannot delete a batch of entities with an invalid request + Batch Request Entities From File delete filename=${filename} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 078ef6d7..a1f79182 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -1,58 +1,57 @@ *** Settings *** -Documentation Check that you can update a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Batch Update Entity Scenarios -Suite Teardown Delete Initial Entities +Documentation Check that you can update a batch of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Batch Update Entity Scenarios +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json - [Tags] be-update 5_6_9 -EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-update 5_6_9 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json - [Tags] be-update 5_6_9 - -*** Keywords *** -Batch Update Entity Scenarios - [Arguments] ${filename} ${update_fragment_filename} - [Documentation] Check that you can update a batch of entities +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld - ${first_entity}= Load Entity ${filename} ${first_entity_id} - ${second_entity}= Load Entity ${filename} ${second_entity_id} - @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} - @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 - Batch Update Entities @{entities_to_be_updated} +EntityWithSimpleRelationships + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-update 5_6_9 - Check Response Status Code Set To 204 +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json + [Tags] be-update 5_6_9 - ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} - ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} +*** Keywords *** +Batch Update Entity Scenarios + [Arguments] ${filename} ${update_fragment_filename} + [Documentation] Check that you can update a batch of entities + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + Batch Update Entities @{entities_to_be_updated} + Check Response Status Code Set To 204 + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} - ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} - ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} - @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_entity_id} - Create Entity ${entity_payload_filename} ${second_entity_id} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_payload_filename} ${first_entity_id} + Create Entity ${entity_payload_filename} ${second_entity_id} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index aedeb79f..b8c8c2ff 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -1,58 +1,57 @@ *** Settings *** -Documentation Check that you can update a batch of entities with noOverwrite option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Batch Update Entity With NoOverwrite Option Scenarios -Suite Teardown Delete Initial Entities +Documentation Check that you can update a batch of entities with noOverwrite option +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Batch Update Entity With NoOverwrite Option Scenarios +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json - [Tags] be-update 5_6_9 -EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-update 5_6_9 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json - [Tags] be-update 5_6_9 - -*** Keywords *** -Batch Update Entity With NoOverwrite Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} - [Documentation] Check that you can update a batch of entities with noOverwrite option +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld - ${first_entity}= Load Entity ${filename} ${first_entity_id} - ${second_entity}= Load Entity ${filename} ${second_entity_id} - @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} - @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 - Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite +EntityWithSimpleRelationships + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-update 5_6_9 - Check Response Status Code Set To 204 +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json + [Tags] be-update 5_6_9 - ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} - ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} +*** Keywords *** +Batch Update Entity With NoOverwrite Option Scenarios + [Arguments] ${filename} ${update_fragment_filename} + [Documentation] Check that you can update a batch of entities with noOverwrite option + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code Set To 204 + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} - ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} - ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} - @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} Setup Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_entity_id} - Create Entity ${entity_payload_filename} ${second_entity_id} - - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_payload_filename} ${first_entity_id} + Create Entity ${entity_payload_filename} ${second_entity_id} + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 18b923e1..77275037 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -1,55 +1,46 @@ *** Settings *** -Documentation Check that you can update a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities +Documentation Check that you can update a batch of entities where some will succeed and others will fail +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld -${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of-property-fragment.json +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld +${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of-property-fragment.json *** Test Case *** Update a batch of non existing and existing entities - [Documentation] Check that you can update a batch of non existing and existing entities - [Tags] be-update 5_6_9 - - ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} - ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} - ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} - - @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} - - Batch Update Entities @{entities_to_be_updated} - - - @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} - Check Response Status Code Set To 207 - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - - ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} - ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_existing_entity_id} + [Documentation] Check that you can update a batch of non existing and existing entities + [Tags] be-update 5_6_9 + ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} + ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} + @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} + Batch Update Entities @{entities_to_be_updated} + @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + @{expected_failed_entities_ids}= Create List ${new_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} + ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} - ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} - ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} - @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} - ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} - - Batch Delete Entities @{expected_successful_entities_ids} + ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} + ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} + @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} + ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} + Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** Setup Initial Entities - ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_payload_filename} ${first_existing_entity_id} - Create Entity ${entity_payload_filename} ${second_existing_entity_id} - - Set Suite Variable ${first_existing_entity_id} - Set Suite Variable ${second_existing_entity_id} + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_payload_filename} ${first_existing_entity_id} + Create Entity ${entity_payload_filename} ${second_existing_entity_id} + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index f2cc856b..d7944d3e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot update a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot update a batch of entities with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Batch Update Entity With Invalid Request Scenarios -Test Template Batch Update Entity With Invalid Request Scenarios +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-update 5_6_9 -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-update 5_6_9 -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-update 5_6_9 +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} - [Documentation] Check that you cannot update a batch of entities with an invalid request - - Batch Request Entities From File update filename=${filename} - - Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + [Arguments] ${filename} ${problem_type} + [Documentation] Check that you cannot update a batch of entities with an invalid request + Batch Request Entities From File update filename=${filename} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index bd4f8d86..5eceefe3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -1,40 +1,40 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing entities and they will be created -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Batch Upsert Entity Scenarios +Documentation Check that you can upsert a batch of non-existing entities and they will be created +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Batch Upsert Entity Scenarios *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithSimpleRelationships building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 +${building_id_prefix}= urn:ngsi-ld:Building: -*** Keywords *** -Batch Upsert Entity Scenarios - [Arguments] ${filename} - [Documentation] Check that you can upsert a batch of non existing entities +*** Test Cases *** FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${filename} ${first_entity_id} - ${second_entity}= Load Entity ${filename} ${second_entity_id} - @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} +EntityWithSimpleRelationships + building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 - Batch Upsert Entities @{entities_to_be_upserted} +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} - - Batch Delete Entities @{expected_entities_ids} +*** Keywords *** +Batch Upsert Entity Scenarios + [Arguments] ${filename} + [Documentation] Check that you can upsert a batch of non existing entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity ${filename} ${first_entity_id} + ${second_entity}= Load Entity ${filename} ${second_entity_id} + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} + Batch Upsert Entities @{entities_to_be_upserted} + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index a41391e4..d8cda085 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -1,58 +1,56 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Batch Upsert Non-existing And Existing Entities Scenarios -Suite Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Batch Upsert Non-existing And Existing Entities Scenarios +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithSimpleRelationships building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 - -*** Keywords *** -Batch Upsert Non-existing And Existing Entities Scenarios - [Arguments] ${filename} - [Documentation] Check that you can upsert a batch of non existing and existing entities +${building_id_prefix}= urn:ngsi-ld:Building: - ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${new_entity}= Load Entity ${filename} ${new_entity_id} - ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} - ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} - @{entities_to_be_upserted}= Create List ${new_entity} ${first_existing_entity} ${second_existing_entity} +*** Test Cases *** FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 - Batch Upsert Entities @{entities_to_be_upserted} +EntityWithSimpleRelationships + building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 - @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 - @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} - ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} - - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} +*** Keywords *** +Batch Upsert Non-existing And Existing Entities Scenarios + [Arguments] ${filename} + [Documentation] Check that you can upsert a batch of non existing and existing entities + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity ${filename} ${new_entity_id} + ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} + ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} + @{entities_to_be_upserted}= Create List ${new_entity} ${first_existing_entity} ${second_existing_entity} + Batch Upsert Entities @{entities_to_be_upserted} + @{expected_entities_ids}= Create List ${new_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities - ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} - Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} - - Set Suite Variable ${first_existing_entity_id} - Set Suite Variable ${second_existing_entity_id} + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} + Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 858bbca1..90bb2146 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -1,51 +1,50 @@ *** Settings *** -Documentation Check that you can upsert a batch of existing entities and they will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Batch Upsert Existing Entities Scenarios -Suite Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of existing entities and they will be replaced +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Batch Upsert Existing Entities Scenarios +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithSimpleRelationships building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 - -*** Keywords *** -Batch Upsert Existing Entities Scenarios - [Arguments] ${filename} - [Documentation] Check that you can upsert a batch of existing entities +${building_id_prefix}= urn:ngsi-ld:Building: - ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} - ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} - @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} +*** Test Cases *** FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld + [Tags] be-upsert 5_6_8 - Batch Upsert Entities @{entities_to_be_upserted} +EntityWithSimpleRelationships + building-relationship-sample.jsonld + [Tags] be-upsert 5_6_8 - Check Response Status Code Set To 204 +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld + [Tags] be-upsert 5_6_8 - @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} +*** Keywords *** +Batch Upsert Existing Entities Scenarios + [Arguments] ${filename} + [Documentation] Check that you can upsert a batch of existing entities + ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} + ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} + @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} + Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code Set To 204 + @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} Setup Initial Entities - ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} - Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} - - Set Suite Variable ${first_existing_entity_id} - Set Suite Variable ${second_existing_entity_id} + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} + Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 5c60cddd..bcea78aa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -1,59 +1,57 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities with update option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Batch Upsert Entities With Update Option Scenarios -Suite Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of entities with update option +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Batch Upsert Entities With Update Option Scenarios +Suite Teardown Delete Initial Entities *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${existing_entity_payload_filename}= building-minimal-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json - [Tags] be-upsert 5_6_8 -EntityWithSimpleRelationships building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-upsert 5_6_8 -EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json - [Tags] be-upsert 5_6_8 - -*** Keywords *** -Batch Upsert Entities With Update Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} - [Documentation] Check that you can upsert a batch of entities with update option +${building_id_prefix}= urn:ngsi-ld:Building: +${existing_entity_payload_filename}= building-minimal-sample.jsonld - ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${new_entity}= Load Entity ${filename} ${new_entity_id} - ${existing_entity}= Load Entity ${filename} ${existing_entity_id} - @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} - @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json + [Tags] be-upsert 5_6_8 - Batch Upsert Entities @{entities_to_be_upserted} update_option=update +EntityWithSimpleRelationships + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + [Tags] be-upsert 5_6_8 - @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} +EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json + [Tags] be-upsert 5_6_8 - ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} +*** Keywords *** +Batch Upsert Entities With Update Option Scenarios + [Arguments] ${filename} ${update_fragment_filename} + [Documentation] Check that you can upsert a batch of entities with update option + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity ${filename} ${new_entity_id} + ${existing_entity}= Load Entity ${filename} ${existing_entity_id} + @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} + @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} + Batch Upsert Entities @{entities_to_be_upserted} update_option=update + @{expected_entities_ids}= Create List ${new_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} - ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} - @{updated_entities}= Create List ${new_entity} ${old_updated_entity} - ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} - - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} + @{updated_entities}= Create List ${new_entity} ${old_updated_entity} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${updated_entities} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities - ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${existing_entity_payload_filename} ${existing_entity_id} - - Set Suite Variable ${existing_entity_id} + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${existing_entity_payload_filename} ${existing_entity_id} + Set Suite Variable ${existing_entity_id} Delete Initial Entities - @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 9a7b0f90..dbcfb12e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -1,37 +1,32 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can upsert a batch of entities where some will succeed and others will fail +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Upsert a batch of two valid entities and one invalid entity - [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity - [Tags] be-upsert 5_6_8 - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} - ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} - ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} - ${invalid_entity}= Remove Entity Type ${third_entity} - - @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} - - Batch Upsert Entities @{entities_to_be_upserted} - - @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - @{expected_failed_entities_ids}= Create List ${third_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} - Check Response Status Code Set To 207 - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} - ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - @{upserted_entities}= Create List ${first_entity} ${second_entity} - Check Updated Resources Set To ${upserted_entities} - - Batch Delete Entities @{expected_successful_entities_ids} + [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity + [Tags] be-upsert 5_6_8 + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} + ${invalid_entity}= Remove Entity Type ${third_entity} + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} + Batch Upsert Entities @{entities_to_be_upserted} + @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + @{expected_failed_entities_ids}= Create List ${third_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} + Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + @{upserted_entities}= Create List ${first_entity} ${second_entity} + Check Updated Resources Set To ${upserted_entities} + Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index f9c0d8a5..584c2a75 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot upsert a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot upsert a batch of entities with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Batch Upsert Entity With Invalid Request Scenarios -Test Template Batch Upsert Entity With Invalid Request Scenarios +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} + [Tags] be-upsert 5_6_8 -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-upsert 5_6_8 -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-upsert 5_6_8 +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} - [Documentation] Check that you cannot upsert a batch of entities with an invalid request - - Batch Request Entities From File upsert filename=${filename} - - Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + [Arguments] ${filename} ${problem_type} + [Documentation] Check that you cannot upsert a batch of entities with an invalid request + Batch Request Entities From File upsert filename=${filename} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 977f9e32..950f90ac 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -1,35 +1,37 @@ *** Settings *** -Documentation Check that you can create an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Entity Scenarios +Documentation Check that you can create an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Create Entity Scenarios *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_01_MinimalEntity building-minimal-without-context-sample.jsonld application/json -001_01_02_EntityWithSimpleProperties building-simple-attributes-sample.jsonld application/ld+json -001_01_03_EntityWithRelationshipsProperties building-relationship-of-property-sample.jsonld application/ld+json -001_01_04_EntityWithLocationAttribute building-location-attribute-sample.jsonld application/ld+json +${building_id_prefix}= urn:ngsi-ld:Building: -*** Keywords *** -Create Entity Scenarios - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create an entity - [Tags] e-create 5_6_1 +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_01_MinimalEntity + building-minimal-without-context-sample.jsonld application/json - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +001_01_02_EntityWithSimpleProperties + building-simple-attributes-sample.jsonld application/ld+json - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} +001_01_03_EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld application/ld+json - ${created_entity}= Load Test Sample entities/${filename} ${entity_id} - Run Keyword If '${content_type}'=='application/json' Retrieve Entity by Id ${entity_id} ${content_type} - Run Keyword If '${content_type}'=='application/ld+json' Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} - Check Created Resource Set To ${created_entity} +001_01_04_EntityWithLocationAttribute + building-location-attribute-sample.jsonld application/ld+json - [Teardown] Delete Entity by Id ${entity_id} \ No newline at end of file +*** Keywords *** +Create Entity Scenarios + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create an entity + [Tags] e-create 5_6_1 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} + ${created_entity}= Load Test Sample entities/${filename} ${entity_id} + Run Keyword If '${content_type}'=='application/json' Retrieve Entity by Id ${entity_id} ${content_type} + Run Keyword If '${content_type}'=='application/ld+json' Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + Check Created Resource Set To ${created_entity} + [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 67ecf66c..b8cd1838 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -1,23 +1,25 @@ *** Settings *** -Documentation Check that you cannot create an entity with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot create an entity with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Create Entity With Invalid Request Scenarios -Test Template Create Entity With Invalid Request Scenarios +*** Test Cases *** FILENAME +001_02_01_InvalidJson + invalid-json-sample.jsonld -*** Test Cases *** FILENAME -001_02_01_InvalidJson invalid-json-sample.jsonld -001_02_02_EmptyJson empty-sample.jsonld -001_02_03_EntityWithNoContext building-minimal-without-context-sample.jsonld +001_02_02_EmptyJson + empty-sample.jsonld + +001_02_03_EntityWithNoContext + building-minimal-without-context-sample.jsonld *** Keywords *** Create Entity With Invalid Request Scenarios - [Arguments] ${filename} - [Documentation] Check that you cannot create an entity with an invalid request - [Tags] e-create 5_6_1 - - Request Entity From File ${filename} - + [Arguments] ${filename} + [Documentation] Check that you cannot create an entity with an invalid request + [Tags] e-create 5_6_1 + Request Entity From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index 94ec7535..e0fac02b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -1,27 +1,23 @@ *** Settings *** -Documentation Check that you cannot create an entity with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create an entity with an existing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${content_type}= application/ld+json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${content_type}= application/ld+json *** Test Case *** Create one valid entity and one invalid entity - [Documentation] Check that you cannot create an entity with an existing id - [Tags] e-create 5_6_1 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} - Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + [Documentation] Check that you cannot create an entity with an existing id + [Tags] e-create 5_6_1 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id ${entity_id} - + [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index 64c1226e..beefc9dd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -1,28 +1,23 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity using a provided Link header with JSON content type - [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - - Delete Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index fb132623..e586dc5d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -1,28 +1,23 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity using the default context with JSON content type - [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} - - Retrieve Entity by Id ${entity_id} + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull - - Delete Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index 7970e73a..eaec816c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -1,22 +1,19 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity containing a JSON-LD @context with a JSON content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index 971ee448..ed53efb7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -1,28 +1,23 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity using a JSON-LD @context obtained from the request payload - [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull - - Retrieve Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to almostFull + Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - - Delete Entity by Id ${entity_id} + Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index b405e5a4..1de14b95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -1,22 +1,19 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json *** Test Case *** Create one entity not containing a JSON-LD @context with a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index bf5114df..04a0f4dd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -1,22 +1,19 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld *** Test Case *** Create one entity with a Link header and a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] e-create 6_3_5 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] e-create 6_3_5 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index ae6a22b2..0ba8c5ac 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -1,23 +1,20 @@ *** Settings *** -Documentation Check that you can delete an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an entity by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity - [Documentation] Check that you can delete an entity by id - [Tags] e-delete 5_6_6 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json - Check Response Status Code 201 ${response['status']} - - ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code 204 ${response['status']} - - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + [Documentation] Check that you can delete an entity by id + [Tags] e-delete 5_6_6 + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + Check Response Status Code 201 ${response['status']} + ${response}= Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code 204 ${response['status']} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 180f5383..56ca59e8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -1,22 +1,23 @@ *** Settings *** -Documentation Check that you cannot delete an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an entity with invalid/missing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Delete Entity Scenarios -Test Template Delete Entity Scenarios +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +002_02_01_Delete an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_02_01_Delete an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -002_02_02_Delete an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +002_02_02_Delete an entity if the Entity Id is not a valid URI + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Entity Scenarios - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - [Documentation] Check that you cannot delete an entity with invalid/missing id + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} + [Documentation] Check that you cannot delete an entity with invalid/missing id [Tags] e-delete 5_6_6 - - ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + ${response}= Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index bd0f6b98..9ff21f86 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -1,21 +1,19 @@ *** Settings *** -Documentation Check that you cannot delete an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an entity if the entity id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${expected_status_code}= 404 +${building_id_prefix}= urn:ngsi-ld:Building: +${expected_status_code}= 404 *** Test Case *** Delete an entity with an id not known to the system - [Documentation] Check that you cannot delete an entity if the entity id is not known to the system + [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] e-delete 5_6_6 - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${response}= Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 649db970..fbb6af91 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -1,59 +1,54 @@ *** Settings *** -Documentation Check that you can append entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can append entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** -010_01_01_Append entity attributes - Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld +010_01_01_Append entity attributes + Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld + 010_01_02_Append entity attributes - Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld + Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld + 010_01_03_Append entity attributes - Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld + 010_01_04_Append entity attributes - Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld *** Keywords *** Append Attributes Without Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} - [Documentation] Check that you can append entity attributes - [Tags] ea-append 5_6_3 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} + [Documentation] Check that you can append entity attributes + [Tags] ea-append 5_6_3 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${entity_expectation_payload} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resource Set To ${entity_expectation_payload} + [Teardown] Delete Entity by Id Returning Response ${entity_id} Append Attributes With Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} - [Documentation] Check that you can append entity attributes - [Tags] ea-append 5_6_3 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} + [Documentation] Check that you can append entity attributes + [Tags] ea-append 5_6_3 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response['status']} # ignore the reason for the not updated attribute as this detail is up to each context broker implementation - Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} root\\['notUpdated'\\]\\[0\\]\\['reason'\\] - - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 8ac8bd78..5a56ed39 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -1,52 +1,48 @@ *** Settings *** -Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -${status_code}= 400 -${invalid_fragment_filename}= invalid-fragment.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld +${status_code}= 400 +${invalid_fragment_filename}= invalid-fragment.jsonld *** Test Cases *** -010_02_01_Append entity attributes if the entity Id is not present - Append Attributes ${EMPTY} -010_02_02_Append entity attributes if the Entity Id is not a valid URI - Append Attributes thisisaninvaliduri +010_02_01_Append entity attributes if the entity Id is not present + Append Attributes ${EMPTY} + +010_02_02_Append entity attributes if the Entity Id is not a valid URI + Append Attributes thisisaninvaliduri + 010_02_03_Append entity attributes with invalid entity fragments - Append entity attributes with invalid entity fragments + Append entity attributes with invalid entity fragments *** Keywords *** Append Attributes - [Arguments] ${entity_invalid_id} - [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body - [Tags] ea-append 5_6_3 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${entity_invalid_id} + [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body + [Tags] ea-append 5_6_3 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id Returning Response ${entity_id} Append entity attributes with invalid entity fragments - [Documentation] Check that you cannot append entity attributes with invalid entity fragments - [Tags] ea-append 5_6_3 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Documentation] Check that you cannot append entity attributes with invalid entity fragments + [Tags] ea-append 5_6_3 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} Check RL Response Status Code Set To ${status_code} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 9bd68f13..3421a072 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -1,23 +1,23 @@ *** Settings *** -Documentation Check that you cannot append entity attributes if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot append entity attributes if the entity id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -*** Test Cases *** +*** Test Cases *** Append entity attributes when the entity id is not known to the system - [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system - [Tags] ea-append 5_6_3 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system + [Tags] ea-append 5_6_3 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index b351933a..9837ae42 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -1,38 +1,38 @@ *** Settings *** -Documentation Check that you can delete an attribute from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Delete Attributes +Documentation Check that you can delete an attribute from an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Delete Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 204 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${attribute_id}= speed - -*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME -013_01_01_delete an attribute with the default instance ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld -013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld -013_01_03_delete all target attribute instances ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 204 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${attribute_id}= speed -*** Keywords *** -Delete Attributes - [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} - [Documentation] Check that you can delete an attribute from an entity - [Tags] ea-delete 5_6_5 +*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME +013_01_01_delete an attribute with the default instance + ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +013_01_02_delete an attribute with the datasetId + urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +013_01_03_delete all target attribute instances + ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file +*** Keywords *** +Delete Attributes + [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} + [Documentation] Check that you can delete an attribute from an entity + [Tags] ea-delete 5_6_5 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index fa408e24..2ef3f055 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -1,36 +1,37 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Delete Attributes +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Delete Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -013_02_01_delete an attribute if the Entity Id is not present ${EMPTY} speed -013_02_02_delete an attribute if the Entity Id is not a valid URI thisIsAnInvalidURI speed -013_02_03_delete an attribute if the Attribute Name is not present ${valid_entity_id} ${EMPTY} +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +013_02_01_delete an attribute if the Entity Id is not present + ${EMPTY} speed -*** Keywords *** -Delete Attributes - [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] ea-delete 5_6_5 +013_02_02_delete an attribute if the Entity Id is not a valid URI + thisIsAnInvalidURI speed - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +013_02_03_delete an attribute if the Attribute Name is not present + ${valid_entity_id} ${EMPTY} +*** Keywords *** +Delete Attributes + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids + [Tags] ea-delete 5_6_5 + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities - ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} \ No newline at end of file + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index a5c0045a..0b6a7b2c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -1,38 +1,39 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Delete Attributes +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Delete Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID -013_03_01_delete an attribute when the Entity Id is not known to the system ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed -013_03_02_delete an attribute when the Entity does not contain the target attribute id ${valid_entity_id} notFound ${EMPTY} -013_03_03_delete an attribute when the Entity does not contain the target attribute with same datasetId ${valid_entity_id} speed urn:ngsi-ld:Property:notFound +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID +013_03_01_delete an attribute when the Entity Id is not known to the system + ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed -*** Keywords *** -Delete Attributes - [Arguments] ${entity_id} ${attribute_id} ${datasetId} - [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids - [Tags] ea-delete 5_6_5 +013_03_02_delete an attribute when the Entity does not contain the target attribute id + ${valid_entity_id} notFound ${EMPTY} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +013_03_03_delete an attribute when the Entity does not contain the target attribute with same datasetId + ${valid_entity_id} speed urn:ngsi-ld:Property:notFound +*** Keywords *** +Delete Attributes + [Arguments] ${entity_id} ${attribute_id} ${datasetId} + [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids + [Tags] ea-delete 5_6_5 + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Entity by Id Returning Response ${entity_id} Setup Initial Entities - ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} - ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${not_found_entity_id} \ No newline at end of file + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} + ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 34be12a3..3c697912 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -1,37 +1,34 @@ *** Settings *** -Documentation Check that you can perform a partial update on an entity attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Update Attributes +Documentation Check that you can perform a partial update on an entity attribute +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Update Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 204 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 204 + +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_01_01_Check that you can partially update an attribute + vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld -*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME -012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld -012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld +012_01_02_Check that you can partially update an attribute by specifying the datasetId + vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld *** Keywords *** Update Attributes - [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} - [Documentation] Check that you can perform a partial update on an entity attribute - [Tags] ea-partial-update 5_6_4 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} + [Documentation] Check that you can perform a partial update on an entity attribute + [Tags] ea-partial-update 5_6_4 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - - ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} - - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + Check Response Status Code ${status_code} ${response['status']} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 5a2e8d9a..9aa45566 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -1,41 +1,48 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Update Attributes +Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Update Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${status_code}= 400 - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -012_02_01_Make a partial attribute update if the Entity Id is not present ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld -012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld -012_02_03_Make a partial attribute update if the Attribute Name is not present ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld -012_02_04_Make a partial attribute update if the Attribute Id is invalid ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld -012_02_05_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -012_02_06_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.json +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${status_code}= 400 -*** Keywords *** -Update Attributes - [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} - [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids - [Tags] ea-partial-update 5_6_4 +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME +012_02_01_Make a partial attribute update if the Entity Id is not present + ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld + +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI + thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld + +012_02_03_Make a partial attribute update if the Attribute Name is not present + ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +012_02_04_Make a partial attribute update if the Attribute Id is invalid + ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld +012_02_05_Make a partial attribute update if the Attribute type does not match + ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld + +012_02_06_Make a partial attribute update if the entity fragment is empty + ${valid_entity_id} speed empty-fragment.json + +*** Keywords *** +Update Attributes + [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} + [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids + [Tags] ea-partial-update 5_6_4 + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities - ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} \ No newline at end of file + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index ccc3f787..dee5e2f4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -1,42 +1,45 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities -Test Template Partial Update Attributes +Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities +Test Template Partial Update Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 404 -${attribute_id}= speed +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 404 +${attribute_id}= speed -*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME -012_03_01_Partial update when the Entity Id is not known to the system ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld -012_03_02_Partial update when no default instance and no datasetId specified ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld -012_03_03_Partial update when no instance with the datasetId specified ${valid_entity_id} vehicle-isparked-fragment.jsonld -012_03_04_Partial update when no instance with the attrId specified ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld +*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME +012_03_01_Partial update when the Entity Id is not known to the system + ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld -*** Keywords *** -Partial Update Attributes - [Arguments] ${entity_id} ${fragment_filename} - [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system - [Tags] ea-partial-update 5_6_4 +012_03_02_Partial update when no default instance and no datasetId specified + ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld + +012_03_03_Partial update when no instance with the datasetId specified + ${valid_entity_id} vehicle-isparked-fragment.jsonld - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +012_03_04_Partial update when no instance with the attrId specified + ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld +*** Keywords *** +Partial Update Attributes + [Arguments] ${entity_id} ${fragment_filename} + [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system + [Tags] ea-partial-update 5_6_4 + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} + [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities - ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} - ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${not_found_entity_id} + ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_entity_id} + ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 6c3023bc..c4a76f10 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -1,37 +1,37 @@ *** Settings *** -Documentation Check that you can update entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Update Attributes +Documentation Check that you can update entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Update Attributes *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld -011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld -011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME +011_01_01_Check that you can update existing attributes with no datasetId + 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld -*** Keywords *** -Update Attributes - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} - [Documentation] Check that you can update entity attributes - [Tags] ea-update 5_6_2 +011_01_02_Check that you can update existing attributes with the datasetId + 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +011_01_03_Check that you can update only some attributes while others failed + 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld +*** Keywords *** +Update Attributes + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} + [Documentation] Check that you can update entity attributes + [Tags] ea-update 5_6_2 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response['status']} Run Keyword If "${expectation_response_filename}"!="${EMPTY}" Check Response Body Content ${expectation_response_filename} ${response['body']} - - ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} + Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index 5a841877..de384137 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -1,49 +1,45 @@ *** Settings *** -Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: *** Test Cases *** -011_02_01_Update an attribute if the Entity Id is not present - Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld -011_02_02_Update an attribute if the Entity Id is not a valid URI - Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld +011_02_01_Update an attribute if the Entity Id is not present + Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + +011_02_02_Update an attribute if the Entity Id is not a valid URI + Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + 011_02_03_Update entity attributes with invalid entity fragments - Update entity attributes with invalid entity fragments vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld + Update entity attributes with invalid entity fragments vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld *** Keywords *** Update Attributes - [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} - [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body - [Tags] ea-update 5_6_2 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} + [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body + [Tags] ea-update 5_6_2 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} + [Teardown] Delete Entity by Id Returning Response ${entity_id} Update entity attributes with invalid entity fragments - [Arguments] ${filename} ${fragment_filename} - [Documentation] Check that you cannot update an attribute if the entity fragment is invalid - [Tags] ea-update 5_6_2 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - + [Arguments] ${filename} ${fragment_filename} + [Documentation] Check that you cannot update an attribute if the entity fragment is invalid + [Tags] ea-update 5_6_2 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} - Check RL Response Status Code Set To 400 - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Status Code Set To 400 + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index a7b8f8c8..8ba03764 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -1,23 +1,23 @@ *** Settings *** -Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld -*** Test Cases *** +*** Test Cases *** Update entity attributes when the entity id is not known to the system - [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system - [Tags] ea-update 5_6_2 - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system + [Tags] ea-update 5_6_2 + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** - [Teardown] Delete Entity by Id Returning Response ${entity_id} \ No newline at end of file + + [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 44068231..587016b0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -1,31 +1,30 @@ *** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Temporal Entity +Documentation Check that you can create a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Create Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity + vehicle-temporal-representation-sample.jsonld application/ld+json -*** Test Cases *** FILENAME CONTENT_TYPE -007_01_01_Create a temporal representation of an entity vehicle-temporal-representation-sample.jsonld application/ld+json -007_01_02_Create a temporal entity with no context vehicle-temporal-representation-without-context-sample.jsonld application/json +007_01_02_Create a temporal entity with no context + vehicle-temporal-representation-without-context-sample.jsonld application/json *** Keywords *** Create Temporal Entity - [Arguments] ${filename} ${content_type} - [Documentation] Check that you can create a temporal representation of an entity - [Tags] te-create 5_6_11 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} - Check Response Status Code 201 ${response['status']} - - ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - ${ignored_attributes}= Create List instanceId @context - Check Created Resource Set To ${created_temporal_entity} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Arguments] ${filename} ${content_type} + [Documentation] Check that you can create a temporal representation of an entity + [Tags] te-create 5_6_11 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + Check Response Status Code 201 ${response['status']} + ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context + Check Created Resource Set To ${created_temporal_entity} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index a0bb98c8..9a70df5b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -1,42 +1,39 @@ *** Settings *** -Documentation Check that you cannot create a temporal entity with an empty/invalid json/id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${status_code}= 400 +${status_code}= 400 *** Test Cases *** 007_02_01_Create a temporal entity with an invalid json - Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld + Create Temporal Entity From File vehicle-temporal-representation-invalid-json-sample.jsonld 007_02_02_Create a temporal entity with an empty json - Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld + Create Temporal Entity From File vehicle-temporal-representation-empty-json-sample.jsonld 007_02_03_Create a temporal entity with missing id - Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld + Create Temporal Entity ${EMPTY} vehicle-temporal-representation-without-id-sample.jsonld 007_02_04_Create a temporal invalid URI - Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld -*** Keywords *** +*** Keywords *** Create Temporal Entity From File - [Arguments] ${filename} - [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id - [Tags] te-create 5_6_11 - - Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${filename} + [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id + [Tags] te-create 5_6_11 + Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To 400 - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} Create Temporal Entity - [Arguments] ${entity_id} ${filename} - [Documentation] Check that you cannot create a temporal entity with an invalid @context - [Tags] te-create 5_6_11 - - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${entity_id} \ No newline at end of file + [Arguments] ${entity_id} ${filename} + [Documentation] Check that you cannot create a temporal entity with an invalid @context + [Tags] te-create 5_6_11 + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index 86be87ab..f8e9fa2d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -1,24 +1,21 @@ *** Settings *** -Documentation Check that you can delete a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** Delete a temporal representation of an entity with simple temporal properties - [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties - [Tags] te-delete 5_6_16 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} - Check Response Status Code 204 ${response['status']} - - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource \ No newline at end of file + [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties + [Tags] te-delete 5_6_16 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Check Response Status Code 204 ${response['status']} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index febcab1b..9268967d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -1,25 +1,26 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Delete Temporal Entity +Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Delete Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** STATUS_CODE ID +009_02_01_Delete a temporal representation of an entity with an empty entity id + 400 ${EMPTY} -*** Test Cases *** STATUS_CODE ID -009_02_01_Delete a temporal representation of an entity with an empty entity id 400 ${EMPTY} -009_02_02 Delete a temporal representation of an entity with an invalid entity id 400 invalidId +009_02_02 Delete a temporal representation of an entity with an invalid entity id + 400 invalidId *** Keywords *** Delete Temporal Entity - [Arguments] ${status_code} ${id} - [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId - [Tags] te-delete 5_6_16 - - ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + [Arguments] ${status_code} ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Tags] te-delete 5_6_16 + ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index ca1ddecc..3d09dad8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -1,21 +1,19 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 -*** Test Cases *** -009_03 Delete a temporal representation of an entity with a unknown entity id - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] te-delete 5_6_16 - - ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - - ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file +*** Test Cases *** +009_03 Delete a temporal representation of an entity with a unknown entity id + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] te-delete 5_6_16 + ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 187b4fdd..0ac689c7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -1,30 +1,26 @@ *** Settings *** -Documentation Check that you can update a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can update a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${update_filename}= vehicle-temporal-representation-update-sample.jsonld -${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld +${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld -*** Test Cases *** -008_01_Update a temporal representation of an entity with simple temporal properties - [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties - [Tags] te-update 5_6_11 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file +*** Test Cases *** +008_01_Update a temporal representation of an entity with simple temporal properties + [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties + [Tags] te-update 5_6_11 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 5ba687cb..ca86bcfa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -1,30 +1,26 @@ *** Settings *** -Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld *** Test Cases *** 014_01_Add an attribute to a temporal entity with simple temporal properties - [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity - [Tags] tea-append 5_6_12 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity + [Tags] tea-append 5_6_12 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 6f74360a..19e0aefa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -1,53 +1,47 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 400 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 400 *** Test Cases *** 014_02_01_Add an attribute to a temporal representation of an entity with invalid content - Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld + Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld 014_02_02_Add an attribute to a temporal representation of an entity with empty content - Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld + Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld 014_02_03_Add an attribute to a temporal representation of an entity with an empty entity id - Fail To Add Attribute To Temporal Entity ${EMPTY} + Fail To Add Attribute To Temporal Entity ${EMPTY} 014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id - Fail To Add Attribute To Temporal Entity thisIsAninvalidId + Fail To Add Attribute To Temporal Entity thisIsAninvalidId *** Keywords *** Add an Attribute To a Temporal Entity - [Arguments] ${update_filename} - [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content - [Tags] tea-append 5_6_12 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response['status']} - + [Arguments] ${update_filename} + [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content + [Tags] tea-append 5_6_12 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Fail To Add Attribute To Temporal Entity - [Arguments] ${id} - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId - [Tags] tea-append 5_6_12 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Arguments] ${id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Tags] tea-append 5_6_12 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index ca6a91d8..8d07f1bc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,26 +1,23 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with not found -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal enitity with not found +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 404 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you delete a temporal enitity with not found - [Tags] tea-append 5_6_12 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + [Documentation] Check that an error is raised if you delete a temporal enitity with not found + [Tags] tea-append 5_6_12 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response['status']} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 3195ddde..6ab2e152 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -1,38 +1,38 @@ *** Settings *** -Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Delete Attribute From A Temporal Entity +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Delete Attribute From A Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 204 -${attribute_id}= fuelLevel - -*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE -015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld -015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld -015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel -*** Keywords *** -Delete Attribute From A Temporal Entity - [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} - [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties - [Tags] tea-delete 5_6_13 +*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE +015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId + false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId + false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld - ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll + true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file +*** Keywords *** +Delete Attribute From A Temporal Entity + [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} + [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + [Tags] tea-delete 5_6_13 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 549b6db5..ab42f3b4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -1,40 +1,40 @@ *** Settings *** -Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Delete attribute from temporal entity with unknow entity/attribute id +Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Delete attribute from temporal entity with unknow entity/attribute id *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-temporal-representation-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id ${EMPTY} speed -015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id invalidId speed -015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id ${valid_temporal_entity_id} invalid(Name +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld -*** Keywords *** -Delete attribute from temporal entity with unknow entity/attribute id - [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id - [Tags] tea-delete 5_6_13 +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id + ${EMPTY} speed - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id + invalidId speed +015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id + ${valid_temporal_entity_id} invalid(Name - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} +*** Keywords *** +Delete attribute from temporal entity with unknow entity/attribute id + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Tags] tea-delete 5_6_13 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id - ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_temporal_entity_id} \ No newline at end of file + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 9cf8171c..f56aea0e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -1,39 +1,38 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Delete Attribute +Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Delete Attribute *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist + ${unknown_temporal_entity_id} fuelLevel -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist ${unknown_temporal_entity_id} fuelLevel -015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute ${valid_temporal_entity_id} notExistingAttribute +015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute + ${valid_temporal_entity_id} notExistingAttribute *** Keywords *** Delete Attribute - [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId - [Tags] tea-delete 5_6_13 - - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${entity_id} ${attribute_id} + [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Tags] tea-delete 5_6_13 + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} Create Id - ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_temporal_entity_id} - Set Suite Variable ${unknown_temporal_entity_id} \ No newline at end of file + ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${valid_temporal_entity_id} + Set Suite Variable ${unknown_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 06362ab8..4206061e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -1,34 +1,29 @@ *** Settings *** -Documentation Check that you can delete an attribute instance in temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an attribute instance in temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${attributeId}= speed -${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed +${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld *** Test Cases *** -017_01_Delete an attribute instance in temporal representation of an entity - [Documentation] Check that you can delete an attribute instance in temporal representation of an entity - [Tags] tea-instance-delete 5_6_15 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} - - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file +017_01_Delete an attribute instance in temporal representation of an entity + [Documentation] Check that you can delete an attribute instance in temporal representation of an entity + [Tags] tea-instance-delete 5_6_15 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code 204 ${response['status']} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 100e5074..52dfc8c9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -1,42 +1,49 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Delete attribute instance +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Delete attribute instance *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} -017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} -017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId -017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} -017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} -017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 -*** Keywords *** -Delete attribute instance - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] tea-instance-delete 5_6_15 +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} + +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} + +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present + ${temporal_entity_representation_id} speed ${EMPTY} +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} + +017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Delete attribute instance + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] tea-instance-delete 5_6_15 + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} \ No newline at end of file + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 978a63ee..e4e72ea9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -1,41 +1,42 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Partially Update Temporal Entity +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Partially Update Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} -017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} -017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} -*** Keywords *** -Partially Update Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] tea-instance-delete 5_6_15 +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] tea-instance-delete 5_6_15 + ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${unknown_temporal_entity_id} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} \ No newline at end of file + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index fdc04f72..f14233c6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -1,46 +1,40 @@ *** Settings *** -Documentation Check that you can partially update an attribute instance of a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can partially update an attribute instance of a temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld -${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld -${attributeId}= speed +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld +${attributeId}= speed *** Test Cases *** 016_01_Partially update an attribute instance of a temporal representation of an entity - [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity - [Tags] tea-partial-update 5_6_14 - - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} - ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} - - ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs - ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} - ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity + [Tags] tea-partial-update 5_6_14 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} + ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code 204 ${response['status']} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs + ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} + ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} Should Be Equal As Strings ${createdAt_before_update} ${modifiedAt_before_update} Should Be Equal As Strings ${createdAt_before_update} ${createdAt_after_update} - ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch - ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch - Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} - - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file + ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch + ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch + Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List instanceId @context + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index 2af24e34..fbae4f06 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -1,43 +1,50 @@ *** Settings *** -Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Partially Update Temporal Entity +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Partially Update Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} -016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} -016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId -016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} -016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} -016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${status_code}= 400 -*** Keywords *** -Partially Update Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right - [Tags] tea-partial-update 5_6_14 +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} + +016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} + +016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present + ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} + +016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Tags] tea-partial-update 5_6_14 + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} \ No newline at end of file + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot index f3de30c0..7e4dc05b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot @@ -1,42 +1,43 @@ *** Settings *** -Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Create Id -Test Template Partially Update Temporal Entity +Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Create Id +Test Template Partially Update Temporal Entity *** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld -${status_code}= 404 +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${status_code}= 404 -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} -016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} -016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} -*** Keywords *** -Partially Update Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found - [Tags] tea-partial-update 5_6_14 +016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} +016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 +*** Keywords *** +Partially Update Temporal Entity + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Tags] tea-partial-update 5_6_14 + ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${unknown_temporal_entity_id} - - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} \ No newline at end of file + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${unknown_temporal_entity_id} + ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot index 8b5a464c..c577c2ac 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot @@ -1,24 +1,20 @@ *** Settings *** -Documentation Check that you can create a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Cases *** -Create Subscription - [Documentation] Check that you can create a subscription - [Tags] sub-create 5_8_1 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - ${created_subscription}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Created Resource Set To ${created_subscription} - - [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file +Create Subscription + [Documentation] Check that you can create a subscription + [Tags] sub-create 5_8_1 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${created_subscription}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Created Resource Set To ${created_subscription} + [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot index 120b7fd2..46624211 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot @@ -1,22 +1,22 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot create a subscription with an invalid request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Create Subscription With Invalid Request -Test Template Create Subscription With Invalid Request +*** Test Cases *** FILENAME +031_02_01_InvalidJson + subscription-invalid-json-sample.jsonld -*** Test Cases *** FILENAME -031_02_01_InvalidJson subscription-invalid-json-sample.jsonld -031_02_02_EmptyJson subscription-empty-sample.jsonld +031_02_02_EmptyJson + subscription-empty-sample.jsonld *** Keywords *** Create Subscription With Invalid Request - [Arguments] ${filename} - [Documentation] Check that you cannot create a subscription with an invalid request - [Tags] sub-create 5_8_1 - - Create Subscription From File ${filename} - + [Arguments] ${filename} + [Documentation] Check that you cannot create a subscription with an invalid request + [Tags] sub-create 5_8_1 + Create Subscription From File ${filename} Check RL Response Status Code Set To Expected Code 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot index 661afb52..cbd11b94 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot @@ -1,28 +1,26 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid/empty id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Subscription With Invalid/Empty Id +Documentation Check that you cannot create a subscription with an invalid/empty id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Create Subscription With Invalid/Empty Id *** Variables *** -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Cases *** ID +031_03_01_InvalidId + invalidId -*** Test Cases *** ID -031_03_01_InvalidId invalidId -031_03_02_EmptyId ${EMPTY} +031_03_02_EmptyId ${EMPTY} *** Keywords *** Create Subscription With Invalid/Empty Id - [Arguments] ${subscription_id} - [Documentation] Check that you cannot create a subscription with an invalid/empty id - [Tags] sub-create 5_8_1 - - ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${subscription_id} + [Documentation] Check that you cannot create a subscription with an invalid/empty id + [Tags] sub-create 5_8_1 + ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Subscription ${subscription_id} \ No newline at end of file + [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot index 76d279d7..d6ab2b2d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot @@ -1,26 +1,21 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a subscription with an existing id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Case *** Create a subscription with an id known to the system - [Documentation] Check that you cannot create a subscription with an existing id - [Tags] sub-create 5_8_1 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + [Documentation] Check that you cannot create a subscription with an existing id + [Tags] sub-create 5_8_1 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Subscription ${subscription_id} - + [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 860cee57..38ac89bb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Delete Subscription With Non present Or Invalid Id -Test Template Delete Subscription With Non present Or Invalid Id +*** Test Cases *** id +NotPresentId ${EMPTY} + [Tags] sub-delete 5_8_5 -*** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-delete 5_8_5 -InvalidId InvalidUri - [Tags] sub-delete 5_8_5 +InvalidId InvalidUri + [Tags] sub-delete 5_8_5 *** Keywords *** Delete Subscription With Non present Or Invalid Id - [Arguments] ${id} - [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - - Delete Subscription ${id} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${id} + [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + Delete Subscription ${id} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index 16f09b54..b46d3c8e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -1,15 +1,13 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Case *** Delete Unknown Subscription - [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised - [Tags] sub-delete 5_8_5 - - Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised + [Tags] sub-delete 5_8_5 + Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 13fadfbf..4b7f1243 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -1,34 +1,29 @@ *** Settings *** -Documentation Check that you can delete a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can delete a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Case *** Delete Subscription - [Documentation] Check that you can delete a subscription - [Tags] sub-delete 5_8_5 - - Delete Subscription ${subscription_id} - Check Response Status Code Set To 204 - + [Documentation] Check that you can delete a subscription + [Tags] sub-delete 5_8_5 + Delete Subscription ${subscription_id} + Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} Check SUT Not Containing Resource *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index 2959d7db..afd183c1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -1,45 +1,40 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can query a list of subscriptions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json *** Test Case *** Query Subscriptions - [Documentation] Check that you can query a list of subscriptions - [Tags] sub-query 5_8_4 - - Query Subscriptions context=${ngsild_test_suite_context} - - @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} ${third_subscription_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + [Documentation] Check that you can query a list of subscriptions + [Tags] sub-query 5_8_4 + Query Subscriptions context=${ngsild_test_suite_context} + @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} ${third_subscription_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} *** Keywords *** Setup Initial Subscriptions - ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} Delete Initial Subscriptions - Delete Subscription ${first_subscription_id} - Delete Subscription ${second_subscription_id} - Delete Subscription ${third_subscription_id} + Delete Subscription ${first_subscription_id} + Delete Subscription ${second_subscription_id} + Delete Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 36015301..21c80a6b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -1,52 +1,52 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Subscriptions With Limit And Page Parameters +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] sub-query 5_8_4 -Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] sub-query 5_8_4 -Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] sub-query 5_8_4 +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] sub-query 5_8_4 -*** Keywords *** -Query Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} - [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place +Query Last Subscription + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] sub-query 5_8_4 - Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} +Query All Subscriptions + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] sub-query 5_8_4 - Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} +*** Keywords *** +Query Subscriptions With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place + Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} Setup Initial Subscriptions - ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} Delete Initial Subscriptions - Delete Subscription ${first_subscription_id} - Delete Subscription ${second_subscription_id} - Delete Subscription ${third_subscription_id} + Delete Subscription ${first_subscription_id} + Delete Subscription ${second_subscription_id} + Delete Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index e26e7665..0a3299b3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Test Template Retrieve Subscription With Non present Or Invalid Id -Test Template Retrieve Subscription With Non present Or Invalid Id +*** Test Cases *** id +NotPresentId ${EMPTY} + [Tags] sub-retrieve 5_8_3 -*** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-retrieve 5_8_3 -InvalidId InvalidUri - [Tags] sub-retrieve 5_8_3 +InvalidId InvalidUri + [Tags] sub-retrieve 5_8_3 *** Keywords *** Retrieve Subscription With Non present Or Invalid Id - [Arguments] ${id} - [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - - Retrieve Subscription ${id} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${id} + [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + Retrieve Subscription ${id} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 3962869f..3eef3269 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -1,15 +1,13 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Case *** Retrieve Unknown Subscription - [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised - [Tags] sub-retrieve 5_8_3 - - Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised + [Tags] sub-retrieve 5_8_3 + Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 9dd2b497..65925913 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -1,34 +1,29 @@ *** Settings *** -Documentation Check that you can retrieve a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can retrieve a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json *** Test Case *** Retrieve Subscription - [Documentation] Check that you can retrieve a subscription - [Tags] sub-retrieve 5_8_3 - - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + [Documentation] Check that you can retrieve a subscription + [Tags] sub-retrieve 5_8_3 + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 9c00bd02..7fa6d396 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -1,27 +1,25 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Update Subscription With Non present Or Invalid Id -Test Template Update Subscription With Non present Or Invalid Id +*** Test Cases *** id +NotPresentId ${EMPTY} + [Tags] sub-update 5_8_2 -*** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-update 5_8_2 -InvalidId InvalidUri - [Tags] sub-update 5_8_2 +InvalidId InvalidUri + [Tags] sub-update 5_8_2 *** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json *** Keywords *** Update Subscription With Non present Or Invalid Id - [Arguments] ${id} - [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised - - Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${id} + [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index d33f7d26..738478a0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -1,19 +1,17 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json *** Test Case *** Update Unknown Subscription - [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised - [Tags] sub-update 5_8_2 - - Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised + [Tags] sub-update 5_8_2 + Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 5e9c90a6..844a3d6b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json *** Test Case *** Update Subscription With Invalid Fragment - [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index 86af83ff..dfcec456 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json *** Test Case *** Update Subscription With Null Mandatory Properties - [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index c4ea7b8b..6d292ebe 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -1,41 +1,34 @@ *** Settings *** -Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json -${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld -${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json +${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld +${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld *** Test Case *** Update Subscription With Term to Uri Expansion - [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 204 - - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Body Containing Subscription element ${expected_subscription_payload_file_path} ${subscription_id} - - Retrieve Subscription ${subscription_id} - Check Response Body Containing Subscription element ${expected_expanded_subscription_payload_file_path} ${subscription_id} + [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Body Containing Subscription element ${expected_subscription_payload_file_path} ${subscription_id} + Retrieve Subscription ${subscription_id} + Check Response Body Containing Subscription element ${expected_expanded_subscription_payload_file_path} ${subscription_id} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 1c57168d..57b56ab2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -1,41 +1,35 @@ *** Settings *** -Documentation Check that you can update a subcription: The implementation shall modify the target Subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subcription: The implementation shall modify the target Subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json *** Test Case *** Update Subscription - [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 204 - + [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Check Response Status Code Set To 204 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Updated Resource Set To ${subscription} ${ignored_attributes} + ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Updated Resource Set To ${subscription} ${ignored_attributes} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} - Set Suite Variable ${subscription_payload} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + Set Suite Variable ${subscription_payload} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index 8d5f5033..0006ebd5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -1,40 +1,36 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Activate Paused Subscription With isActive Member +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions -Test Template Activate Paused Subscription With isActive Member -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH +ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json + [Tags] sub-update 5_8_2 -*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json - [Tags] sub-update 5_8_2 -ActiveNull subscriptions/fragments/subscription-isActive-null-update-sample.json - [Tags] sub-update 5_8_2 +ActiveNull subscriptions/fragments/subscription-isActive-null-update-sample.json + [Tags] sub-update 5_8_2 *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive Member - [Arguments] ${subscription_update_fragment_file_path} - [Documentation] Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + [Arguments] ${subscription_update_fragment_file_path} + [Documentation] Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index ba7fb8e4..0946108b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -1,44 +1,46 @@ *** Settings *** -Documentation Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Activate Paused Subscription With isActive And ExpiresAt Members -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrueExpiresAtNull subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json - [Tags] sub-update 5_8_2 -ActiveTrueExpiresAt subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json - [Tags] sub-update 5_8_2 -ActiveNullExpiresAtNull subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json - [Tags] sub-update 5_8_2 -ActiveNullExpiresAt subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json - [Tags] sub-update 5_8_2 +Documentation Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Activate Paused Subscription With isActive And ExpiresAt Members +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH +ActiveTrueExpiresAtNull + subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json + [Tags] sub-update 5_8_2 + +ActiveTrueExpiresAt + subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json + [Tags] sub-update 5_8_2 + +ActiveNullExpiresAtNull + subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json + [Tags] sub-update 5_8_2 + +ActiveNullExpiresAt + subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json + [Tags] sub-update 5_8_2 *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive And ExpiresAt Members - [Arguments] ${subscription_update_fragment_file_path} - [Documentation] Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + [Arguments] ${subscription_update_fragment_file_path} + [Documentation] Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index c105c651..4b84ef05 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-update-sample.json *** Test Case *** Update Subscription Status To Paused - [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status paused + [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status paused *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 7705fc99..b359b990 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -1,38 +1,32 @@ *** Settings *** -Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json *** Test Case *** Activate Expired Subscription - [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" - [Tags] sub-update 5_8_2 - + [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" + [Tags] sub-update 5_8_2 # Update subscription to expired - Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 204 + Retrieve Subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 6413dac1..40044f5b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json *** Test Case *** Update Subscription With ExpiresAt In The Past - [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised - [Tags] sub-update 5_8_2 - - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised + [Tags] sub-update 5_8_2 + Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} Delete Initial Subscriptions - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index caea99db..d844d583 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -1,28 +1,24 @@ *** Settings *** -Documentation Check that you can create a context source registration with specific ID and expiration date -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that you can create a context source registration with specific ID and expiration date +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld *** Test Case *** Create Context Source Registration With Specific Date Expiration Date - [Documentation] Check that you can create a context source registration with specific ID and expiration date - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that you can create a context source registration with specific ID and expiration date + [Tags] csr-create + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} - - [Teardown] Delete Context Source Registration ${registration_id} + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 8e321c45..f3adc17d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -1,28 +1,24 @@ *** Settings *** -Documentation Check that you can create a context source registration that never expires -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that you can create a context source registration that never expires +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create Context Source Registration That Never Expires - [Documentation] Check that you can create a context source registration that never expires - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that you can create a context source registration that never expires + [Tags] csr-create + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} - - [Teardown] Delete Context Source Registration ${registration_id} + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 31c29796..ae60a499 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -1,26 +1,23 @@ *** Settings *** -Documentation Check that when creating a context source registration without specifying an ID -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that when creating a context source registration without specifying an ID +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld *** Test Case *** Create Context Source Registration Without A Sprecified ID - [Documentation] Check that when creating a context source registration without specifying an ID - [Tags] csr-create - + [Documentation] Check that when creating a context source registration without specifying an ID + [Tags] csr-create ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${request} ${response}= Create Context Source Registration With Return ${payload} - Check Response Status Code 201 ${response['status']} + ${request} ${response}= Create Context Source Registration With Return ${payload} + Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} - - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} - - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 02ca1da0..19e2d2e1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -1,44 +1,42 @@ *** Settings *** -Documentation Check that you cannot create a context source with invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source with invalid content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Cases *** -033_02_01_Create a context source registration with invalid JSON file - Create a context source registration with invalid JSON file -033_02_02_Create a context source registration with a different data structure than CsourRegistration data type - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld -033_02_03_Create a context source registration with a date in the past - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-past-expiration-sample.jsonld +033_02_01_Create a context source registration with invalid JSON file + Create a context source registration with invalid JSON file + +033_02_02_Create a context source registration with a different data structure than CsourRegistration data type + Create Context Source With Invalid Content csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld + +033_02_03_Create a context source registration with a date in the past + Create Context Source With Invalid Content csourceRegistrations/context-source-registration-past-expiration-sample.jsonld *** Keywords *** Create Context Source With Invalid Content - [Arguments] ${filename} - [Documentation] Check that you cannot create a context source with invalid content - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Arguments] ${filename} + [Documentation] Check that you cannot create a context source with invalid content + [Tags] csr-create + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 400 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 400 ${response['status']} + Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + [Teardown] Delete Context Source Registration ${registration_id} Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file - [Tags] csr-create - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Create a context source registration with invalid JSON file + [Tags] csr-create + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Entity by Id Returning Response ${registration_id} \ No newline at end of file + [Teardown] Delete Entity by Id Returning Response ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index ad3fabdc..0508f6a6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -1,26 +1,23 @@ *** Settings *** -Documentation Check that you cannot create a context source registration that already exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that you cannot create a context source registration that already exists +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Cases *** Create a context source registration that already exists - [Documentation] Check that you cannot create a context source registration that already exists - [Tags] csr-create + [Documentation] Check that you cannot create a context source registration that already exists + [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 409 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index f6626258..bc129106 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -1,29 +1,24 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json *** Test Case *** Create one context source registration using a provided Link header with JSON content type - [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code 201 ${response['status']} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - - Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code 201 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index 60108a49..1a73a52a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -1,29 +1,24 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json *** Test Case *** Create one context source registration using the default context with JSON content type - [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} - Check Response Status Code 201 ${response['status']} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building - - Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index 6a8dba17..badb665c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -1,24 +1,21 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration containing a JSON-LD @context with a JSON content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index 7dac576d..c4ce1256 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -1,29 +1,24 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration using a JSON-LD @context obtained from the request payload - [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - - Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building - - [Teardown] Delete Context Source Registration ${registration_id} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + Retrieve Context Source Registration ${registration_id} + Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index 5beb1a4a..6562b0ab 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -1,24 +1,21 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json *** Test Case *** Create one context source registration not containing a JSON-LD @context with a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index 4ff9a5d8..a789f920 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -1,24 +1,21 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Case *** Create one context source registration with a Link header and a JSON-LD content type - [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request - [Tags] csr-create 6_3_5 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request + [Tags] csr-create 6_3_5 + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} ${ngsild_test_suite_context} - - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} ${ngsild_test_suite_context} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 0f07d4d2..59679a2a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -1,27 +1,23 @@ *** Settings *** -Documentation Check that you can delete a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that you can delete a context source registration by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld *** Test Case *** Delete a context source registration by id - [Documentation] Check that you can delete a context source registration by id - [Tags] csr-delete - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Documentation] Check that you can delete a context source registration by id + [Tags] csr-delete + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 204 ${response['status']} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource \ No newline at end of file + Check Response Status Code 204 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 34d7105a..eec164b4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -1,33 +1,32 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Delete Context Source +Documentation Check that you cannot delete a context source registration under some conditions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Delete Context Source *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld + +*** Test Case *** INVALID_REGISTRATION_ID +035_02_01_Delete a Context Source Registration if the Id is not present + ${EMPTY} -*** Test Case *** INVALID_REGISTRATION_ID -035_02_01_Delete a Context Source Registration if the Id is not present ${EMPTY} -035_02_02_Delete a Context Source Registration if the Id is not a valid URI invalidURI +035_02_02_Delete a Context Source Registration if the Id is not a valid URI + invalidURI *** Keywords *** Delete Context Source - [Arguments] ${invalid_registration_id} - [Documentation] Check that you cannot delete a context source registration under some conditions - [Tags] csr-delete - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Arguments] ${invalid_registration_id} + [Documentation] Check that you cannot delete a context source registration under some conditions + [Tags] csr-delete + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index 484a96ee..699983e8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -1,21 +1,18 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - +Documentation Check that you cannot delete a context source registration by id if the id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld *** Test Case *** Delete a context source registration by id - [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system - [Tags] csr-delete - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - + [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system + [Tags] csr-delete + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 11c4692a..e209fd5e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -1,46 +1,44 @@ *** Settings *** -Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of entity types + type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} + [Tags] csr-query 5_10_2 -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of entity types type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 -With list of attribute names attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 +With list of attribute names + attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} - [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present - - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} - - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} Setup Initial Context Source Registrations - ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} Delete Created Context Source Registrations - Delete Context Source Registration ${first_context_source_registration_id} - Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 245aa9eb..c1891a09 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Query Context Source Registrations Without Entity Types and Attribute Names - [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type - [Tags] csr-query 5_10_2 - - Query Context Source Registrations context=${ngsild_test_suite_context} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type + [Tags] csr-query 5_10_2 + Query Context Source Registrations context=${ngsild_test_suite_context} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index babb59c5..477257c2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -1,28 +1,29 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration With Invalid Query Param -Test Template Query Context Source Registration With Invalid Query Param +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE +Invalid URI id invalidUri + [Tags] csr-query 5_10_2 -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE -Invalid URI id invalidUri - [Tags] csr-query 5_10_2 -Invalid Query q invalidQuery - [Tags] csr-query 5_10_2 -Invalid GeoQuery georel within - [Tags] csr-query 5_10_2 -Invalid Temporal Query timerel before - [Tags] csr-query 5_10_2 +Invalid Query q invalidQuery + [Tags] csr-query 5_10_2 -*** Keywords *** -Query Context Source Registration With Invalid Query Param - [Arguments] ${query_param_name} ${query_param_value} - [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid +Invalid GeoQuery georel within + [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} +Invalid Temporal Query + timerel before + [Tags] csr-query 5_10_2 - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Keywords *** +Query Context Source Registration With Invalid Query Param + [Arguments] ${query_param_name} ${query_param_value} + [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index b8bac84b..cb677f78 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -1,36 +1,31 @@ *** Settings *** -Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json *** Test Case *** Query Context Source Registrations Without Context - [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context - [Tags] csr-query 5_10_2 - - Query Context Source Registrations id=${context_source_registration_id} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context + [Tags] csr-query 5_10_2 + Query Context Source Registrations id=${context_source_registration_id} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} *** Keywords *** Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index 79fa92d4..8eb4542a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -1,34 +1,32 @@ *** Settings *** -Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo +Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: + +*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH +Registration With EntityInfo Matching The Query + csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json + [Tags] csr-query 5_10_2 -*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH -Registration With EntityInfo Matching The Query csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json - [Tags] csr-query 5_10_2 -Registration Without EntityInfo csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json - [Tags] csr-query 5_10_2 +Registration Without EntityInfo + csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching EntityInfo of RegistrationInfo - [Arguments] ${registration_file_path} ${expectation_file_path} - [Documentation] Check that you can query context source registrations matching EntityInfo of RegistrationInfo - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${registration_file_path} ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} - - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} - - [Teardown] Delete Context Source Registration ${context_source_registration_id} \ No newline at end of file + [Arguments] ${registration_file_path} ${expectation_file_path} + [Documentation] Check that you can query context source registrations matching EntityInfo of RegistrationInfo + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${registration_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index f5cb05ca..162af3ea 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -1,42 +1,40 @@ *** Settings *** -Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH +Query With Matching Properties And Relationships + name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + [Tags] csr-query 5_10_2 -*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH -Query With Matching Properties And Relationships name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 -Query Without Properties And Relationships ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 +Query Without Properties And Relationships + ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo - [Arguments] ${attrs_value} ${expectation_file_path} - [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo - - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Arguments] ${attrs_value} ${expectation_file_path} + [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} *** Keywords *** Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 4414dfd8..f6114f13 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -1,42 +1,38 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Matching Geoquery -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Matching Geoquery +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH +Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} + [Tags] csr-query 5_10_2 -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} - [Tags] csr-query 5_10_2 -Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} - [Tags] csr-query 5_10_2 +Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} + [Tags] csr-query 5_10_2 *** Keywords *** Query Context Source Registration Matching Geoquery - [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} - [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery - - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} + [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index cbc1fc83..af0bebcb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -1,36 +1,31 @@ *** Settings *** -Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json *** Test Case *** Query Context Source Registration Without Temporal Query - [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered - [Tags] csr-query 5_10_2 - - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered + [Tags] csr-query 5_10_2 + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} *** Keywords *** Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index 1c9948f9..fa24e095 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -1,42 +1,44 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Matching Temporal Query +Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Matching Temporal Query *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld -${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json -${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json - -*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH -Observation Interval With observedAt ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 -Observation Interval Without timeproperty ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 -Mqnagement Interval With createdAt ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 -Mqnagement Interval With modifiedAt ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json +${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json -*** Keywords *** -Query Context Source Registration Matching Temporal Query - [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} - [Documentation] Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval +*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH +Observation Interval With observedAt + ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} + [Tags] csr-query 5_10_2 - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${payload_file_path} ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} +Observation Interval Without timeproperty + ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} + [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building timeproperty=${timeproperty} timerel=before timeAt=2021-08-01T22:00:00Z +Mqnagement Interval With createdAt + ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} + [Tags] csr-query 5_10_2 - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} +Mqnagement Interval With modifiedAt + ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} + [Tags] csr-query 5_10_2 - [Teardown] Delete Context Source Registration ${context_source_registration_id} +*** Keywords *** +Query Context Source Registration Matching Temporal Query + [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} + [Documentation] Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building timeproperty=${timeproperty} timerel=before timeAt=2021-08-01T22:00:00Z + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index 1df91252..746a3596 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -1,54 +1,54 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration With Query Params -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration With Query Params +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of Entity Ids id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 -With NGSI-LD Query q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 -With Context Source Filter csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of Entity Ids + id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 -*** Keywords *** -Query Context Source Registration With Query Params - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} - [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties +With NGSI-LD Query + q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} +With Context Source Filter + csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + [Tags] csr-query 5_10_2 - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} +*** Keywords *** +Query Context Source Registration With Query Params + [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} + [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties + Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} Setup Initial Context Source Registrations - ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} - - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - Create Context Source Registration ${third_context_source_registration_payload} - - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} - Set Suite Variable ${third_context_source_registration_id} + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Create Context Source Registration ${third_context_source_registration_payload} + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + Set Suite Variable ${third_context_source_registration_id} Delete Created Context Source Registrations - Delete Context Source Registration ${first_context_source_registration_id} - Delete Context Source Registration ${second_context_source_registration_id} - Delete Context Source Registration ${third_context_source_registration_id} + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration ${third_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index 10f8e0ec..d4c124e9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -1,55 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration With Limit And Page Parameters +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csr-query 5_10_2 -Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csr-query 5_10_2 -Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csr-query 5_10_2 +*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] csr-query 5_10_2 -*** Keywords *** -Query Context Source Registration With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} - [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. +Query Last Subscription + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} +Query All Subscriptions + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] csr-query 5_10_2 - Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} +*** Keywords *** +Query Context Source Registration With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} + [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. + Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} Setup Initial Context Source Registrations - ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} - - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - Create Context Source Registration ${third_context_source_registration_payload} - - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} - Set Suite Variable ${third_context_source_registration_id} + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Create Context Source Registration ${third_context_source_registration_payload} + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} + Set Suite Variable ${third_context_source_registration_id} Delete Created Context Source Registrations - Delete Context Source Registration ${first_context_source_registration_id} - Delete Context Source Registration ${second_context_source_registration_id} - Delete Context Source Registration ${third_context_source_registration_id} + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration ${third_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index b0f524e4..07350f65 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -1,26 +1,22 @@ *** Settings *** -Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id -Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id +*** Test Cases *** ID +Not Present Id ${EMPTY} + [Tags] csr-retrieve 5_10_1 -*** Test Cases *** ID -Not Present Id ${EMPTY} - [Tags] csr-retrieve 5_10_1 -Invalid Id invalidUri - [Tags] csr-retrieve 5_10_1 +Invalid Id invalidUri + [Tags] csr-retrieve 5_10_1 *** Keywords *** - Retrieve Context Source Registration With A Not Present Or Invalid Id - [Arguments] ${id} - - [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI - - Retrieve Context Source Registration ${id} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${id} + [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI + Retrieve Context Source Registration ${id} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index 10b9e3f5..4122014e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Unknown Context Source Registration - [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent - [Tags] csr-retrieve 5_10_1 - - Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent + [Tags] csr-retrieve 5_10_1 + Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 0b2e26a2..2e950e84 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json *** Test Case *** Retrieve Context Source Registration With Default Core Context - [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. - [Tags] csr-retrieve 5_10_1 - - Retrieve Context Source Registration ${context_source_registration_id} - - Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. + [Tags] csr-retrieve 5_10_1 + Retrieve Context Source Registration ${context_source_registration_id} + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} *** Keywords *** Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index e895d117..54a67562 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Documentation Check that you can retrieve a Context Source Registration +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json *** Test Case *** Retrieve Context Source Registration - [Documentation] Check that you can retrieve a Context Source Registration - [Tags] csr-retrieve 5_10_1 - - Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + [Documentation] Check that you can retrieve a Context Source Registration + [Tags] csr-retrieve 5_10_1 + Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} *** Keywords *** Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 14e668ed..26d24cfc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -1,43 +1,40 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -Test Template Check JSON-LD resolution when retrieving a context source registration +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Check JSON-LD resolution when retrieving a context source registration *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json -${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json +${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext ${EMPTY} ${expectation_file_path_expanded} - [Tags] csr-retrieve 6_3_5 -CreationTimeJsonLdContext ${ngsild_test_suite_context} ${expectation_file_path_compacted} - [Tags] csr-retrieve 6_3_5 +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + ${EMPTY} ${expectation_file_path_expanded} + [Tags] csr-retrieve 6_3_5 + +CreationTimeJsonLdContext + ${ngsild_test_suite_context} ${expectation_file_path_compacted} + [Tags] csr-retrieve 6_3_5 *** Keywords *** Check JSON-LD resolution when retrieving a context source registration - [Arguments] ${context} ${expected_payload} - [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present - - Retrieve Context Source Registration ${context_source_registration_id} context=${context} - - Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expected_payload} ${context_source_registration_id} + [Arguments] ${context} ${expected_payload} + [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + Retrieve Context Source Registration ${context_source_registration_id} context=${context} + Check Response Status Code Set To 200 + Check Response Body Containing Context Source Registration element ${expected_payload} ${context_source_registration_id} Setup Initial Context Source Registration - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registration - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 74130707..03f9b0da 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -1,38 +1,35 @@ *** Settings *** -Documentation Check that you can update a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Update Context Source +Documentation Check that you can update a context source registration by id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Update Context Source *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_id_prefix}= urn:ngsi-ld:Registration: + +*** Test Case *** FILENAME UPDATE_FILENAME +034_01_01_Update a context source registration by id + context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld -*** Test Case *** FILENAME UPDATE_FILENAME -034_01_01_Update a context source registration by id context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld -034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld +034_01_02_Update a context source registration to never expire + context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld *** Keywords *** Update Context Source - [Arguments] ${filename} ${update_filename} - [Documentation] Check that you can update a context source registration by id - [Tags] csr-update - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Arguments] ${filename} ${update_filename} + [Documentation] Check that you can update a context source registration by id + [Tags] csr-update + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - + ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response['status']} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} - ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${registration_payload} ${ignored_attributes} - - - [Teardown] Delete Context Source Registration ${registration_id} + ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response['status']} + Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} @context + Check Updated Resource Set To ${registration_payload} ${ignored_attributes} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index 203241be..d0979d82 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -1,65 +1,61 @@ *** Settings *** -Documentation Check that you cannot update a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Entities +Documentation Check that you cannot update a context source registration under some conditions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Entities *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Case *** -034_02_01_Update a context source registration by id if the Id is not present - Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld -034_02_02_Update a context source registration by id if the Id is not a valid URI - Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld -034_02_03_Update a context source registration if the request body is not of the same data type - Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld -034_02_04_Update a context source registration if you attempt to remove a mandatory property - Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld -034_02_05_Update a context source registration if the request body is invalid - Update a context source registration if the request body is invalid +034_02_01_Update a context source registration by id if the Id is not present + Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld -*** Keywords *** -Update Context Source - [Arguments] ${registration_id} ${fragment_filename} - [Documentation] Check that you cannot update a context source registration under some conditions - [Tags] csr-update +034_02_02_Update a context source registration by id if the Id is not a valid URI + Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} +034_02_03_Update a context source registration if the request body is not of the same data type + Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Context Source Registration ${valid_registration_id} +034_02_04_Update a context source registration if you attempt to remove a mandatory property + Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld -Update a context source registration if the request body is invalid - [Documentation] Check that you cannot update a context source registration if the request body is invalid - [Tags] csr-update +034_02_05_Update a context source registration if the request body is invalid + Update a context source registration if the request body is invalid - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} +*** Keywords *** +Update Context Source + [Arguments] ${registration_id} ${fragment_filename} + [Documentation] Check that you cannot update a context source registration under some conditions + [Tags] csr-update ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Context Source Registration ${valid_registration_id} + +Update a context source registration if the request body is invalid + [Documentation] Check that you cannot update a context source registration if the request body is invalid + [Tags] csr-update + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response['status']} + ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${response} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} - - [Teardown] Delete Context Source Registration ${registration_id} - + [Teardown] Delete Context Source Registration ${registration_id} Setup Initial Entities - ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Suite Variable ${valid_registration_id} \ No newline at end of file + ${valid_registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${valid_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index e1714f64..7226e5bb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -1,23 +1,21 @@ *** Settings *** -Documentation Check that you cannot update a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration by id if the id is not known to the system +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld *** Test Case *** Update a context source registration by id if the id is not known to the system - [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system - [Tags] csr-update - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system + [Tags] csr-update + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - - [Teardown] Delete Context Source Registration ${registration_id} + ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 31cb75e7..d742a5f0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -1,37 +1,32 @@ *** Settings *** -Documentation Check that you can create a minimal context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a minimal context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Create Context Source Registration Subscription - [Documentation] Check that you can create a minimal context source registration subscription - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + [Documentation] Check that you can create a minimal context source registration subscription + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${status_regex_expr} + Check Created Resource Set To ${subscription_payload} ${ignored_attributes} *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions # TODO: Refactor Generate Random Entity Id to Generate Random Test Sample Id - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index d6b0c567..71bf9923 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -1,34 +1,28 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/HttpUtils.resource - -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Create Context Source Registration Subscription Without An Id - [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} - - Create Context Source Registration Subscription ${subscription_payload} - - ${subscription_id}= Fetch Id From Response Location Header - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - - Set Suite Variable ${subscription_id} - - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} - Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} + Create Context Source Registration Subscription ${subscription_payload} + ${subscription_id}= Fetch Id From Response Location Header + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Set Suite Variable ${subscription_id} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} + Check Created Resource Set To ${subscription_payload} ${ignored_attributes} *** Keywords *** Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index 22801be6..0b2665b7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -1,34 +1,30 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Create Context Source Registration Subscription Without isActive Member - [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index 73747b2f..a01812e0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -1,34 +1,30 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld *** Test Case *** Create Inactive Context Source Registration Subscription - [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status paused + [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status paused *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index a41813d2..4285348a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -1,38 +1,34 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld *** Test Case *** Create Context Source Registration Subscription With expiresAt Member - [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired - [Tags] csrsub-create 5_11_2 - - ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} - ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} - ${subscription_payload}= Update Value To Json ${subscription_payload_sample} $..expiresAt ${expiresAt} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Sleep 15s - Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status expired + [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired + [Tags] csrsub-create 5_11_2 + ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} + ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} + ${subscription_payload}= Update Value To Json ${subscription_payload_sample} $..expiresAt ${expiresAt} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Sleep 15s + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status expired *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index 414e0fee..c261b10f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -1,36 +1,32 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Create Context Source Registration Subscription Without expiresAt Member - [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 201 + Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough - Sleep 10s - Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Sleep 10s + Retrieve context source registration subscription ${subscription_id} + Check Response Body Containing an Attribute set to status active *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index f38c99e3..54ee1c56 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -1,38 +1,31 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Create Existing Context Source Registration Subscription - [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists - [Tags] csrsub-create 5_11_2 - - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 409 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists + [Tags] csrsub-create 5_11_2 + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 409 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - *** Keywords *** Setup Initial Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index 6c1cc514..3a02989b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -1,35 +1,36 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Create Invalid Context Source Registration Subscription +Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Create Invalid Context Source Registration Subscription *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= -*** Test Cases *** FILEPATH -WithoutNotification csourceSubscriptions/subscription-without-notification-sample.jsonld - [Tags] csrsub-create 5_11_2 -InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld - [Tags] csrsub-create 5_11_2 -InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld - [Tags] csrsub-create 5_11_2 -EmptyWatchedAttributes csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld - [Tags] csrsub-create 5_11_2 +*** Test Cases *** FILEPATH +WithoutNotification + csourceSubscriptions/subscription-without-notification-sample.jsonld + [Tags] csrsub-create 5_11_2 -*** Keywords *** -Create Invalid Context Source Registration Subscription - [Arguments] ${filepath} - [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met +InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld + [Tags] csrsub-create 5_11_2 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} +InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld + [Tags] csrsub-create 5_11_2 - Create Context Source Registration Subscription ${subscription_payload} +EmptyWatchedAttributes + csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld + [Tags] csrsub-create 5_11_2 - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Keywords *** +Create Invalid Context Source Registration Subscription + [Arguments] ${filepath} + [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 2788ed16..0984a56d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -1,23 +1,20 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld *** Test Case *** Create Expired Context Source Registration Subscription - [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time - [Tags] csrsub-create 5_11_2 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time + [Tags] csrsub-create 5_11_2 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 651d8a29..1530113e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -1,32 +1,26 @@ *** Settings *** -Documentation Check that you can delete a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions +Documentation Check that you can delete a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Delete Context Source Registration Subscription - [Documentation] Check that you can delete a context source registration subscription - [Tags] csrsub-delete 5_11_6 - - Delete Context Source Registration Subscription ${subscription_id} - - Check Response Status Code Set To 204 - - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + [Documentation] Check that you can delete a context source registration subscription + [Tags] csrsub-delete 5_11_6 + Delete Context Source Registration Subscription ${subscription_id} + Check Response Status Code Set To 204 + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource *** Keywords *** Setup Initial Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index 5ff3f69e..be7c7c39 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete a context source registration subscription with an invalid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Delete Context Source Registration Subscription With Invalid Uri - [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI - [Tags] csrsub-delete 5_11_6 - - Delete Context Source Registration Subscription invalidUri - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI + [Tags] csrsub-delete 5_11_6 + Delete Context Source Registration Subscription invalidUri + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index ea4afc67..20f9e3f0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot delete an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an unknown context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Delete Unknown Context Source Registration Subscription With Invalid Uri - [Documentation] Check that you cannot delete an unknown context source registration subscription - [Tags] csrsub-delete 5_11_6 - - Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot delete an unknown context source registration subscription + [Tags] csrsub-delete 5_11_6 + Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index 912b2fbd..a5074ed1 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -1,46 +1,39 @@ *** Settings *** -Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld *** Test Case *** Receive cSourceNotification Periodically And Initially On Subscription - [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached - [Tags] csrsub-notification 5_11_7 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - Set Suite Variable ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - + [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached + [Tags] csrsub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Set Suite Variable ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} Wait for notification # Wait for 15 seconds to check if another notification was sent - Wait for notification timeout=${15} + Wait for notification timeout=${15} *** Keywords *** Setup Initial Context Source Registrations Start Local Server - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index 1470fdbc..8501a50c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -1,52 +1,42 @@ *** Settings *** -Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json *** Test Case *** Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration - [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration - [Tags] csrsub-notification 5_11_7 - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - Set Suite Variable ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching - + [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + [Tags] csrsub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Set Suite Variable ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} - - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated *** Keywords *** Setup Initial Context Source Registrations Start Local Server - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} - - Set Suite Variable ${context_source_registration_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + Set Suite Variable ${context_source_registration_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 8cbebca2..920193e0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -1,48 +1,39 @@ *** Settings *** -Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Receive cSourceNotification With Relevant Information - [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - @{expected_notification_data_entities}= Create List Building - - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + @{expected_notification_data_entities}= Create List Building + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index 2f4bb447..3c2a98e0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Receive cSourceNotification With Compliant Structure - [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index 852dec85..da8d40eb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -1,49 +1,41 @@ *** Settings *** -Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json *** Test Case *** If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated - [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - + [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} Wait for notification - - Retrieve Context Source Registration Subscription ${subscription_id} - @{expected_notification_additional_members}= Create List lastNotification lastSuccess - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + Retrieve Context Source Registration Subscription ${subscription_id} + @{expected_notification_additional_members}= Create List lastNotification lastSuccess + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index 4208e21f..e5b04b3a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -1,48 +1,41 @@ *** Settings *** -Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json *** Test Case *** If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated - [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - + [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} Wait for no notification - Retrieve Context Source Registration Subscription ${subscription_id} - @{expected_notification_additional_members}= Create List lastNotification lastFailure - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + Retrieve Context Source Registration Subscription ${subscription_id} + @{expected_notification_additional_members}= Create List lastNotification lastFailure + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index 11309d9c..84499db9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -1,54 +1,49 @@ *** Settings *** -Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH +PausedSubscription + csourceSubscriptions/fragments/subscription-isActive-update-sample.json + [Tags] csrsub-notification 5_11_7 -*** Test Cases *** FILEPATH -PausedSubscription csourceSubscriptions/fragments/subscription-isActive-update-sample.json - [Tags] csrsub-notification 5_11_7 -ExpiredSubscription csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json - [Tags] csrsub-notification 5_11_7 +ExpiredSubscription + csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json + [Tags] csrsub-notification 5_11_7 *** Keywords *** Do Not Receive cSourceNotification If Subscription Status Is Not Active - [Arguments] ${filepath} - [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired - + [Arguments] ${filepath} + [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} Wait for no notification *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index 957e126e..a895d1e2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -1,48 +1,41 @@ *** Settings *** -Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information - [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information - [Tags] csrsub-notification 5_11_7 - + [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information + [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration ${context_source_registration_payload} - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${context_source_registration_id} - Set Suite Variable ${subscription_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration ${context_source_registration_payload} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${context_source_registration_id} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index 893cada7..c0c2df16 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -1,48 +1,41 @@ *** Settings *** -Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json *** Test Case *** Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information - [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities - [Tags] csrsub-notification 5_11_7 - + [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities + [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} noLongerMatching + Update Context Source Registration ${context_source_registration_id} ${update_fragment} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} noLongerMatching *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration ${context_source_registration_payload} - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${context_source_registration_id} - Set Suite Variable ${subscription_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration ${context_source_registration_payload} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${context_source_registration_id} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 35e64443..02c52d3b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Observation Interval - [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index b77708bd..e529cd25 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -1,49 +1,42 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval -Suite Setup Start Local Server -Suite Teardown Delete Created Context Source Registrations +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval +Suite Setup Start Local Server +Suite Teardown Delete Created Context Source Registrations *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld + +*** Test Cases *** FILEPATH +CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld + [Tags] csrsub-notification 5_11_7 -*** Test Cases *** FILEPATH -CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 -ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 +ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld + [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Matching Context Source Registrations On Management Interval - [Arguments] ${filepath} - [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Set Suite Variable ${subscription_id} - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching - + [Arguments] ${filepath} + [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching # Moved here since each test case creates a subscription - [Teardown] Delete Context Source Registration Subscription ${subscription_id} + [Teardown] Delete Context Source Registration Subscription ${subscription_id} Delete Created Context Source Registrations Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index 271aadf3..c2fded9c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes - [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index 7cc6abe3..e7d7e2a2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute - [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index 6ac56802..7e4aeedf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Location - [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index 850dce58..a25bbe76 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -1,46 +1,38 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld *** Test Case *** Receive cSourceNotification For Matching Context Source Registrations On Location As Default - [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member - [Tags] csrsub-notification 5_11_7 - - ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} - - Create Context Source Registration ${context_source_registration_payload} - - @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + [Tags] csrsub-notification 5_11_7 + ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + Set Suite Variable ${context_source_registration_id} + Create Context Source Registration ${context_source_registration_payload} + @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration ${context_source_registration_id} - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index e725453a..68aec84d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -1,61 +1,58 @@ *** Settings *** -Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Test Template Receive cSourceNotification For Newly Matching Context Source Registrations -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Test Template Receive cSourceNotification For Newly Matching Context Source Registrations +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions *** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld -${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS +MatchFirstContextSourceRegistration + csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 + +MatchSecondContextSourceRegistration + csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 -*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS -MatchFirstContextSourceRegistration csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 -MatchSecondContextSourceRegistration csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 -MatchBothContextSourceRegistrations csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 +MatchBothContextSourceRegistrations + csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} + [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Newly Matching Context Source Registrations - [Arguments] ${filepath} @{notification_csr_ids} - [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations - + [Arguments] ${filepath} @{notification_csr_ids} + [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - - Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching Setup Initial Context Source Registrations And Subscriptions Start Local Server - - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - - Create Context Source Registration Subscription ${subscription_payload} - Create Context Source Registration ${first_context_source_registration_payload} - Create Context Source Registration ${second_context_source_registration_payload} - - Set Suite Variable ${subscription_id} - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + Create Context Source Registration Subscription ${subscription_payload} + Create Context Source Registration ${first_context_source_registration_payload} + Create Context Source Registration ${second_context_source_registration_payload} + Set Suite Variable ${subscription_id} + Set Suite Variable ${first_context_source_registration_id} + Set Suite Variable ${second_context_source_registration_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server - - Delete Context Source Registration Subscription ${subscription_id} - Delete Context Source Registration ${first_context_source_registration_id} - Delete Context Source Registration ${second_context_source_registration_id} + Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration ${first_context_source_registration_id} + Delete Context Source Registration ${second_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 4d3a53ed..714a83e9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -1,42 +1,37 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can query context source registration subscriptions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json *** Test Case *** Query Context Source Registration Subscriptions - [Documentation] Check that you can query context source registration subscriptions - [Tags] csrsub-query 5_11_5 - - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} - - @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} - Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + [Documentation] Check that you can query context source registration subscriptions + [Tags] csrsub-query 5_11_5 + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} + @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} *** Keywords *** Setup Initial Context Source Registration Subscriptions - ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} - - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${first_subscription_id} - Delete Context Source Registration Subscription ${second_subscription_id} + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 078d352c..b4a5dbfb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -1,56 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Subscriptions With Limit Parameter -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Subscriptions With Limit Parameter +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json - -*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER -Query One Subscription ${1} ${1} - [Tags] csrsub-query 5_11_5 -Query Two Subscription ${2} ${2} - [Tags] csrsub-query 5_11_5 -Query All Subscriptions ${15} ${3} - [Tags] csrsub-query 5_11_5 +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json -*** Keywords *** -Query Context Source Registration Subscriptions With Limit Parameter - [Arguments] ${limit} ${expectation_subscription_number} +*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER +Query One Subscription + ${1} ${1} + [Tags] csrsub-query 5_11_5 - [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved +Query Two Subscription + ${2} ${2} + [Tags] csrsub-query 5_11_5 - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} +Query All Subscriptions + ${15} ${3} + [Tags] csrsub-query 5_11_5 - Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} +*** Keywords *** +Query Context Source Registration Subscriptions With Limit Parameter + [Arguments] ${limit} ${expectation_subscription_number} + [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Setup Initial Context Source Registration Subscriptions - ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} - - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} - Create Context Source Registration Subscription ${third_subscription_payload} - - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + Create Context Source Registration Subscription ${third_subscription_payload} + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${first_subscription_id} - Delete Context Source Registration Subscription ${second_subscription_id} - Delete Context Source Registration Subscription ${third_subscription_id} + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} + Delete Context Source Registration Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index 31140a59..e799c423 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -1,55 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csrsub-query 5_11_5 -Query Last Subscription ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csrsub-query 5_11_5 -Query All Subscriptions ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csrsub-query 5_11_5 +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + [Tags] csrsub-query 5_11_5 -*** Keywords *** -Query Context Source Registration Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} - [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination +Query Last Subscription + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + [Tags] csrsub-query 5_11_5 - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} +Query All Subscriptions + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + [Tags] csrsub-query 5_11_5 - Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} +*** Keywords *** +Query Context Source Registration Subscriptions With Limit And Page Parameters + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination + Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + Check Response Status Code Set To 200 + Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} Setup Initial Context Source Registration Subscriptions - ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} - - Create Context Source Registration Subscription ${first_subscription_payload} - Create Context Source Registration Subscription ${second_subscription_payload} - Create Context Source Registration Subscription ${third_subscription_payload} - - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + Create Context Source Registration Subscription ${first_subscription_payload} + Create Context Source Registration Subscription ${second_subscription_payload} + Create Context Source Registration Subscription ${third_subscription_payload} + Set Suite Variable ${first_subscription_id} + Set Suite Variable ${second_subscription_id} + Set Suite Variable ${third_subscription_id} Delete Created Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${first_subscription_id} - Delete Context Source Registration Subscription ${second_subscription_id} - Delete Context Source Registration Subscription ${third_subscription_id} + Delete Context Source Registration Subscription ${first_subscription_id} + Delete Context Source Registration Subscription ${second_subscription_id} + Delete Context Source Registration Subscription ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index 57b439c8..8aaba995 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -1,26 +1,26 @@ *** Settings *** -Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters -Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters +*** Test Cases *** LIMIT PAGE +Invalid Limit ${-5} ${2} + [Tags] csrsub-query 5_11_5 -*** Test Cases *** LIMIT PAGE -Invalid Limit ${-5} ${2} - [Tags] csrsub-query 5_11_5 -Invalid Page ${2} ${-3} - [Tags] csrsub-query 5_11_5 -Invalid Limit And Page ${0} ${0} - [Tags] csrsub-query 5_11_5 +Invalid Page ${2} ${-3} + [Tags] csrsub-query 5_11_5 + +Invalid Limit And Page + ${0} ${0} + [Tags] csrsub-query 5_11_5 *** Keywords *** Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters - [Arguments] ${limit} ${page} - [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters - - Query Context Source Registration Subscriptions limit=${limit} page=${page} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Arguments] ${limit} ${page} + [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters + Query Context Source Registration Subscriptions limit=${limit} page=${page} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 9478f37e..0537a5bb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -1,35 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscription -Suite Teardown Delete Created Context Source Registration Subscription +Documentation Check that you can retrieve a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscription +Suite Teardown Delete Created Context Source Registration Subscription *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json *** Test Case *** Retrieve Context Source Registration Subscription - [Documentation] Check that you can retrieve a context source registration subscription - [Tags] csrsub-retrieve 5_11_4 - - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} - - Check Response Status Code Set To 200 - Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + [Documentation] Check that you can retrieve a context source registration subscription + [Tags] csrsub-retrieve 5_11_4 + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code Set To 200 + Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} *** Keywords *** Setup Initial Context Source Registration Subscription - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Created Context Source Registration Subscription - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index 537342ae..758c6eb5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Context Source Registration Subscription With An Invalid Id - [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised - [Tags] csrsub-retrieve 5_11_4 - - Retrieve Context Source Registration Subscription invalidUri - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised + [Tags] csrsub-retrieve 5_11_4 + Retrieve Context Source Registration Subscription invalidUri + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index 42230d60..d55be566 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -1,16 +1,14 @@ *** Settings *** -Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Case *** Retrieve Unknown Context Source Registration Subscription - [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised - [Tags] csrsub-retrieve 5_11_4 - - Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised + [Tags] csrsub-retrieve 5_11_4 + Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 6dabc291..0af8a549 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -1,40 +1,34 @@ *** Settings *** -Documentation Check that you can update a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Documentation Check that you can update a context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json *** Test Case *** Update Context Source Registration Subscription - [Documentation] Check that you can update a context source registration subscription - [Tags] csrsub-update 5_11_3 - + [Documentation] Check that you can update a context source registration subscription + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - - Check Response Status Code Set To 204 - - ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${subscription} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + Check Response Status Code Set To 204 + ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} + Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resource Set To ${subscription} *** Keywords *** Setup Initial Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} - Set Suite Variable ${subscription_payload} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} + Set Suite Variable ${subscription_payload} Delete Initial Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 004e78c7..2875f366 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -1,20 +1,18 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration subscription with an invalid URI +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json *** Test Case *** Update Context Source Registration Subscription With Invalid Uri - [Documentation] Check that you cannot update a context source registration subscription with an invalid URI - [Tags] csrsub-update 5_11_3 - + [Documentation] Check that you cannot update a context source registration subscription with an invalid URI + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index bd70c92b..f8c67b83 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -1,20 +1,18 @@ *** Settings *** -Documentation Check that you cannot update an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update an unknown context source registration subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json *** Test Case *** Update Unknown Context Source Registration Subscription - [Documentation] Check that you cannot update an unknown context source registration subscription - [Tags] csrsub-update 5_11_3 - + [Documentation] Check that you cannot update an unknown context source registration subscription + [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} - - Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index cbe22fce..25e3cffc 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -1,42 +1,39 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Test Template Update Context Source Registration Subscription With Invalid Fragment -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Test Template Update Context Source Registration Subscription With Invalid Fragment +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH +InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json + [Tags] csrsub-update 5_11_3 -*** Test Cases *** FILEPATH -InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json - [Tags] csrsub-update 5_11_3 -InvalidNotification csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json - [Tags] csrsub-update 5_11_3 +InvalidNotification + csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json + [Tags] csrsub-update 5_11_3 *** Keywords *** Update Context Source Registration Subscription With Invalid Fragment - [Arguments] ${filepath} - [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 - + [Arguments] ${filepath} + [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - - Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index d71bdb16..19696f85 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -1,36 +1,31 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions *** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json *** Test Case *** Update Context Source Registration Subscription With Invalid JSON Fragment - [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) - [Tags] csrsub-update 5_11_3 - - Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} - - Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_INVALID_REQUEST} + [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) + [Tags] csrsub-update 5_11_3 + Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} + Check RL Response Status Code Set To 400 + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_INVALID_REQUEST} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} *** Keywords *** Setup Initial Context Source Registration Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - - Create Context Source Registration Subscription ${subscription_payload} - - Set Suite Variable ${subscription_id} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Context Source Registration Subscription ${subscription_payload} + Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions - Delete Context Source Registration Subscription ${subscription_id} + Delete Context Source Registration Subscription ${subscription_id} -- GitLab From fe53af6e90ba94bb6d288af73b2e9b18663cc8e9 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 10:52:10 +0200 Subject: [PATCH 205/442] Added test case 046_01 --- .../Subscription/Notification/046_01.robot | 34 +++++++++++++++++++ ...subscription-building-entities-active.json | 17 ++++++++++ data/subscriptions/subscription-sample.jsonld | 1 + 3 files changed, 52 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot create mode 100644 data/subscriptions/subscription-building-entities-active.json diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot new file mode 100644 index 00000000..3b6f544e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that a notification is only sent if and only if the status is active +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${active_subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${active_subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Wait for notification timeout=${5} + + + + + diff --git a/data/subscriptions/subscription-building-entities-active.json b/data/subscriptions/subscription-building-entities-active.json new file mode 100644 index 00000000..36259c57 --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active.json @@ -0,0 +1,17 @@ +{ + "type":"Subscription", + "isActive": true, + "expiresAt": null, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index fd713519..21ccd03c 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -1,6 +1,7 @@ { "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", + "timeinterval": 5, "entities":[ { "type":"Building" -- GitLab From fcddb0b2f26d92594b3b13f1eb2722c967402a68 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 10:53:37 +0200 Subject: [PATCH 206/442] added testcase 46_02 --- .../Subscription/Notification/046_01.robot | 1 - .../Subscription/Notification/046_02.robot | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 3b6f544e..cae2ee3c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -10,7 +10,6 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${active_subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot new file mode 100644 index 00000000..b556bc71 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that a notification is only sent if and only if the status is active +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${timeinterval_subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${subscription_id} + Wait for notification timeout=${15} + + + + + -- GitLab From 7a74a471af01776ad19ccd17c64cd41a9cd0f008 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 10:54:13 +0200 Subject: [PATCH 207/442] added timeinterval sample --- .../subscription-timeInterval-sample.jsonld | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 data/subscriptions/subscription-timeInterval-sample.jsonld diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld new file mode 100644 index 00000000..15fffffe --- /dev/null +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "timeInterval": 10, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file -- GitLab From f0eef7b78c0bd7ca8829bed74ee3dd5d49fff05f Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 10:57:40 +0200 Subject: [PATCH 208/442] adapted documentation 046_02 --- .../ContextInformation/Subscription/Notification/046_02.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index b556bc71..48b2f2de 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active +Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -18,7 +18,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} - [Documentation] Check that a notification is only sent if and only if the status is active + [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${timeinterval_subscription_payload_file_path} ${subscription_id} -- GitLab From 75b1ada8ff398118cb52f3fd2ebbd06870eca6b2 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 11:02:35 +0200 Subject: [PATCH 209/442] addepted documentation --- .../Subscription/Notification/046_02.robot | 2 +- .../Subscription/Notification/046_03.robot | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 48b2f2de..b1dca718 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -16,7 +16,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** -Check that a notification is only sent if statis is active +Check that a notification is send on the timeinterval [Arguments] ${fragment_filename} [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot new file mode 100644 index 00000000..7388b82c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation A notification with all all subscribed Entities will be included if query or geoquery are not defined. +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is send with all entities + [Arguments] ${fragment_filename} + [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${timeinterval_subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${subscription_id} + Wait for notification timeout=${15} + + + + + -- GitLab From 510b5be3a0143b4255133031a5898b33ee3eb6c4 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 16:19:51 +0200 Subject: [PATCH 210/442] added 46_05 --- .../Subscription/Notification/046_01.robot | 10 +++-- .../Subscription/Notification/046_03.robot | 6 +-- .../Subscription/Notification/046_04.robot | 37 +++++++++++++++++++ ...iption-building-entities-active-query.json | 18 +++++++++ resources/NotificationUtils.resource | 29 +++++++++++++++ 5 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot create mode 100644 data/subscriptions/subscription-building-entities-active-query.json diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index cae2ee3c..1765d80e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${active_subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: @@ -21,11 +21,15 @@ Check that a notification is only sent if statis is active [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${active_subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + Set Suite Variable ${subscription_id} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for notification timeout=${5} + Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 7388b82c..1f60365a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: @@ -21,10 +21,10 @@ Check that a notification is send with all entities [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${timeinterval_subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${subscription_id} - Wait for notification timeout=${15} + Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot new file mode 100644 index 00000000..0678a625 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -0,0 +1,37 @@ +*** Settings *** +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-location-attribute.jsonld + + + + + +*** Test Case *** +Check that a notification is send with all entities + [Arguments] ${fragment_filename} + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + + + + + diff --git a/data/subscriptions/subscription-building-entities-active-query.json b/data/subscriptions/subscription-building-entities-active-query.json new file mode 100644 index 00000000..88bcf6af --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-query.json @@ -0,0 +1,18 @@ +{ + "type":"Subscription", + "isActive": true, + "expiresAt": null, + "entities":[ + { + "type":"Building" + } + ], + "q":"name=\"Eifel Tower\"", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + } +} \ No newline at end of file diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index fffcde35..b99731e3 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -55,6 +55,35 @@ Wait for notification and validate it # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} +Wait for subscription notification and validate it + [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + + ${notification_payload}= Get Request Body + ${notification} Evaluate json.loads('''${notification_payload}''') json + ${notification_data_length}= Get length ${notification}[data] + ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} + + + log ${notification} + Should Be Equal ${notification}[type] ${notification_type} + Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + Should Be True ${is_date} + ${index}= Set Variable 0 + + Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' + + # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all + Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + + + Wait for no notification [Arguments] ${timeout}=${5} #HTTP server receives it and checks incoming request for correctness -- GitLab From 2ec1e1f52e22049b74f5af08f13c1243d75f8a68 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Thu, 27 May 2021 16:20:18 +0200 Subject: [PATCH 211/442] fixed 046_02 --- .../ContextInformation/Subscription/Notification/046_02.robot | 4 ++-- data/entities/building-simple-attributes-sample.jsonld | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index b1dca718..b36c553f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${timeinterval_subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: @@ -21,7 +21,7 @@ Check that a notification is send on the timeinterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${timeinterval_subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${subscription_id} Wait for notification timeout=${15} diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 821498e6..ac34ee7a 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "Eiffel Tower" + "value": "C" }, "subCategory": { "type": "Property", -- GitLab From f6e07258d592a5bf7864b12537a7325884092658 Mon Sep 17 00:00:00 2001 From: "Gert De Tant @ Sirus" Date: Fri, 28 May 2021 14:15:53 +0200 Subject: [PATCH 212/442] all tests --- .../Subscription/Notification/046_01.robot | 1 - .../Subscription/Notification/046_04.robot | 2 +- .../Subscription/Notification/046_05.robot | 37 +++++++++++++ .../Subscription/Notification/046_06.robot | 37 +++++++++++++ .../Subscription/Notification/046_07.robot | 41 ++++++++++++++ .../Subscription/Notification/046_08.robot | 37 +++++++++++++ .../Subscription/Notification/046_09.robot | 50 +++++++++++++++++ .../Subscription/Notification/046_10.robot | 51 ++++++++++++++++++ .../Subscription/Notification/046_11.robot | 53 ++++++++++++++++++ .../Subscription/Notification/046_12.robot | 52 ++++++++++++++++++ .../Subscription/Notification/046_13.robot | 53 ++++++++++++++++++ .../Subscription/Notification/046_14.robot | 54 +++++++++++++++++++ resources/AssertionUtils.resource | 8 +++ resources/MockServerUtils.resource | 11 +++- resources/MockSubscriberServer.resource | 30 +++++++++++ resources/NotificationUtils.resource | 22 ++++++++ 16 files changed, 536 insertions(+), 3 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot create mode 100644 resources/MockSubscriberServer.resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 1765d80e..5b0fc90e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -25,7 +25,6 @@ Check that a notification is only sent if statis is active ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} Set Suite Variable ${subscription_id} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index 0678a625..96b4fa4f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -10,7 +10,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-location-attribute.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot new file mode 100644 index 00000000..0678a625 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -0,0 +1,37 @@ +*** Settings *** +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-location-attribute.jsonld + + + + + +*** Test Case *** +Check that a notification is send with all entities + [Arguments] ${fragment_filename} + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + + + + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot new file mode 100644 index 00000000..0678a625 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -0,0 +1,37 @@ +*** Settings *** +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-location-attribute.jsonld + + + + + +*** Test Case *** +Check that a notification is send with all entities + [Arguments] ${fragment_filename} + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + + + + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot new file mode 100644 index 00000000..b36d707c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that a notification is only sent if and only if the status is active + + + + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + + Set Suite Variable ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} + + + + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot new file mode 100644 index 00000000..1765d80e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -0,0 +1,37 @@ +*** Settings *** +Documentation Check that a notification is only sent if and only if the status is active +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + + Set Suite Variable ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} + + + + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot new file mode 100644 index 00000000..3e1f0d5e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected request + + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot new file mode 100644 index 00000000..961254f4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -0,0 +1,51 @@ +*** Settings *** +Documentation The Notification content shall be JSON by default. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] The Notification content shall be JSON by default. + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected request + + Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot new file mode 100644 index 00000000..883e55ed --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation The Notification content shall be JSON by default + + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] The Notification content shall be JSON by default + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected request + + @{expected_notification_additional_members}= Create List lastNotification lastSuccess + Check JSON Value In Response Body json_path_expr value_to_check ${notification_expectation_file_path} ${expected_notification_additional_members} + + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot new file mode 100644 index 00000000..762f3451 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected request + + + + Check Notification Date ${subscription_id} + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot new file mode 100644 index 00000000..d66c1948 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected request + + @{expected_notification_additional_members}= Create List lastNotification lastSuccess + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot new file mode 100644 index 00000000..11f686eb --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed + + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: + + + + +*** Test Case *** +Check that a notification is only sent if statis is active + [Arguments] ${fragment_filename} + [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed + [Tags] sub-notification 5_11_7 + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + + @{expected_notification_data_entities}= Create List Building + Set Suite Variable ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for redirected failed request + + @{expected_notification_additional_members}= Create List lastNotification lastFailure + Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + + +*** Keywords *** +Setup Initial Subscription + Start Local Server + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + Create Subscription ${subscription_id} ${subscription_payload} + Set Suite Variable ${subscription_id} + +Delete Subscription + Stop Local Server + Delete Subscription ${subscription_id} + + diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5600908c..1a8e33f1 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -315,6 +315,13 @@ Check Created Resource Set To Check Resource Set To ${created_resource} ${ignored_keys} +Check Subscription Failed + [Arguments] ${subscription} + + Should Be True ${sub} + + Check Resource Set To ${created_resource} ${ignored_keys} + Check Created Resources Set To [Arguments] ${expected_resources} ${ignored_keys}=${None} @@ -336,3 +343,4 @@ Check SUT Not Containing Resource Check SUT Not Containing Resources Should Be Empty ${response['body']} + diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 9aa766e2..e0d162f9 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -1,5 +1,5 @@ *** Settings *** -Documentation Mock http server for context sources +Documentation Mock http server for subscriber Library HttpCtrl.Server *** Keywords *** @@ -16,6 +16,15 @@ Wait for redirected request Wait For Request ${timeout} Reply By 200 +Wait for redirected failed request + [Arguments] ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 400 + Stop Context Source Mock Server #Terminate HTTP Server Stop Server diff --git a/resources/MockSubscriberServer.resource b/resources/MockSubscriberServer.resource new file mode 100644 index 00000000..e4e3b856 --- /dev/null +++ b/resources/MockSubscriberServer.resource @@ -0,0 +1,30 @@ +*** Settings *** +Documentation Check Notification Behaviour +Library BuiltIn +Library Collections +Library HttpCtrl.Server +Library ${EXECDIR}/libraries/assertionUtils.py +Library ${EXECDIR}/libraries/dateTimeUtils.py + +*** Variable *** +${notification_type}= subscriber Notfication +${date_format}= %Y-%m-%dT%H:%M:%SZ + + +*** Keywords *** +Start Local Server + #Initialize HTTP Client And Server + Start Server 0.0.0.0 8085 + +Wait for redirected request + [Arguments] ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + +Stop Local Server + #Terminate HTTP Server + Stop Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index b99731e3..b7ebec58 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -103,6 +103,28 @@ Check Notification Data Entities Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True + +Check Notification Date + [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} + #HTTP server receives it and checks incoming request for correctness + #.. "Wait For Request" + #.... This call is blocked until HTTP request arrives or timeout. + #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + Wait For Request ${timeout} + Reply By 200 + + ${notification_payload}= Get Request Body + ${notification} Evaluate json.loads('''${notification_payload}''') json + ${notification_data_length}= Get length ${notification}[data] + ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} + + + log ${notification} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + Should Be True ${is_date} + + + Stop Local Server #Terminate HTTP Server Stop Server -- GitLab From 429f5eec08b88d2c9f1901ab8e01ad30628db7c4 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 11 Jun 2021 11:24:53 +0200 Subject: [PATCH 213/442] added .vscode/ to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 438bfca9..5393a5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ resources/__pycache__ results *.pyc -*.http \ No newline at end of file +*.http +.vscode/ \ No newline at end of file -- GitLab From 7a7da6492461d0a22b3d33317c1b1249b07290c9 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 11 Jun 2021 11:25:43 +0200 Subject: [PATCH 214/442] fixed some syntax errors in tests --- .../Subscription/Notification/046_01.robot | 11 ++++++++--- .../Subscription/Notification/046_02.robot | 11 ++++++++--- .../Subscription/Notification/046_03.robot | 17 +++++++++++------ .../Subscription/Notification/046_04.robot | 16 ++++++++++------ .../Subscription/Notification/046_05.robot | 15 ++++++++++----- .../Subscription/Notification/046_06.robot | 16 ++++++++++------ .../Subscription/Notification/046_07.robot | 2 +- .../Subscription/Notification/046_08.robot | 2 +- .../Subscription/Notification/046_09.robot | 2 +- .../Subscription/Notification/046_10.robot | 2 +- .../Subscription/Notification/046_11.robot | 2 +- .../Subscription/Notification/046_12.robot | 2 +- .../Subscription/Notification/046_13.robot | 2 +- .../Subscription/Notification/046_14.robot | 6 +----- 14 files changed, 65 insertions(+), 41 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 5b0fc90e..7e6f3034 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -12,11 +12,16 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} - -*** Test Case *** -Check that a notification is only sent if statis is active +Check that a notification is only sent if status is active [Arguments] ${fragment_filename} [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_11_7 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index b36c553f..177740d4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -9,15 +9,20 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} - +Delete Initial Subscriptions + Delete Subscription ${subscription_id} *** Test Case *** Check that a notification is send on the timeinterval - [Arguments] ${fragment_filename} [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 1f60365a..840f06d6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -9,15 +9,12 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeinterval-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: - - - +${expected_notification_data_entities}= TODO *** Test Case *** -Check that a notification is send with all entities - [Arguments] ${fragment_filename} +Check that a notification is sent with all entities [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -26,6 +23,14 @@ Check that a notification is send with all entities Set Suite Variable ${subscription_id} Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index 96b4fa4f..799d9c81 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -10,26 +10,30 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.json ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-location-attribute.jsonld +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} - - +Delete Initial Subscriptions + Delete Subscription ${subscription_id} *** Test Case *** Check that a notification is send with all entities - [Arguments] ${fragment_filename} [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 0678a625..767beeb8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -10,26 +10,31 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.json ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-location-attribute.jsonld +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} - +Delete Initial Subscriptions + Delete Subscription ${subscription_id} *** Test Case *** Check that a notification is send with all entities - [Arguments] ${fragment_filename} [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 0678a625..2a62b01d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -10,26 +10,30 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.json ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-location-attribute.jsonld +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} - - +Delete Initial Subscriptions + Delete Subscription ${subscription_id} *** Test Case *** Check that a notification is send with all entities - [Arguments] ${fragment_filename} [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity_building} Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${entity} timeout=${5} + Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index b36d707c..733f2ef1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -19,7 +19,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] Check that a notification is only sent if and only if the status is active diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 1765d80e..6d386ba9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -15,7 +15,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] Check that a notification is only sent if and only if the status is active diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 3e1f0d5e..58e88a85 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -18,7 +18,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 961254f4..fa8eaa65 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -17,7 +17,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] The Notification content shall be JSON by default. diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 883e55ed..0f178480 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -18,7 +18,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] The Notification content shall be JSON by default diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 762f3451..1f383c40 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -17,7 +17,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index d66c1948..fec85f5c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -18,7 +18,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 11f686eb..44e3ff20 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -1,13 +1,9 @@ *** Settings *** Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed - - Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource - - Suite Setup Setup Initial Subscriptions Suite Teardown Delete Initial Subscriptions @@ -19,7 +15,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: -*** Test Case *** +*** Keywords *** Check that a notification is only sent if statis is active [Arguments] ${fragment_filename} [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed -- GitLab From 94612f5e9cef5cfe9c3870a841c84d9c5f3c219f Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Wed, 30 Jun 2021 17:43:35 +0200 Subject: [PATCH 215/442] fix 046_01 --- .../Subscription/Notification/046_01.robot | 43 ++++++++++++------- .../airQualityLevel-fragment.jsonld | 11 +++++ ...bscription-building-entities-active.jsonld | 20 +++++++++ resources/ApiUtils.resource | 10 +++++ resources/NotificationUtils.resource | 18 ++++---- resources/variables.py | 4 +- 6 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 data/entities/fragmentEntities/airQualityLevel-fragment.jsonld create mode 100644 data/subscriptions/subscription-building-entities-active.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 7e6f3034..f15dce65 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -4,38 +4,51 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +# Suite Setup Setup Initial Subscriptions +# Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +#subscriptions/testsubscription.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +#testentity.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +#testfragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + # http://ptsv2.com/t/9jkg1-1625063286/post + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscriptions Delete Subscription ${subscription_id} +Before Test + Setup Initial Subscriptions + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Stop Local Server + + +*** Test Cases *** Check that a notification is only sent if status is active - [Arguments] ${fragment_filename} [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + @{expected_notification_data_entities}= Create List Building - - Set Suite Variable ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} - - - - + Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${10} expected_notification_type=Notification \ No newline at end of file diff --git a/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld new file mode 100644 index 00000000..8a02a41b --- /dev/null +++ b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld @@ -0,0 +1,11 @@ +{ + "airQualityLevel": { + "type": "Property", + "value": 5, + "unitCode": "C62", + "observedAt": "2020-10-10T16:40:00.000Z" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld new file mode 100644 index 00000000..922d2920 --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "expiresAt": null, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"*/*" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 78163f0b..8b417f57 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -691,6 +691,16 @@ Create Subscription Output response [return] ${response} +Create Subscription From Subscription Payload + [Arguments] ${subscription_payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${accept}=${EMPTY} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + Output request + Output response + + Create Subscription From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index b7ebec58..80b395d8 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -9,11 +9,14 @@ Library ${EXECDIR}/libraries/dateTimeUtils.py *** Variable *** ${notification_type}= ContextSource Notfication ${date_format}= %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ + *** Keywords *** -Start Local Server +Start Local Server + [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} #Initialize HTTP Client And Server - Start Server 0.0.0.0 8085 + Start Server ${host} ${port} Wait for notification [Arguments] ${timeout}=${5} @@ -56,7 +59,7 @@ Wait for notification and validate it Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} Wait for subscription notification and validate it - [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} + [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} ${expected_notification_type}=${notification_type} #HTTP server receives it and checks incoming request for correctness #.. "Wait For Request" #.... This call is blocked until HTTP request arrives or timeout. @@ -71,16 +74,15 @@ Wait for subscription notification and validate it log ${notification} - Should Be Equal ${notification}[type] ${notification_type} + Should Be Equal ${notification}[type] ${expected_notification_type} Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - Should Be True ${is_date} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} ${index}= Set Variable 0 - Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' - # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all - Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + # Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} diff --git a/resources/variables.py b/resources/variables.py index 4890d76b..f6324fa6 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,9 +1,11 @@ def get_variables(arg=None): variables = { - 'url': 'https://broker-ngsi-ld.demeter.ubiwhere.com/ngsi-ld/v1', + 'url': 'localhost:9090/ngsi-ld/v1', 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', 'notification_server_host': '0.0.0.0', 'notification_server_port': 8085, + 'send_notification_server_host': 'host.docker.internal', + 'send_notification_server_port': 8085, 'context_source_host': '0.0.0.0', 'context_source_port': 8086 } -- GitLab From f857d1f52bd817147a6aef28eecfd8e8824742cc Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Thu, 1 Jul 2021 12:34:54 +0200 Subject: [PATCH 216/442] test 046_01 --- .../Subscription/Notification/046_01.robot | 15 +++++++++++---- .../building-simple-attributes-sample.jsonld | 2 +- resources/NotificationUtils.resource | 9 +++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index f15dce65..8450b9db 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -46,9 +46,16 @@ Check that a notification is only sent if status is active [Tags] sub-notification 5_11_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} - - @{expected_notification_data_entities}= Create List Building - + Output Before: + Query Entity ${entity_id} + Sleep 5 Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Output After: + Query Entity ${entity_id} + ${notification}= Wait for notification timeout=${5} + Output Notification: + Output ${notification} - Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${10} expected_notification_type=Notification \ No newline at end of file + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal 5 ${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value] diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index ac34ee7a..821498e6 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "C" + "value": "Eiffel Tower" }, "subCategory": { "type": "Property", diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 80b395d8..20146267 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -27,6 +27,10 @@ Wait for notification Wait For Request ${timeout} Reply By 200 + ${notification_payload}= Get Request Body + ${notification} Evaluate json.loads('''${notification_payload}''') json + [Return] ${notification} + Wait for notification and validate it [Arguments] ${expected_subscription_id} ${expected_context_source_registration_ids} ${expected_trigger_reason} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} #HTTP server receives it and checks incoming request for correctness @@ -60,6 +64,7 @@ Wait for notification and validate it Wait for subscription notification and validate it [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} ${expected_notification_type}=${notification_type} + Wait for subscription notification ${expected_subscription_id} ${expected_notification_data_entities} ${timeout} ${expected_notification_type} #HTTP server receives it and checks incoming request for correctness #.. "Wait For Request" #.... This call is blocked until HTTP request arrives or timeout. @@ -71,7 +76,6 @@ Wait for subscription notification and validate it ${notification} Evaluate json.loads('''${notification_payload}''') json ${notification_data_length}= Get length ${notification}[data] ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} - log ${notification} Should Be Equal ${notification}[type] ${expected_notification_type} @@ -82,7 +86,8 @@ Wait for subscription notification and validate it ${index}= Set Variable 0 # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all - # Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + [return] ${notification} -- GitLab From 307d734e4bf870aef131536bc8cf91c7c7be984a Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Thu, 1 Jul 2021 15:02:36 +0200 Subject: [PATCH 217/442] fix 046_02 --- .../Subscription/Notification/046_01.robot | 22 +++++---- .../Subscription/Notification/046_02.robot | 46 +++++++++++++++---- .../building-simple-attributes-sample.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 1 - 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 8450b9db..221e47c7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -24,7 +24,6 @@ ${notification_server_send_url}= http://${send_notification_server_host}:${s Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - # http://ptsv2.com/t/9jkg1-1625063286/post Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -33,28 +32,31 @@ Delete Initial Subscriptions Before Test Setup Initial Subscriptions + Add Initial Entity NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions + Delete Initial Entity Stop Local Server +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + *** Test Cases *** Check that a notification is only sent if status is active [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_11_7 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Output Before: - Query Entity ${entity_id} - Sleep 5 + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Output After: - Query Entity ${entity_id} + ${notification}= Wait for notification timeout=${5} - Output Notification: - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 177740d4..b5771949 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -4,32 +4,62 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscriptions Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + + *** Test Case *** Check that a notification is send on the timeinterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${subscription_id} - Wait for notification timeout=${15} + + Setup Initial Subscriptions + Add Initial Entity + + Sleep 11 + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be Equal Eifel Tower ${notification}[data][0][name][value] diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 821498e6..4cebd839 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "Eiffel Tower" + "value": "Eifel Tower" }, "subCategory": { "type": "Property", diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index 15fffffe..c6e15605 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -8,7 +8,6 @@ } ], "notification":{ - "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", "accept":"application/json" -- GitLab From 1358dcc8ca80112c8a35a77185630919ee8f5f1e Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 2 Jul 2021 09:18:16 +0200 Subject: [PATCH 218/442] 046_02 WIP --- .../Subscription/Notification/046_02.robot | 10 ++++++---- .../building-simple-attributes-sample.jsonld | 2 +- ...scription-timeInterval-sample-query.jsonld | 20 +++++++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 data/subscriptions/subscription-timeInterval-sample-query.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index b5771949..ccb8ffc9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -9,7 +9,7 @@ Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample-query.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify ${entity_building_filepath}= building-simple-attributes-sample.jsonld @@ -46,10 +46,10 @@ Check that a notification is send on the timeinterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 - Setup Initial Subscriptions Add Initial Entity + Sleep 2 + Setup Initial Subscriptions - Sleep 11 ${notification}= Wait for notification timeout=${15} Output ${notification} @@ -57,9 +57,11 @@ Check that a notification is send on the timeinterval Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Eifel Tower ${notification}[data][0][name][value] + Should be Equal Building1 ${notification}[data][0][name][value] diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 4cebd839..98f23d0d 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "Eifel Tower" + "value": "Building1" }, "subCategory": { "type": "Property", diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld new file mode 100644 index 00000000..13e9346a --- /dev/null +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "timeInterval": 10, + "entities":[ + { + "type":"Building" + } + ], + "q": "name='Building1'", + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file -- GitLab From 70e9de462f4c8f6086abd2bc6d3b5c5a79c407c1 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 2 Jul 2021 09:27:16 +0200 Subject: [PATCH 219/442] 046_03 --- .../Subscription/Notification/046_02.robot | 1 - .../Subscription/Notification/046_03.robot | 51 ++++++++++++++----- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index ccb8ffc9..2fe0efb7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -47,7 +47,6 @@ Check that a notification is send on the timeinterval [Tags] sub-notification 5_11_7 Add Initial Entity - Sleep 2 Setup Initial Subscriptions ${notification}= Wait for notification timeout=${15} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 840f06d6..ec4dbff2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -4,34 +4,57 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${expected_notification_data_entities}= TODO - -*** Test Case *** -Check that a notification is sent with all entities - [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscriptions Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + +*** Test Case *** +Check that a notification is sent with all entities + [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. + [Tags] sub-notification 5_11_7 + + Add Initial Entity + Setup Initial Subscriptions + + ${notification}= Wait for notification ${5} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be Equal Building1 ${notification}[data][0][name][value] -- GitLab From 91bfe8f18df94dd11f5472520f4f335fbb1b105c Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 2 Jul 2021 10:09:37 +0200 Subject: [PATCH 220/442] 046_04 and 046_05 --- .../Subscription/Notification/046_04.robot | 50 ++++++++++++----- .../Subscription/Notification/046_05.robot | 53 +++++++++++++------ ...ties-active-watchedAttributes-query.jsonld | 22 ++++++++ ...g-entities-active-watchedAttributes.jsonld | 22 ++++++++ ...scription-timeInterval-sample-query.jsonld | 2 +- 5 files changed, 118 insertions(+), 31 deletions(-) create mode 100644 data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld create mode 100644 data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index 799d9c81..bbed087c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -5,36 +5,60 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.json +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-location-attribute.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscriptions Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + *** Test Case *** -Check that a notification is send with all entities +Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} + Setup Initial Subscriptions + Add Initial Entity + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be Equal Building1 ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 767beeb8..74093d04 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -5,38 +5,57 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.json +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-location-attribute.jsonld - +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscriptions Delete Subscription ${subscription_id} -*** Test Case *** -Check that a notification is send with all entities - [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - Set Suite Variable ${subscription_id} - Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server +*** Test Case *** +Check that a notification is sent with all entities + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 + Setup Initial Subscriptions + Add Initial Entity + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be Equal Building1 ${notification}[data][0][name][value] diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld new file mode 100644 index 00000000..193d2d2e --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "expiresAt": null, + "watchedAttributes": ["name", "airQualityObserved"], + "q": "name=\"Building1\"", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"*/*" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld new file mode 100644 index 00000000..c5707f2e --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "expiresAt": null, + "watchedAttributes": ["name", "airQualityObserved"], + + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"*/*" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index 13e9346a..cce6479d 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -7,7 +7,7 @@ "type":"Building" } ], - "q": "name='Building1'", + "q": "1=1; DROP TABLE entity --", "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", -- GitLab From 3744a62a49a5d69e2dd4e483068564a8e9b97fed Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Fri, 2 Jul 2021 10:59:12 +0200 Subject: [PATCH 221/442] 046_07 WIP --- .../Subscription/Notification/046_02.robot | 2 +- .../Subscription/Notification/046_06.robot | 4 +- .../Subscription/Notification/046_07.robot | 95 ++++++++++++++++--- ...ties-active-watchedAttributes-query.jsonld | 4 +- ...g-entities-active-watchedAttributes.jsonld | 3 +- ...scription-timeInterval-sample-query.jsonld | 2 +- 6 files changed, 88 insertions(+), 22 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 2fe0efb7..906ea250 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -42,7 +42,7 @@ After Test *** Test Case *** -Check that a notification is send on the timeinterval +Check that a notification is sent on the timeinterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 2a62b01d..35ffaaa8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -24,8 +24,8 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} *** Test Case *** -Check that a notification is send with all entities - [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions +Check that a notification is sent with all entities with matching context source + [Documentation] only the subscribed Entities whose origin Context Source matches the referred filter shall be included. [Tags] sub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 733f2ef1..937b59c0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -8,32 +8,99 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${date_format}= %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} -*** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +Delete Initial Entity + Delete Entity by Id ${entity_id} - @{expected_notification_data_entities}= Create List Building - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} +Before Test + Output Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} - Set Suite Variable ${subscription_id} +After Test + Output After Test + Stop Local Server + +*** Test Cases *** +Check notification structure + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated abov + [Tags] sub-notification 5_11_7 5_11_7_01 + Setup Initial Subscriptions + Add Initial Entity + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + @{expected_notification_data_entities}= Create List Building + ${notification} Wait for notification ${subscription_id} + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} + + Delete Initial Subscriptions + Delete Initial Entity + +Check correct attributes are included + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). + [Tags] sub-notification 5_11_7 5_11_7_02 + Setup Initial Subscriptions + Add Initial Entity Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} + + @{expected_notification_data_entities}= Create List Building + ${notification} Wait for notification ${subscription_id} + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} + + Delete Initial Subscriptions + Delete Initial Entity + +Check URI expansion is observed + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). + [Tags] sub-notification 5_11_7 5_11_7_03 + Setup Initial Subscriptions + Add Initial Entity + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + @{expected_notification_data_entities}= Create List Building + ${notification} Wait for notification ${subscription_id} + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} + + Delete Initial Subscriptions + Delete Initial Entity diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 193d2d2e..223c0fa2 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -3,8 +3,8 @@ "type":"Subscription", "isActive": true, "expiresAt": null, - "watchedAttributes": ["name", "airQualityObserved"], - "q": "name=\"Building1\"", + "watchedAttributes": ["airQualityObserved"], + "q": "name==\"Building1\"", "entities":[ { "type":"Building" diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld index c5707f2e..0926f1ff 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -3,8 +3,7 @@ "type":"Subscription", "isActive": true, "expiresAt": null, - "watchedAttributes": ["name", "airQualityObserved"], - + "watchedAttributes": ["airQualityObserved"], "entities":[ { "type":"Building" diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index cce6479d..ad4ad283 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -7,7 +7,7 @@ "type":"Building" } ], - "q": "1=1; DROP TABLE entity --", + "q": "name==\"Building1\"", "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", -- GitLab From 368b2766f68f15d08ee13f6c00a02f5ba82be8a9 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Mon, 5 Jul 2021 11:57:01 +0200 Subject: [PATCH 222/442] better follow preconditions --- .../Subscription/Notification/046_01.robot | 9 ++++++--- .../Subscription/Notification/046_02.robot | 1 + .../Subscription/Notification/046_03.robot | 2 ++ .../Subscription/Notification/046_04.robot | 3 ++- .../Subscription/Notification/046_05.robot | 3 ++- .../Subscription/Notification/046_07.robot | 7 ++++--- data/subscriptions/subscription-inactive-sample.jsonld | 2 +- data/subscriptions/subscription-sample.jsonld | 2 +- .../subscription-timeInterval-sample-query.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 3 ++- resources/JsonUtils.resource | 6 ++++++ 11 files changed, 28 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 221e47c7..016a203c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -24,6 +24,7 @@ ${notification_server_send_url}= http://${send_notification_server_host}:${s Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -31,8 +32,6 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - Setup Initial Subscriptions - Add Initial Entity NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} After Test @@ -54,9 +53,13 @@ Check that a notification is only sent if status is active [Documentation] Check that a notification is only sent if and only if the status is active [Tags] sub-notification 5_11_7 + Add Initial Entity + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification}= Wait for notification timeout=${5} + ${notification}= Wait for notification timeout=${10} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 906ea250..66c6646f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -18,6 +18,7 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index ec4dbff2..e0f5eefd 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -18,6 +18,7 @@ ${entity_building_filepath}= building-simple-attributes-sample.jsonld Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -49,6 +50,7 @@ Check that a notification is sent with all entities Setup Initial Subscriptions ${notification}= Wait for notification ${5} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index bbed087c..38be60b4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -20,6 +20,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -47,8 +48,8 @@ Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 - Setup Initial Subscriptions Add Initial Entity + Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 74093d04..4d5a7362 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -20,6 +20,7 @@ ${fragment_filename}= airQualityLevel-fragment.jsonld Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -47,8 +48,8 @@ Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions [Tags] sub-notification 5_11_7 - Setup Initial Subscriptions Add Initial Entity + Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 937b59c0..c2d3013d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -25,6 +25,7 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -51,8 +52,8 @@ After Test Check notification structure [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated abov [Tags] sub-notification 5_11_7 5_11_7_01 - Setup Initial Subscriptions Add Initial Entity + Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @{expected_notification_data_entities}= Create List Building @@ -69,8 +70,8 @@ Check notification structure Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). [Tags] sub-notification 5_11_7 5_11_7_02 - Setup Initial Subscriptions Add Initial Entity + Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @{expected_notification_data_entities}= Create List Building @@ -87,8 +88,8 @@ Check correct attributes are included Check URI expansion is observed [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). [Tags] sub-notification 5_11_7 5_11_7_03 - Setup Initial Subscriptions Add Initial Entity + Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @{expected_notification_data_entities}= Create List Building diff --git a/data/subscriptions/subscription-inactive-sample.jsonld b/data/subscriptions/subscription-inactive-sample.jsonld index a00ea736..c3ae592d 100644 --- a/data/subscriptions/subscription-inactive-sample.jsonld +++ b/data/subscriptions/subscription-inactive-sample.jsonld @@ -11,7 +11,7 @@ "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"application/json" + "accept":"*/*" } }, "@context":[ diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index 21ccd03c..a50c96f9 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -11,7 +11,7 @@ "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"application/json" + "accept":"*/*" } }, "@context":[ diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index ad4ad283..a2acb544 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -11,7 +11,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"application/json" + "accept":"*/*" } }, "@context":[ diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index c6e15605..77c55675 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -8,9 +8,10 @@ } ], "notification":{ + "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"application/json" + "accept":"*/*" } }, "@context":[ diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 9d633d56..726f3bd3 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -35,6 +35,12 @@ Load Subscription Sample With Reachable Endpoint [return] ${subscription} +Set Entity Id In Subscription + [Arguments] ${subscription_payload} ${entity_id} + ${dict}= Create Dictionary id=${entity_id} + ${subscription}= Add Object To Json ${subscription_payload} $..entities[0] ${dict} + [Return] ${subscription} + Load Context Source Registration Sample With Reachable Context Source [Arguments] ${context_source_registration_file_path} ${context_source_registration_id}=${EMPTY} ${context_source_endpoint_uri}=${context_source_url} -- GitLab From 9d11df03faa8ac80e0ab0f379f61d1612c6b37fe Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Mon, 5 Jul 2021 14:30:09 +0200 Subject: [PATCH 223/442] 046_08 wip --- .../Subscription/Notification/046_01.robot | 2 +- .../Subscription/Notification/046_02.robot | 2 +- .../Subscription/Notification/046_03.robot | 2 +- .../Subscription/Notification/046_04.robot | 2 +- .../Subscription/Notification/046_05.robot | 2 +- .../Subscription/Notification/046_06.robot | 2 +- .../Subscription/Notification/046_07.robot | 21 ++--- .../Subscription/Notification/046_08.robot | 87 ++++++++++++++++--- 8 files changed, 85 insertions(+), 35 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 016a203c..d7b4b781 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -51,7 +51,7 @@ Delete Initial Entity *** Test Cases *** Check that a notification is only sent if status is active [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_01 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 66c6646f..24c98693 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -45,7 +45,7 @@ After Test *** Test Case *** Check that a notification is sent on the timeinterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_02 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index e0f5eefd..81cf2b15 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -44,7 +44,7 @@ After Test *** Test Case *** Check that a notification is sent with all entities [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_03 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index 38be60b4..e4d2494b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -46,7 +46,7 @@ After Test *** Test Case *** Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_04 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 4d5a7362..710659d1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -46,7 +46,7 @@ After Test *** Test Case *** Check that a notification is sent with all entities [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_05 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 35ffaaa8..c431a3ce 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -26,7 +26,7 @@ Delete Initial Subscriptions *** Test Case *** Check that a notification is sent with all entities with matching context source [Documentation] only the subscribed Entities whose origin Context Source matches the referred filter shall be included. - [Tags] sub-notification 5_11_7 + [Tags] sub-notification 5_11_7 046_06 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index c2d3013d..ceba886f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -41,17 +41,15 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - Output Before Test NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} After Test - Output After Test Stop Local Server *** Test Cases *** Check notification structure [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated abov - [Tags] sub-notification 5_11_7 5_11_7_01 + [Tags] sub-notification 5_11_7 046_07_01 Add Initial Entity Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -69,36 +67,29 @@ Check notification structure Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). - [Tags] sub-notification 5_11_7 5_11_7_02 + [Tags] sub-notification 5_11_7 046_07_02 Add Initial Entity Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @{expected_notification_data_entities}= Create List Building ${notification} Wait for notification ${subscription_id} - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} - ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} - Should Be True ${is_date} or ${is_date_with_millis} + + # TODO Delete Initial Subscriptions Delete Initial Entity Check URI expansion is observed [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). - [Tags] sub-notification 5_11_7 5_11_7_03 + [Tags] sub-notification 5_11_7 046_07_03 Add Initial Entity Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @{expected_notification_data_entities}= Create List Building ${notification} Wait for notification ${subscription_id} - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} - ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} - Should Be True ${is_date} or ${is_date_with_millis} + # TODO Delete Initial Subscriptions Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 6d386ba9..9d9dc5a1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -4,32 +4,91 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} -*** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +Delete Initial Entity + Delete Entity by Id ${entity_id} - @{expected_notification_data_entities}= Create List Building - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} - Set Suite Variable ${subscription_id} +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + + +*** Test Case *** +Check that a notification is sent with all attributes + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included + [Tags] sub-notification 5_11_7 046_08_01 + + Add Initial Entity + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for subscription notification and validate it ${subscription_id} ${expected_notification_data_entities} timeout=${5} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal Building1 ${notification}[data][0][name][value] + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#almostFull + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#subCategory + + + +Check that a notification is sent with all attributes in simplified format + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided + [Tags] sub-notification 5_11_7 046_08_02 + + Add Initial Entity + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Update Value To Json ${subscription_payload} $..notification['format'] keyValues + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be Equal Building1 ${notification}[data][0][name][value] + + + -- GitLab From c1255ccabc66d6d0f1ca32e5d01d1de55d827976 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Mon, 5 Jul 2021 14:52:57 +0200 Subject: [PATCH 224/442] 046_09 --- .../Subscription/Notification/046_01.robot | 3 - .../Subscription/Notification/046_08.robot | 7 ++- .../Subscription/Notification/046_09.robot | 62 +++++++++++-------- data/entities/building-no-attributes.jsonld | 11 ++++ .../subscription-timeInterval-sample.jsonld | 1 - 5 files changed, 52 insertions(+), 32 deletions(-) create mode 100644 data/entities/building-no-attributes.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index d7b4b781..96626c97 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -12,12 +12,9 @@ Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -#subscriptions/testsubscription.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${entity_building_filepath}= building-simple-attributes-sample.jsonld -#testentity.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld -#testfragment.jsonld ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 9d9dc5a1..01acdb8b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -84,9 +84,12 @@ Check that a notification is sent with all attributes in simplified format Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' Should be Equal Building1 ${notification}[data][0][name][value] - + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#almostFull + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel + Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#subCategory + # TODO: difference between keyValue and not + diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 58e88a85..ee2504a0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -7,44 +7,54 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: - - - +${entity_building_filepath}= building-no-attributes.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify *** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 - [Tags] sub-notification 5_11_7 +Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - - @{expected_notification_data_entities}= Create List Building + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for redirected request - +Delete Initial Subscriptions + Delete Subscription ${subscription_id} -*** Keywords *** -Setup Initial Subscription - Start Local Server - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Set Suite Variable ${subscription_id} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -Delete Subscription +After Test + Delete Initial Subscriptions + Delete Initial Entity Stop Local Server - Delete Subscription ${subscription_id} + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +*** Test Cases *** +Check that a notification is sent to the endpoint + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 046_09 + + Add Initial Entity + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} diff --git a/data/entities/building-no-attributes.jsonld b/data/entities/building-no-attributes.jsonld new file mode 100644 index 00000000..4d61852c --- /dev/null +++ b/data/entities/building-no-attributes.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Building1" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index 77c55675..55bee880 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -8,7 +8,6 @@ } ], "notification":{ - "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", "accept":"*/*" -- GitLab From 3ed7fbe42e9b00451729743ccae53b2a79e1afb5 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Mon, 5 Jul 2021 14:56:38 +0200 Subject: [PATCH 225/442] 046_10 --- .../Subscription/Notification/046_09.robot | 2 +- .../Subscription/Notification/046_10.robot | 66 +++++++++++-------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index ee2504a0..fc74f2c7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -47,7 +47,7 @@ Delete Initial Entity *** Test Cases *** Check that a notification is sent to the endpoint - [Documentation] Check that a notification is only sent if and only if the status is active + [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.1 [Tags] sub-notification 5_11_7 046_09 Add Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index fa8eaa65..857e11c8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -1,51 +1,61 @@ *** Settings *** -Documentation The Notification content shall be JSON by default. +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-no-attributes.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -*** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] The Notification content shall be JSON by default. - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server - @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} - Wait for redirected request - - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building +Delete Initial Entity + Delete Entity by Id ${entity_id} +*** Test Cases *** +Check that a notification is JSON + [Documentation] The Notification content shall be JSON by defaul + [Tags] sub-notification 5_11_7 046_10 -*** Keywords *** -Setup Initial Subscription - Start Local Server - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Set Suite Variable ${subscription_id} + Add Initial Entity + Setup Initial Subscriptions -Delete Subscription - Stop Local Server - Delete Subscription ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + # Wait for notification parses the json of the request by default + ${notification}= Wait for notification timeout=${10} -- GitLab From 41324caebad36fa0013b442a5c81a065db96dd49 Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Mon, 5 Jul 2021 15:05:39 +0200 Subject: [PATCH 226/442] 046_11 and 046_12 --- .../Subscription/Notification/046_11.robot | 70 ++++++++++-------- .../Subscription/Notification/046_12.robot | 72 +++++++++++-------- 2 files changed, 84 insertions(+), 58 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 0f178480..14246ae1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation The Notification content shall be JSON by default +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 Resource ${EXECDIR}/resources/ApiUtils.resource @@ -7,47 +7,59 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-no-attributes.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${date_format}= %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -*** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] The Notification content shall be JSON by default - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server - @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} - Wait for redirected request +Delete Initial Entity + Delete Entity by Id ${entity_id} - @{expected_notification_additional_members}= Create List lastNotification lastSuccess - Check JSON Value In Response Body json_path_expr value_to_check ${notification_expectation_file_path} ${expected_notification_additional_members} - +*** Test Cases *** +Check that TimesSent is increased by one + [Documentation] The notification.timesSent member shall be incremented by one. + [Tags] sub-notification 5_11_7 046_11 -*** Keywords *** -Setup Initial Subscription - Start Local Server - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Set Suite Variable ${subscription_id} + Add Initial Entity + Setup Initial Subscriptions -Delete Subscription - Stop Local Server - Delete Subscription ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Dictionary Should Contain Key ${notification} timesSent + Should be True '${notification}[timesSent] 1 diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 1f383c40..346324ec 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -1,52 +1,66 @@ *** Settings *** -Documentation The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-no-attributes.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -*** Keywords *** -Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} - [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${entity_id}= Generate Random Entity Id ${building_id_prefix} +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server - @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} - Wait for redirected request +Delete Initial Entity + Delete Entity by Id ${entity_id} - - - Check Notification Date ${subscription_id} +*** Test Cases *** +Check that lastNotification is updated + [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + [Tags] sub-notification 5_11_7 046_12 -*** Keywords *** -Setup Initial Subscription - Start Local Server - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} - Set Suite Variable ${subscription_id} + Add Initial Entity + Setup Initial Subscriptions -Delete Subscription - Stop Local Server - Delete Subscription ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Dictionary Should Contain Key ${notification} lastNotification + + ${is_date}= Is Date ${notification}[lastNotification] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[lastNotification] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} -- GitLab From a76ef1e12f5a68e625fd83522d8f2e5872f2d92c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 26 Jul 2021 09:06:51 +0200 Subject: [PATCH 227/442] fix(subscriptions): set an acceptable value for endpoint.accept --- ...tion-building-entities-active-watchedAttributes-query.jsonld | 2 +- ...bscription-building-entities-active-watchedAttributes.jsonld | 2 +- data/subscriptions/subscription-building-entities-active.jsonld | 2 +- data/subscriptions/subscription-inactive-sample.jsonld | 2 +- data/subscriptions/subscription-sample.jsonld | 2 +- .../subscriptions/subscription-timeInterval-sample-query.jsonld | 2 +- data/subscriptions/subscription-timeInterval-sample.jsonld | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 223c0fa2..347f8699 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -13,7 +13,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld index 0926f1ff..7f73b508 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -12,7 +12,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld index 922d2920..3becb2cb 100644 --- a/data/subscriptions/subscription-building-entities-active.jsonld +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -11,7 +11,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-inactive-sample.jsonld b/data/subscriptions/subscription-inactive-sample.jsonld index c3ae592d..a00ea736 100644 --- a/data/subscriptions/subscription-inactive-sample.jsonld +++ b/data/subscriptions/subscription-inactive-sample.jsonld @@ -11,7 +11,7 @@ "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index a50c96f9..21ccd03c 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -11,7 +11,7 @@ "format":"keyValues", "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index a2acb544..ad4ad283 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -11,7 +11,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index 55bee880..c6e15605 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -10,7 +10,7 @@ "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", - "accept":"*/*" + "accept":"application/json" } }, "@context":[ -- GitLab From dab34688aee1184176a118c05cf25a0e49a92e89 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 27 Jul 2021 15:13:06 +0200 Subject: [PATCH 228/442] fix: unadvertently modified sample file was failing some tests --- data/entities/building-simple-attributes-sample.jsonld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 98f23d0d..dcf11f9f 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "Building1" + "value": "Eiffel Tower" }, "subCategory": { "type": "Property", @@ -22,4 +22,4 @@ "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] -} \ No newline at end of file +} -- GitLab From b45c716dccf2efecab3f40e58f4e44d4af38ad71 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 27 Jul 2021 18:41:08 +0200 Subject: [PATCH 229/442] fix(046): misc errors in the implementation of the 046_XX series of Test Cases --- .../Subscription/Notification/046_01.robot | 6 ++---- .../Subscription/Notification/046_02.robot | 2 +- .../Subscription/Notification/046_03.robot | 4 ++-- .../Subscription/Notification/046_04.robot | 6 +++--- .../Subscription/Notification/046_05.robot | 2 +- .../Subscription/Notification/046_07.robot | 2 +- .../Subscription/Notification/046_08.robot | 19 +++++++++++-------- .../Subscription/Notification/046_09.robot | 2 +- .../Subscription/Notification/046_11.robot | 3 ++- ...ties-active-watchedAttributes-query.jsonld | 4 ++-- 10 files changed, 26 insertions(+), 24 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index 96626c97..f92c5c01 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -4,8 +4,6 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -# Suite Setup Setup Initial Subscriptions -# Suite Teardown Delete Initial Subscriptions Suite Setup Before Test Suite Teardown After Test @@ -53,11 +51,11 @@ Check that a notification is only sent if status is active Add Initial Entity Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification timeout=${10} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal 5 ${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 24c98693..99b1e92e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -61,7 +61,7 @@ Check that a notification is sent on the timeinterval Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Building1 ${notification}[data][0][name][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 81cf2b15..538c7d11 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation A notification with all all subscribed Entities will be included if query or geoquery are not defined. +Documentation A notification with all subscribed Entities will be included if query or geoquery are not defined. Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -56,7 +56,7 @@ Check that a notification is sent with all entities Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Building1 ${notification}[data][0][name][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index e4d2494b..c876616b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -58,8 +58,8 @@ Check that a notification is sent with all entities Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Building1 ${notification}[data][0][name][value] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 710659d1..918ce467 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -59,4 +59,4 @@ Check that a notification is sent with all entities Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Building1 ${notification}[data][0][name][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index ceba886f..da4acc1f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -48,7 +48,7 @@ After Test *** Test Cases *** Check notification structure - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated abov + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above [Tags] sub-notification 5_11_7 046_07_01 Add Initial Entity Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 01acdb8b..a4c44f7a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -59,10 +59,10 @@ Check that a notification is sent with all attributes Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal Building1 ${notification}[data][0][name][value] - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#almostFull - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#subCategory + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + Dictionary Should Contain Key ${notification}[data][0] almostFull + Dictionary Should Contain Key ${notification}[data][0] airQualityLevel + Dictionary Should Contain Key ${notification}[data][0] subCategory @@ -78,16 +78,19 @@ Check that a notification is sent with all attributes in simplified format Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${notification}= Wait for notification ${5} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal Building1 ${notification}[data][0][name][value] - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#almostFull - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - Dictionary Should Contain Key '${notification}[data][0] https://ngsi-ld-test-suite/context#subCategory + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + Dictionary Should Contain Key ${notification}[data][0] almostFull + Dictionary Should Contain Key ${notification}[data][0] airQualityLevel + Dictionary Should Contain Key ${notification}[data][0] subCategory # TODO: difference between keyValue and not diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index fc74f2c7..a9480193 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -14,7 +14,7 @@ Suite Teardown After Test ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-no-attributes.jsonld +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 14246ae1..b678ec07 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -14,7 +14,7 @@ Suite Teardown After Test ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-no-attributes.jsonld +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify ${date_format}= %Y-%m-%dT%H:%M:%SZ @@ -59,6 +59,7 @@ Check that TimesSent is increased by one ${notification}= Wait for notification timeout=${10} + Output ${notification} Dictionary Should Contain Key ${notification} timesSent Should be True '${notification}[timesSent] 1 diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 347f8699..3859e19a 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -3,8 +3,8 @@ "type":"Subscription", "isActive": true, "expiresAt": null, - "watchedAttributes": ["airQualityObserved"], - "q": "name==\"Building1\"", + "watchedAttributes": ["airQualityLevel"], + "q": "name==\"Eiffel%20Tower\"", "entities":[ { "type":"Building" -- GitLab From 2ae4174501198112b875b82e7e997b455c4badea Mon Sep 17 00:00:00 2001 From: Arnaud Van der Poorten Date: Wed, 28 Jul 2021 13:10:27 +0200 Subject: [PATCH 230/442] (046) Fixed most remarks --- .../Subscription/Notification/046_07.robot | 24 ++++++++++++------- .../Subscription/Notification/046_08.robot | 13 ++++------ .../Subscription/Notification/046_10.robot | 7 ++++-- data/entities/building-no-attributes.jsonld | 2 +- ...ties-active-watchedAttributes-query.jsonld | 1 - ...g-entities-active-watchedAttributes.jsonld | 3 +-- ...bscription-building-entities-active.jsonld | 1 - ...scription-timeInterval-sample-query.jsonld | 2 +- resources/variables.py | 2 +- 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index da4acc1f..f178fd22 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -14,6 +14,7 @@ Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path_watchedAttributes}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify ${entity_building_filepath}= building-simple-attributes-sample.jsonld @@ -23,8 +24,9 @@ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ *** Keywords *** Setup Initial Subscriptions + [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_path} ${subscription_id} ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -54,7 +56,6 @@ Check notification structure Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - @{expected_notification_data_entities}= Create List Building ${notification} Wait for notification ${subscription_id} Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} @@ -69,13 +70,16 @@ Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). [Tags] sub-notification 5_11_7 046_07_02 Add Initial Entity - Setup Initial Subscriptions + Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - @{expected_notification_data_entities}= Create List Building ${notification} Wait for notification ${subscription_id} - - # TODO + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} + Dictionary Should Contain Key ${notification}[data][0] airQualityLevel Delete Initial Subscriptions Delete Initial Entity @@ -87,9 +91,13 @@ Check URI expansion is observed Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - @{expected_notification_data_entities}= Create List Building ${notification} Wait for notification ${subscription_id} - # TODO + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} + ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} + ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} + Dictionary Should Contain Key ${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel Delete Initial Subscriptions Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index a4c44f7a..a7dab753 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -83,15 +83,10 @@ Check that a notification is sent with all attributes in simplified format ${notification}= Wait for notification ${5} Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal Eiffel Tower ${notification}[data][0][name][value] - Dictionary Should Contain Key ${notification}[data][0] almostFull - Dictionary Should Contain Key ${notification}[data][0] airQualityLevel - Dictionary Should Contain Key ${notification}[data][0] subCategory - # TODO: difference between keyValue and not + ${notification} Wait for notification ${subscription_id} + ${list_count}= Count Values In List ${notification} + Should Not Be Equal ${list_count} 0 + Should Be Equal ${notification}[0][id] ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 857e11c8..46d790d1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -55,7 +55,10 @@ Check that a notification is JSON Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - # Wait for notification parses the json of the request by default - ${notification}= Wait for notification timeout=${10} + Wait For Request ${timeout} + Reply By 200 + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification} Evaluate json.loads('''${notification_payload}''') json diff --git a/data/entities/building-no-attributes.jsonld b/data/entities/building-no-attributes.jsonld index 4d61852c..10c9d65e 100644 --- a/data/entities/building-no-attributes.jsonld +++ b/data/entities/building-no-attributes.jsonld @@ -3,7 +3,7 @@ "type": "Building", "name": { "type": "Property", - "value": "Building1" + "value": "Eiffel Tower" }, "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 3859e19a..17104acd 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -2,7 +2,6 @@ "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", "isActive": true, - "expiresAt": null, "watchedAttributes": ["airQualityLevel"], "q": "name==\"Eiffel%20Tower\"", "entities":[ diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld index 7f73b508..c82401eb 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -2,8 +2,7 @@ "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", "isActive": true, - "expiresAt": null, - "watchedAttributes": ["airQualityObserved"], + "watchedAttributes": ["airQualityLevel"], "entities":[ { "type":"Building" diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld index 3becb2cb..210525fc 100644 --- a/data/subscriptions/subscription-building-entities-active.jsonld +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -2,7 +2,6 @@ "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", "isActive": true, - "expiresAt": null, "entities":[ { "type":"Building" diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index ad4ad283..0f15abf7 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -7,7 +7,7 @@ "type":"Building" } ], - "q": "name==\"Building1\"", + "q": "name==\"Eiffel%20Tower\"", "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", diff --git a/resources/variables.py b/resources/variables.py index f6324fa6..b055b5a0 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,6 +1,6 @@ def get_variables(arg=None): variables = { - 'url': 'localhost:9090/ngsi-ld/v1', + 'url': 'localhost:8080/ngsi-ld/v1', 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', 'notification_server_host': '0.0.0.0', 'notification_server_port': 8085, -- GitLab From e503f7f63fb954d56ec1c0a51b0c7d6681dfc01d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 7 Aug 2021 08:50:00 +0200 Subject: [PATCH 231/442] fix: check of response content in 043_05 --- TP/NGSI-LD/CommonBehaviours/043.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index b9bdd011..d3b2f18b 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -56,8 +56,8 @@ ${registration_filename}= csourceRegistrations/context-source-registration-un @{entities_to_be_created}= Create List ${first_entity} ${second_entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To ${expected_status_code} - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration -- GitLab From 84b2ef899b5645e909ca262992215d7b13844d2a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:14:06 +0200 Subject: [PATCH 232/442] fix(subscriptions): rename timeinterval to timeInterval --- .../ContextInformation/Subscription/Notification/046_02.robot | 2 +- .../expectations/subscription-sample-expectation.json | 1 + data/subscriptions/subscription-sample.jsonld | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 99b1e92e..8b87d793 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -43,7 +43,7 @@ After Test *** Test Case *** -Check that a notification is sent on the timeinterval +Check that a notification is sent on the timeInterval [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." [Tags] sub-notification 5_11_7 046_02 diff --git a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json index 42d6c58f..e672a7f7 100644 --- a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json +++ b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json @@ -6,6 +6,7 @@ "type": "https://ngsi-ld-test-suite/context#Building" } ], + "timeInterval": 5, "notification": { "endpoint": { "accept": "application/json", diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index 21ccd03c..6af4f401 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -1,7 +1,7 @@ { "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", - "timeinterval": 5, + "timeInterval": 5, "entities":[ { "type":"Building" -- GitLab From 1e146a8e19e84e83a0aeaac959f01b6a425a248c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:16:31 +0200 Subject: [PATCH 233/442] fix: a list of one single element is rendered as a string due to how JSON-LD expansion works --- data/entities/building-location-attribute-sample.jsonld | 2 +- data/entities/building-location-attribute.jsonld | 2 +- data/entities/building-relationship-of-property-sample.jsonld | 2 +- data/entities/building-simple-attributes-sample.json | 2 +- data/entities/building-simple-attributes-sample.jsonld | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index cba71b77..1cda399b 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "location": { "type": "GeoProperty", diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld index 0bb447e8..e03c467a 100644 --- a/data/entities/building-location-attribute.jsonld +++ b/data/entities/building-location-attribute.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "location": { "type": "GeoProperty", diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 2b21215c..5518b700 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", diff --git a/data/entities/building-simple-attributes-sample.json b/data/entities/building-simple-attributes-sample.json index c0beff52..7b86aadd 100644 --- a/data/entities/building-simple-attributes-sample.json +++ b/data/entities/building-simple-attributes-sample.json @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index dcf11f9f..49993315 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -7,7 +7,7 @@ }, "subCategory": { "type": "Property", - "value": ["tourism"] + "value": "tourism" }, "airQualityLevel": { "type": "Property", -- GitLab From 18e358f884e9e5ee94fba9ae1ac3dd48394b586c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:17:28 +0200 Subject: [PATCH 234/442] fix: typo in comparison_result variable name --- resources/AssertionUtils.resource | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 1a8e33f1..d207b58e 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -111,7 +111,7 @@ Check Response Body Containing List Containing Entity Elements With Different Ty ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id + ${comparison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element @@ -219,7 +219,7 @@ Check Response Body Containing List Containing Context Source Registrations elem ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END - ${comparaison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id + ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request -- GitLab From 002e4695a4e820e5fb591b63836c18f78003070b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:22:23 +0200 Subject: [PATCH 235/442] fix(026_01): conform expectations to clause 5.7.8 (details of available attributes) --- .../attribute-026-01-01-expectation.json | 16 ---------------- .../attribute-026-01-02-expectation.json | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/data/types/expectations/attribute-026-01-01-expectation.json b/data/types/expectations/attribute-026-01-01-expectation.json index 19b88b32..d5fe0f28 100644 --- a/data/types/expectations/attribute-026-01-01-expectation.json +++ b/data/types/expectations/attribute-026-01-01-expectation.json @@ -3,10 +3,6 @@ "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -15,10 +11,6 @@ "id":"https://ngsi-ld-test-suite/context#subCategory", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#subCategory", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -27,10 +19,6 @@ "id":"https://ngsi-ld-test-suite/context#airQualityLevel", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#airQualityLevel", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] @@ -39,10 +27,6 @@ "id":"https://ngsi-ld-test-suite/context#almostFull", "type":"Attribute", "attributeName":"https://ngsi-ld-test-suite/context#almostFull", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] diff --git a/data/types/expectations/attribute-026-01-02-expectation.json b/data/types/expectations/attribute-026-01-02-expectation.json index 076b9e4f..6997eaf6 100644 --- a/data/types/expectations/attribute-026-01-02-expectation.json +++ b/data/types/expectations/attribute-026-01-02-expectation.json @@ -3,10 +3,6 @@ "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", "attributeName":"name", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -15,10 +11,6 @@ "id":"https://ngsi-ld-test-suite/context#subCategory", "type":"Attribute", "attributeName":"subCategory", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -27,10 +19,6 @@ "id":"https://ngsi-ld-test-suite/context#airQualityLevel", "type":"Attribute", "attributeName":"airQualityLevel", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] @@ -39,10 +27,6 @@ "id":"https://ngsi-ld-test-suite/context#almostFull", "type":"Attribute", "attributeName":"almostFull", - "attributeCount":1, - "attributeTypes":[ - "Property" - ], "typeNames":[ "Building" ] -- GitLab From 0fd41cf4a63db2a815acdc646decf70f0c3c6e0e Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:27:24 +0200 Subject: [PATCH 236/442] fix(023_01_01): name is no longer part of core context (so can't be compacted) --- data/types/expectations/entity-type-023-01-01-expectation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/types/expectations/entity-type-023-01-01-expectation.json b/data/types/expectations/entity-type-023-01-01-expectation.json index e938df4f..a1923831 100644 --- a/data/types/expectations/entity-type-023-01-01-expectation.json +++ b/data/types/expectations/entity-type-023-01-01-expectation.json @@ -4,7 +4,7 @@ "type":"EntityType", "typeName":"https://ngsi-ld-test-suite/context#Building", "attributeNames":[ - "name", + "https://ngsi-ld-test-suite/context#name", "https://ngsi-ld-test-suite/context#subCategory", "https://ngsi-ld-test-suite/context#airQualityLevel", "https://ngsi-ld-test-suite/context#almostFull" -- GitLab From 6e0ccf5d994165d1cb2f02a0a5775a9749ddae18 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 27 Mar 2022 18:30:50 +0200 Subject: [PATCH 237/442] fix(019_01_05): set Accept header to JSON-LD as expected payload is JSON-LD --- .../Consumption/Entity/QueryEntities/019_01_05.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 364607e5..9a8d7ab3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -24,7 +24,7 @@ Query several entities based on a list of properties @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} -- GitLab From b40892c1d47578c57f0cf6c83d0a9dc29ed23609 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 3 Apr 2022 18:30:53 +0200 Subject: [PATCH 238/442] fix(subscriptions): incorrect method calls or implementations and unused code --- .../CreateSubscription/031_02.robot | 2 +- .../Subscription/Notification/046_07.robot | 11 +++---- .../Subscription/Notification/046_08.robot | 2 +- .../Subscription/Notification/046_10.robot | 4 +-- .../Subscription/Notification/046_13.robot | 24 +++++---------- .../Subscription/Notification/046_14.robot | 24 +++++---------- resources/ApiUtils.resource | 3 +- resources/MockServerUtils.resource | 2 +- resources/MockSubscriberServer.resource | 30 ------------------- resources/NotificationUtils.resource | 25 ---------------- 10 files changed, 27 insertions(+), 100 deletions(-) delete mode 100644 resources/MockSubscriberServer.resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot index 46624211..2b13a473 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot @@ -17,6 +17,6 @@ Create Subscription With Invalid Request [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 Create Subscription From File ${filename} - Check RL Response Status Code Set To Expected Code 400 + Check RL Response Status Code Set To 400 Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index f178fd22..65dad24b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -1,14 +1,11 @@ *** Settings *** Documentation Check that a notification is only sent if and only if the status is active - - - Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test +Suite Setup Before Test Suite Teardown After Test *** Variable *** @@ -56,7 +53,7 @@ Check notification structure Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -73,7 +70,7 @@ Check correct attributes are included Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -91,7 +88,7 @@ Check URI expansion is observed Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index a7dab753..e91b9ac8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -83,7 +83,7 @@ Check that a notification is sent with all attributes in simplified format ${notification}= Wait for notification ${5} Output ${notification} - ${notification} Wait for notification ${subscription_id} + ${notification} Wait for notification ${list_count}= Count Values In List ${notification} Should Not Be Equal ${list_count} 0 Should Be Equal ${notification}[0][id] ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 46d790d1..907e3c0d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -47,7 +47,7 @@ Delete Initial Entity *** Test Cases *** Check that a notification is JSON - [Documentation] The Notification content shall be JSON by defaul + [Documentation] The Notification content shall be JSON by default [Tags] sub-notification 5_11_7 046_10 Add Initial Entity @@ -55,7 +55,7 @@ Check that a notification is JSON Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait For Request ${timeout} + Wait For Request 10 Reply By 200 ${notification_payload}= Get Request Body diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index fec85f5c..75c3d71b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -5,31 +5,24 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource - -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Setup Initial Subscription +Suite Teardown Delete Initial Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${fragment_filename}= airQualityLevel-fragment.jsonld - - - -*** Keywords *** +*** Test Case *** Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + [Tags] sub-notification 5_11_7 046_13 ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for redirected request @@ -42,11 +35,10 @@ Check that a notification is only sent if statis is active Setup Initial Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} -Delete Subscription +Delete Initial Subscription Stop Local Server Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 44e3ff20..81b2b8a7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -4,46 +4,38 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Resource ${EXECDIR}/resources/MockServerUtils.resource +Suite Setup Setup Initial Subscription +Suite Teardown Delete Initial Subscription *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${fragment_filename}= airQualityLevel-fragment.jsonld - - - -*** Keywords *** +*** Test Case *** Check that a notification is only sent if statis is active - [Arguments] ${fragment_filename} [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed - [Tags] sub-notification 5_11_7 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + [Tags] sub-notification 5_11_7 046_14 ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building - Set Suite Variable ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for redirected failed request @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} - *** Keywords *** Setup Initial Subscription Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Subscription ${subscription_id} ${subscription_payload} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} -Delete Subscription +Delete Initial Subscription Stop Local Server Delete Subscription ${subscription_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 8b417f57..84d99c23 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -705,7 +705,8 @@ Create Subscription From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} Create Session SubscriptionCreateRequest ${url} - ${response}= PATCH On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} expected_status=any + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any Set Test Variable ${response} Update Subscription diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index e0d162f9..fa46cdd3 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -5,7 +5,7 @@ Library HttpCtrl.Server *** Keywords *** Start Context Source Mock Server #Initialize HTTP Client And Server - Start Server 0.0.0.0 8086 + Start Server ${context_source_host} ${context_source_port} Wait for redirected request [Arguments] ${timeout}=${5} diff --git a/resources/MockSubscriberServer.resource b/resources/MockSubscriberServer.resource deleted file mode 100644 index e4e3b856..00000000 --- a/resources/MockSubscriberServer.resource +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Documentation Check Notification Behaviour -Library BuiltIn -Library Collections -Library HttpCtrl.Server -Library ${EXECDIR}/libraries/assertionUtils.py -Library ${EXECDIR}/libraries/dateTimeUtils.py - -*** Variable *** -${notification_type}= subscriber Notfication -${date_format}= %Y-%m-%dT%H:%M:%SZ - - -*** Keywords *** -Start Local Server - #Initialize HTTP Client And Server - Start Server 0.0.0.0 8085 - -Wait for redirected request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 200 - -Stop Local Server - #Terminate HTTP Server - Stop Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 20146267..8d0c0d92 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -64,7 +64,6 @@ Wait for notification and validate it Wait for subscription notification and validate it [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} ${expected_notification_type}=${notification_type} - Wait for subscription notification ${expected_subscription_id} ${expected_notification_data_entities} ${timeout} ${expected_notification_type} #HTTP server receives it and checks incoming request for correctness #.. "Wait For Request" #.... This call is blocked until HTTP request arrives or timeout. @@ -89,8 +88,6 @@ Wait for subscription notification and validate it Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} [return] ${notification} - - Wait for no notification [Arguments] ${timeout}=${5} #HTTP server receives it and checks incoming request for correctness @@ -110,28 +107,6 @@ Check Notification Data Entities Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True - -Check Notification Date - [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 200 - - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json - ${notification_data_length}= Get length ${notification}[data] - ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} - - - log ${notification} - ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - Should Be True ${is_date} - - - Stop Local Server #Terminate HTTP Server Stop Server -- GitLab From e0b1da9478cba7960ab6fa5096d124b8b50d1db5 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 13 Jul 2022 11:18:06 +0200 Subject: [PATCH 239/442] fix: use a really invalid idPattern in 019_03_03 --- .../Consumption/Entity/QueryEntities/019_03_03.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 70b83b93..9c86bba1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_entity_id_pattern}= invalid_entity_id_pattern* +${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Test Cases *** Query several entities based on incorrect id pattern -- GitLab From d01c7bafe8bf88bb55191ba4611f243984530a32 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 13 Jul 2022 11:18:47 +0200 Subject: [PATCH 240/442] fix: default compaction of almostFull attribute in 003_05 --- .../Provision/BatchEntities/CreateBatchOfEntities/003_05.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 5bc75782..292e09ad 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -21,6 +21,6 @@ Create a batch of one entity using the default context with JSON content type Check Response Body Containing an Attribute set to almostFull Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://uri.etsi.org/ngsi-ld/default-context/almostFull + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} -- GitLab From 9d2639e07002bce2173738a15162a6700107040f Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 13 Jul 2022 11:19:42 +0200 Subject: [PATCH 241/442] fix: setup / teardown instructions in 005_01 --- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index a1f79182..8a745d8c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -3,9 +3,9 @@ Documentation Check that you can update a batch of entities Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Update Entity Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -- GitLab From 282f8a801a564c015ba911f2856330bd6a242297 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 13 Jul 2022 11:20:34 +0200 Subject: [PATCH 242/442] feat: add Content-Type support in Retrieve Subscription keyword --- resources/ApiUtils.resource | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 84d99c23..d47c4d95 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -746,9 +746,9 @@ Query Subscriptions Set Test Variable ${response} Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary + [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" -- GitLab From 49c2889fcf0eb5c59e42ec02ac7962c9ff8d7c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poujol?= <76944966+gpoujol@users.noreply.github.com> Date: Tue, 13 Sep 2022 15:03:14 +0200 Subject: [PATCH 243/442] feature/handle accept in notification test (#2) We also do some modification: - change filepath to receive notification when attributes are updated - modify subscription payload to have a better alignment on the specification in 046_10 --- .../Subscription/Notification/046_10.robot | 11 ++- .../Subscription/Notification/046_15.robot | 69 +++++++++++++++++++ ...ion-building-entities-accept-jsonld.jsonld | 18 +++++ ...scription-building-entities-default.jsonld | 17 +++++ 4 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot create mode 100644 data/subscriptions/subscription-building-entities-accept-jsonld.jsonld create mode 100644 data/subscriptions/subscription-building-entities-default.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 907e3c0d..7ca7e30e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -12,11 +12,12 @@ Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-default.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-no-attributes.jsonld +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${expected_header_links}= <${ngsild_test_suite_context}>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" *** Keywords *** Setup Initial Subscriptions @@ -55,10 +56,14 @@ Check that a notification is JSON Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait For Request 10 + Wait For Request timeout=${10} Reply By 200 + ${notification_headers} = Get Request Headers + Dictionary Should Contain Item ${notification_headers} Link ${expected_header_links} + ${notification_payload}= Get Request Body # json.loads parses the payload as json. It fails if the payload is malformed ${notification} Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Not Contain Key ${notification}[data][0] @context diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot new file mode 100644 index 00000000..8db56cb0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot @@ -0,0 +1,69 @@ +*** Settings *** +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-accept-jsonld.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +*** Test Cases *** +Check that a notification is sent as JSON-LD + [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' + [Tags] sub-notification 5_11_7 046_10 + + Add Initial Entity + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait For Request timeout=${10} + Reply By 200 + + ${notification_headers} = Get Request Headers + Dictionary Should Not Contain Key ${notification_headers} Link + + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification} Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Contain Key ${notification}[data][0] @context + + diff --git a/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld new file mode 100644 index 00000000..efa28dbc --- /dev/null +++ b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld @@ -0,0 +1,18 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/ld+json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-default.jsonld b/data/subscriptions/subscription-building-entities-default.jsonld new file mode 100644 index 00000000..213bb9d9 --- /dev/null +++ b/data/subscriptions/subscription-building-entities-default.jsonld @@ -0,0 +1,17 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "endpoint":{ + "uri":"http://my.endpoint.org/notify" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] + } \ No newline at end of file -- GitLab From 950c097b94ddbf5e39d4469ffa9ca55c2b2ae569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poujol?= <76944966+gpoujol@users.noreply.github.com> Date: Wed, 7 Dec 2022 10:48:45 +0100 Subject: [PATCH 244/442] fix: do the actions at each test case rather than each suite (#3) --- .../EntityAttributes/DeleteEntityAttribute/013_03.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 0b6a7b2c..71a97150 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -3,7 +3,7 @@ Documentation Check that you cannot delete an attribute from an entity with Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Delete Attributes *** Variable *** -- GitLab From 891be17c9e9bbc5fa5d43b1d2642d55e8de3a8b6 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Thu, 8 Dec 2022 10:22:24 +0100 Subject: [PATCH 245/442] fix: put attribute name in expanded form --- .../types/expectations/attribute-026-01-01-expectation.json | 2 +- .../expectations/attribute-list-025-01-01-expectation.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/types/expectations/attribute-026-01-01-expectation.json b/data/types/expectations/attribute-026-01-01-expectation.json index d5fe0f28..6515b8b6 100644 --- a/data/types/expectations/attribute-026-01-01-expectation.json +++ b/data/types/expectations/attribute-026-01-01-expectation.json @@ -2,7 +2,7 @@ { "id":"https://ngsi-ld-test-suite/context#name", "type":"Attribute", - "attributeName":"name", + "attributeName":"https://ngsi-ld-test-suite/context#name", "typeNames":[ "https://ngsi-ld-test-suite/context#Building" ] diff --git a/data/types/expectations/attribute-list-025-01-01-expectation.json b/data/types/expectations/attribute-list-025-01-01-expectation.json index d8c015fd..d63a05c5 100644 --- a/data/types/expectations/attribute-list-025-01-01-expectation.json +++ b/data/types/expectations/attribute-list-025-01-01-expectation.json @@ -2,9 +2,9 @@ "id": "urn:ngsi-ld:AttributeList:randomUUID", "type": "AttributeList", "attributeList": [ - "name", - "https://ngsi-ld-test-suite/context#subCategory", "https://ngsi-ld-test-suite/context#airQualityLevel", - "https://ngsi-ld-test-suite/context#almostFull" + "https://ngsi-ld-test-suite/context#almostFull", + "https://ngsi-ld-test-suite/context#name", + "https://ngsi-ld-test-suite/context#subCategory" ] } \ No newline at end of file -- GitLab From 920241574daa371848a75a93871c8a619bee97e9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 15:29:54 +0100 Subject: [PATCH 246/442] fix(044_02): only check what is related to response content type --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 9 --- ...istration-with-expiration-expectation.json | 60 --------------- .../subscription-sample-expectation.json | 17 ----- ...-simple-attributes-sample-expectation.json | 22 ------ ...-representation-044-02-04-expectation.json | 76 ------------------- 5 files changed, 184 deletions(-) delete mode 100644 data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json delete mode 100644 data/csourceSubscriptions/expectations/subscription-sample-expectation.json delete mode 100644 data/entities/expectations/building-simple-attributes-sample-expectation.json delete mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index bc7c3cd2..cf2382e2 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -7,18 +7,13 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-simple-attributes-sample.jsonld -${building_expectation}= building-simple-attributes-sample-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= subscriptions/subscription-sample.jsonld -${subscription_expectation}= subscription-sample-expectation.json ${registration_id_prefix}= urn:ngsi-ld:Registration: ${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld -${registration_expectation}= context-source-registration-with-expiration-expectation.json ${registration_type}= Vehicle ${tea_id_prefix}= urn:ngsi-ld:Vehicle: ${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json ${teatype}= Vehicle ${content_type}= application/json @@ -31,7 +26,6 @@ ${content_type}= application/json Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} [Teardown] Delete Entity by Id Returning Response ${id} @@ -44,7 +38,6 @@ ${content_type}= application/json Check Response Status Code 201 ${response['status']} ${request} ${response}= Retrieve Subscription ${id} accept=*/* Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} [Teardown] Delete Subscription ${id} @@ -59,7 +52,6 @@ ${content_type}= application/json Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} - Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} [Teardown] Delete Context Source Registration ${registration_id} @@ -73,7 +65,6 @@ ${content_type}= application/json ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} - Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json b/data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json deleted file mode 100644 index ee6679e4..00000000 --- a/data/csourceRegistrations/expectations/context-source-registration-with-expiration-expectation.json +++ /dev/null @@ -1,60 +0,0 @@ - { - "id": "urn:ngsi-ld:Registration:randomUUID", - "type": "ContextSourceRegistration", - "timestamp": {}, - "endpoint": "http://my.csource.org:1026", - "information": [ - { - "entities": [ - { - "id": "urn:ngsi-ld:Registration:3911535208644330", - "type": "Vehicle" - } - ], - "ngsi-ld:properties": [], - "ngsi-ld:relationships": [] - }, - { - "entities": [ - { - "type": "OffStreetParking", - "idPattern": ".*downtown$" - }, - { - "type": "OffStreetParking", - "idPattern": ".*47$" - } - ], - "ngsi-ld:properties": [], - "ngsi-ld:relationships": [] - } - ], - "ngsi-ld:internal": false, - "location": { - "type": "Polygon", - "coordinates": [ - [ - [ - 100.0, - 0.0 - ], - [ - 101.0, - 0.0 - ], - [ - 101.0, - 1.0 - ], - [ - 100.0, - 1.0 - ], - [ - 100.0, - 0.0 - ] - ] - ] - } - } \ No newline at end of file diff --git a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json b/data/csourceSubscriptions/expectations/subscription-sample-expectation.json deleted file mode 100644 index e672a7f7..00000000 --- a/data/csourceSubscriptions/expectations/subscription-sample-expectation.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id":"urn:ngsi-ld:Subscription:randomUUID", - "type": "Subscription", - "entities": [ - { - "type": "https://ngsi-ld-test-suite/context#Building" - } - ], - "timeInterval": 5, - "notification": { - "endpoint": { - "accept": "application/json", - "uri": "http://my.endpoint.org/notify" - }, - "format": "keyValues" - } -} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expectation.json deleted file mode 100644 index 436ba724..00000000 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "Building", - "airQualityLevel": { - "type": "Property", - "value": 4, - "observedAt": "2020-09-09T16:40:00.000Z", - "unitCode": "C62" - }, - "almostFull": { - "type": "Property", - "value": false - }, - "subCategory": { - "type": "Property", - "value": "tourism" - }, - "name": { - "type": "Property", - "value": "Eiffel Tower" - } -} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json b/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json deleted file mode 100644 index 6fb2bc95..00000000 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json +++ /dev/null @@ -1,76 +0,0 @@ -[ - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":[ - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - } - ] - }, - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ] - } -] \ No newline at end of file -- GitLab From fd33fa228adf8e07bc3f5bd2efd4a6bdf46c8685 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 15:30:58 +0100 Subject: [PATCH 247/442] fix(common): failing assertions when empty dictionary expected --- resources/AssertionUtils.resource | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index d207b58e..6205f3a6 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -35,7 +35,7 @@ Check Response Body Content Output ${response_body} Output ${entity_payload} ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_payload} ${response_body} ${all_ignored_paths} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} @@ -94,7 +94,7 @@ Check Response Body Containing Entity element ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity} ${response_body} ${instance_id_regex_expr} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Entity Elements [Arguments] ${expectation_filename} ${entities_ids} ${response_body} @@ -112,14 +112,14 @@ Check Response Body Containing List Containing Entity Elements With Different Ty ${index}= Evaluate ${index} + 1 END ${comparison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element [Arguments] ${filename} ${temporal_entity_representation_id} ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entity_representation} ${response['body']} ${instance_id_regex_expr} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements [Arguments] ${filename} ${temporal_entities_representation_ids} @@ -130,7 +130,7 @@ Check Response Body Containing List Containing EntityTemporal elements ${index}= Evaluate ${index} + 1 END ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entities_representation_payload} ${response['body']} ${instance_id_regex_expr} group_by=id - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element [Arguments] ${expectation_filename} ${subscription_id} @@ -138,7 +138,7 @@ Check Response Body Containing Subscription element ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Subscription elements [Arguments] ${expectation_file_path} ${subscription_ids} @@ -150,7 +150,7 @@ Check Response Body Containing List Containing Subscription elements END ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} # Since response body can be a json object if it contains one element # A check on the response body type is needed @@ -174,42 +174,42 @@ Check Response Body Containing Context Source Registration element ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${context_source_registration} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeList element [Arguments] ${expectation_filename} ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_list_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityType element [Arguments] ${expectation_filename} ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeInfo element [Arguments] ${expectation_filename} ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_info_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing AttributeList element [Arguments] ${expectation_filename} ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_list_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Attribute element [Arguments] ${expectation_filename} ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_payload} ${response['body']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Context Source Registrations elements [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} @@ -220,7 +220,7 @@ Check Response Body Containing List Containing Context Source Registrations elem ${index}= Evaluate ${index} + 1 END ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request [Arguments] ${response} ${type} @@ -277,7 +277,7 @@ Check NotificationParams ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_notification} ${response['body']['notification']} ${ignored_keys} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} @@ -295,20 +295,20 @@ Check Response Body Containing One Subscription element ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response_body} ${instance_id_regex_expr} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing One Registration element [Arguments] ${expectation_filename} ${response_body} ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} ${comparison_result}= Compare Dictionaries Ignoring Keys ${registration} ${response_body} ${instance_id_regex_expr} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Resource Set To [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_resource} ${response['body']} ${ignored_keys} ${group_by} - Should Be True ${comparison_result=={}} msg=${comparison_result.pretty()} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Created Resource Set To [Arguments] ${created_resource} ${ignored_keys}=${None} -- GitLab From c1b79a52d7918025e3b29328bfa4a08acce77881 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 15:43:26 +0100 Subject: [PATCH 248/442] fix(044_05): typo in documentation of test case 044_05_03 --- TP/NGSI-LD/CommonBehaviours/044_05.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index 4fa70f5e..f8b63f49 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -29,7 +29,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld Check Response Status Code Set To ${status_code} 044_05_03 Query context source registration - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations) [Tags] csr-query 6_3_4 ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} Check Response Status Code ${status_code} ${response['status']} -- GitLab From cdd9192a269d75f376d94f800355615a330fd726 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 17:03:55 +0100 Subject: [PATCH 249/442] fix(005_02): expected status for BE update with noOverwrite --- .../UpdateBatchOfEntities/005_02.robot | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index b8c8c2ff..264a45f0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -3,37 +3,37 @@ Documentation Check that you can update a batch of entities with noOverwrite Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Update Entity With NoOverwrite Option Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${entity_payload_filename}= building-simple-attributes-sample.jsonld -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 [Tags] be-update 5_6_9 EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 [Tags] be-update 5_6_9 EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json + building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With NoOverwrite Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} + [Arguments] ${filename} ${update_fragment_filename} ${expected_status} [Documentation] Check that you can update a batch of entities with noOverwrite option ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite - Check Response Status Code Set To 204 + Check Response Status Code Set To ${expected_status} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} -- GitLab From 4d916ed77968743d06dadd4bfa9372b8a69d98b9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 17:05:56 +0100 Subject: [PATCH 250/442] fix: expected expanded version of name attribute when no context provided --- .../two-types-vehicle-offstreetparking-expectation.jsonld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld b/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld index 03def85a..eba300f3 100644 --- a/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld +++ b/data/entities/expectations/two-types-vehicle-offstreetparking-expectation.jsonld @@ -49,7 +49,7 @@ ] } }, - "name": { + "https://ngsi-ld-test-suite/context#name": { "type": "Property", "value": "Downtown One" }, -- GitLab From 328491fb1b1129422d9e06e3e82b7f1433f18151 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 17:29:10 +0100 Subject: [PATCH 251/442] fix(004_XX): create fixture entities in test setup (and not suite setup) --- .../BatchEntities/UpsertBatchOfEntities/004_02.robot | 4 ++-- .../BatchEntities/UpsertBatchOfEntities/004_03.robot | 4 ++-- .../BatchEntities/UpsertBatchOfEntities/004_04.robot | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index d8cda085..47992d03 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -3,9 +3,9 @@ Documentation Check that you can upsert a batch of non-existing and existing Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Upsert Non-existing And Existing Entities Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 90bb2146..a79bec7b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -3,9 +3,9 @@ Documentation Check that you can upsert a batch of existing entities and the Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Upsert Existing Entities Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index bcea78aa..0bd4d44b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -3,9 +3,9 @@ Documentation Check that you can upsert a batch of entities with update opti Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Upsert Entities With Update Option Scenarios -Suite Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -- GitLab From 950a261171e61d1dd1a4526d43ec3168bc759d39 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 17:29:36 +0100 Subject: [PATCH 252/442] fix(005_XX): create fixture entities in test setup (and not suite setup) --- .../BatchEntities/UpdateBatchOfEntities/005_01.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 8a745d8c..68953588 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -3,9 +3,9 @@ Documentation Check that you can update a batch of entities Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities +Test Setup Setup Initial Entities Test Template Batch Update Entity Scenarios -Test Teardown Delete Initial Entities +Test Teardown Delete Initial Entities *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -- GitLab From 042fd9db3611f11943e6620b44921ecbc7fcd023 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 10 Dec 2022 17:30:14 +0100 Subject: [PATCH 253/442] fix(json-ld): a list of one element can't be returned as a list --- .../entities/fragmentEntities/simple-attributes-fragment.json | 4 +--- .../simple-attributes-relationship-of-property-fragment.json | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/data/entities/fragmentEntities/simple-attributes-fragment.json b/data/entities/fragmentEntities/simple-attributes-fragment.json index d682a537..b2690757 100644 --- a/data/entities/fragmentEntities/simple-attributes-fragment.json +++ b/data/entities/fragmentEntities/simple-attributes-fragment.json @@ -5,9 +5,7 @@ }, "subCategory":{ "type":"Property", - "value":[ - "tourism" - ] + "value":"tourism" }, "airQualityLevel":{ "type":"Property", diff --git a/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json b/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json index 52660970..c09a92d6 100644 --- a/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json +++ b/data/entities/fragmentEntities/simple-attributes-relationship-of-property-fragment.json @@ -5,9 +5,7 @@ }, "subCategory":{ "type":"Property", - "value":[ - "tourism" - ] + "value":"tourism" }, "airQualityLevel":{ "type":"Property", -- GitLab From 20e515966ee754477eec3822bb4b1a42786b4e11 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 11 Dec 2022 08:22:40 +0100 Subject: [PATCH 254/442] fix(001_02): expected error types when content is invalid --- .../Provision/Entities/CreateEntity/001_02.robot | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index b8cd1838..a02843a9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -4,22 +4,22 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME +*** Test Cases *** FILENAME ERROR_TYPE 001_02_01_InvalidJson - invalid-json-sample.jsonld + invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_02_EmptyJson - empty-sample.jsonld + empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext - building-minimal-without-context-sample.jsonld + building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Create Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${error_type} [Documentation] Check that you cannot create an entity with an invalid request [Tags] e-create 5_6_1 Request Entity From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${error_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} -- GitLab From 43cea6a74e3a0e52ad1be04fac4b2d71a0481ce7 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 11 Dec 2022 11:42:04 +0100 Subject: [PATCH 255/442] fix(010_02): expected error is invalid request when JSON is not valid --- .../EntityAttributes/AppendEntityAttributes/010_02.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 5a56ed39..a0ba000b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -43,6 +43,6 @@ Append entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} Check RL Response Status Code Set To ${status_code} - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} -- GitLab From 0b1fabc05998bc93843946cdcb75708b8ef96868 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 11 Dec 2022 16:36:44 +0100 Subject: [PATCH 256/442] fix(012_02): remove duplicate TC and fix invalid fragment --- .../PartialAttributeUpdate/012_02.robot | 11 ++++------- ...eed-equal-datasetid-different-type-fragment.jsonld | 11 ++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 9aa45566..d9652e38 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -18,16 +18,13 @@ ${status_code}= 400 012_02_02_Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld -012_02_03_Make a partial attribute update if the Attribute Name is not present - ${valid_entity_id} speed vehicle-speed-wrong-name-fragment.jsonld +012_02_03_Make a partial attribute update if the Attribute Id is not present + ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld -012_02_04_Make a partial attribute update if the Attribute Id is invalid - ${valid_entity_id} invalid vehicle-speed-equal-datasetid-fragment.jsonld - -012_02_05_Make a partial attribute update if the Attribute type does not match +012_02_04_Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -012_02_06_Make a partial attribute update if the entity fragment is empty +012_02_05_Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.json *** Keywords *** diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld index e865fd84..fc881731 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld @@ -1,13 +1,6 @@ { - "speed": { - "type": "different_type", - "value": 56, - "source": { - "type": "Property", - "value": "Speedometer" - }, - "datasetId": "urn:ngsi-ld:Property:speedometerA4567-speed" - }, + "type": "Relationship", + "object": "urn:ngsi-ld:Entity:01", "@context": [ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] -- GitLab From f843b8e2c3c987c07bd3c9c5ccc91829345bdfba Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 09:15:40 +0100 Subject: [PATCH 257/442] fix(011_02): expected error is invalid request when JSON is not valid --- .../EntityAttributes/UpdateEntityAttributes/011_02.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index de384137..9041bebc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -40,6 +40,6 @@ Update entity attributes with invalid entity fragments Check Response Status Code 201 ${response['status']} Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} Check RL Response Status Code Set To 400 - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} -- GitLab From 994391509aeb11530e97088d58d0977f29941dc5 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 09:16:35 +0100 Subject: [PATCH 258/442] fix(028): wrong naming for create subscription TCs (and other fixes in them) --- .../{031_01.robot => 028_01.robot} | 2 +- .../{031_02.robot => 028_02.robot} | 14 +++++++------- .../{031_03.robot => 028_03.robot} | 4 ++-- .../{031_04.robot => 028_04.robot} | 0 4 files changed, 10 insertions(+), 10 deletions(-) rename TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/{031_01.robot => 028_01.robot} (88%) rename TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/{031_02.robot => 028_02.robot} (62%) rename TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/{031_03.robot => 028_03.robot} (95%) rename TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/{031_04.robot => 028_04.robot} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot similarity index 88% rename from TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot rename to TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index c577c2ac..0810552f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -15,6 +15,6 @@ Create Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} ${created_subscription}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} Check Created Resource Set To ${created_subscription} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot similarity index 62% rename from TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot rename to TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index 2b13a473..a4a848a2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -4,19 +4,19 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Subscription With Invalid Request -*** Test Cases *** FILENAME -031_02_01_InvalidJson - subscription-invalid-json-sample.jsonld +*** Test Cases *** FILENAME EXPECTED_STATUS +028_02_01_InvalidJson + subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} -031_02_02_EmptyJson - subscription-empty-sample.jsonld +028_02_02_EmptyJson + subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Create Subscription With Invalid Request - [Arguments] ${filename} + [Arguments] ${filename} ${expected_status} [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 Create Subscription From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${expected_status} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot rename to TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index cbd11b94..92b40f77 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -9,10 +9,10 @@ Test Template Create Subscription With Invalid/Empty Id ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld *** Test Cases *** ID -031_03_01_InvalidId +028_03_01_InvalidId invalidId -031_03_02_EmptyId ${EMPTY} +028_03_02_EmptyId ${EMPTY} *** Keywords *** Create Subscription With Invalid/Empty Id diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot similarity index 100% rename from TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/031_04.robot rename to TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot -- GitLab From 70511739079b655daeadb4763f1abc22d9b6c8b1 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 13:09:31 +0100 Subject: [PATCH 259/442] fix(030_01): get subscription by id without id cannot be tested since same endpoint as query subscriptions --- .../Subscription/RetrieveSubscription/030_01.robot | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 0a3299b3..29d83423 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -1,13 +1,10 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Documentation Check that you cannot retrieve a subscription if the subscription Id is not a valid URI, then an error of type BadRequestData shall be raised Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Retrieve Subscription With Non present Or Invalid Id *** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-retrieve 5_8_3 - InvalidId InvalidUri [Tags] sub-retrieve 5_8_3 -- GitLab From 011014e40cdb320883c78d58ae025bee707a8dbd Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 13:11:11 +0100 Subject: [PATCH 260/442] fix(030_03): assertions when testing retrieval of a subscription - missing timeInterval property - isActive is not expected when true --- .../expectations/subscriptions-030-03-expectation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/subscriptions/expectations/subscriptions-030-03-expectation.json b/data/subscriptions/expectations/subscriptions-030-03-expectation.json index 6ebc6092..4056c0ab 100644 --- a/data/subscriptions/expectations/subscriptions-030-03-expectation.json +++ b/data/subscriptions/expectations/subscriptions-030-03-expectation.json @@ -1,6 +1,7 @@ { "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", + "timeInterval": 5, "entities":[ { "type":"Building" @@ -13,6 +14,5 @@ "accept":"application/json" } }, - "isActive": true, "status": "active" } \ No newline at end of file -- GitLab From 4644c5e9c9d281db161b729dff4764d97c8e870b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 16:56:28 +0100 Subject: [PATCH 261/442] fix(subscription): ensure tests subscriptions are deleted after each test --- .../Subscription/Notification/046_06.robot | 2 -- .../Subscription/Notification/046_07.robot | 16 +++++++--------- .../Subscription/Notification/046_08.robot | 12 +++++++----- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index c431a3ce..0c732675 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -27,12 +27,10 @@ Delete Initial Subscriptions Check that a notification is sent with all entities with matching context source [Documentation] only the subscribed Entities whose origin Context Source matches the referred filter shall be included. [Tags] sub-notification 5_11_7 046_06 - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 65dad24b..c6fba8b5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -39,6 +39,10 @@ Add Initial Entity Delete Initial Entity Delete Entity by Id ${entity_id} +Delete Fixture Data + Delete Initial Subscriptions + Delete Initial Entity + Before Test NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} @@ -59,9 +63,7 @@ Check notification structure ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} - - Delete Initial Subscriptions - Delete Initial Entity + [Teardown] Delete Fixture Data Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). @@ -77,9 +79,7 @@ Check correct attributes are included ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] airQualityLevel - - Delete Initial Subscriptions - Delete Initial Entity + [Teardown] Delete Fixture Data Check URI expansion is observed [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). @@ -95,9 +95,7 @@ Check URI expansion is observed ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - - Delete Initial Subscriptions - Delete Initial Entity + [Teardown] Delete Fixture Data diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index e91b9ac8..189ec830 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -34,12 +34,14 @@ Add Initial Entity Delete Initial Entity Delete Entity by Id ${entity_id} +Delete Fixture Data + Delete Initial Subscriptions + Delete Initial Entity + Before Test NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} After Test - Delete Initial Subscriptions - Delete Initial Entity Stop Local Server @@ -63,8 +65,7 @@ Check that a notification is sent with all attributes Dictionary Should Contain Key ${notification}[data][0] almostFull Dictionary Should Contain Key ${notification}[data][0] airQualityLevel Dictionary Should Contain Key ${notification}[data][0] subCategory - - + [Teardown] Delete Fixture Data Check that a notification is sent with all attributes in simplified format [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided @@ -87,7 +88,8 @@ Check that a notification is sent with all attributes in simplified format ${list_count}= Count Values In List ${notification} Should Not Be Equal ${list_count} 0 Should Be Equal ${notification}[0][id] ${entity_id} - + [Teardown] Delete Fixture Data + -- GitLab From 9414ea36526960b301f0f9506dbe9628fb195f20 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 16:57:09 +0100 Subject: [PATCH 262/442] fix(subscriptions): fix some expectations for subscriptions --- .../subscription-028-01-expectation.jsonld | 21 +++++++++++++++++++ .../subscriptions-031-01-expectation.json | 3 +-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 data/subscriptions/expectations/subscription-028-01-expectation.jsonld diff --git a/data/subscriptions/expectations/subscription-028-01-expectation.jsonld b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld new file mode 100644 index 00000000..7551d04c --- /dev/null +++ b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld @@ -0,0 +1,21 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "timeInterval": 5, + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "status": "active", + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/subscriptions/expectations/subscriptions-031-01-expectation.json b/data/subscriptions/expectations/subscriptions-031-01-expectation.json index a4ee40eb..765af41a 100644 --- a/data/subscriptions/expectations/subscriptions-031-01-expectation.json +++ b/data/subscriptions/expectations/subscriptions-031-01-expectation.json @@ -2,6 +2,7 @@ { "id":"urn:ngsi-ld:Subscription:randomUUID", "type":"Subscription", + "timeInterval": 5, "entities":[ { "type":"Building" @@ -14,7 +15,6 @@ "accept":"application/json" } }, - "isActive": true, "status": "active" }, { @@ -36,7 +36,6 @@ "accept":"application/json" } }, - "isActive": true, "status": "active" }, { -- GitLab From 5acc1e2f48dc79db440a19cf5fb56a973627d2e0 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 17:47:59 +0100 Subject: [PATCH 263/442] fix(013_02): use correct arguments and checks for pagination --- .../Subscription/QuerySubscriptions/031_02.robot | 12 ++++++------ resources/ApiUtils.resource | 4 ++-- resources/AssertionUtils.resource | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 21c80a6b..ab108f6b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -13,24 +13,24 @@ ${first_subscription_payload_file_path}= subscriptions/subscription-sample.js ${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld ${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +*** Test Cases *** LIMIT OFFSET EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK Query Second Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" + ${1} ${1} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" [Tags] sub-query 5_8_4 Query Last Subscription - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} [Tags] sub-query 5_8_4 Query All Subscriptions - ${15} ${1} ${3} ${EMPTY} ${EMPTY} + ${15} ${0} ${3} ${EMPTY} ${EMPTY} [Tags] sub-query 5_8_4 *** Keywords *** Query Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place - Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} offset=${offset} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index d47c4d95..5b846cf6 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -730,13 +730,13 @@ Delete Subscription [return] ${response} Query Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${offset}=${EMPTY} ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + Run Keyword If '${offset}'!='' Set To Dictionary ${params} offset=${offset} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6205f3a6..5a422f3b 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -286,7 +286,7 @@ Check NotificationParams Check Pagination Prev And Next Headers [Arguments] ${prev_link} ${next_link} ${expected_links}= Create List ${prev_link} ${next_link} - Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link']} ${expected_links} ignore_order=True + Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link'].replace(" ", "").split(',')} ${expected_links} ignore_order=True Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} -- GitLab From c71cc83877f51c2cbb6de1c0fce4a2c07d378355 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 12 Dec 2022 18:18:33 +0100 Subject: [PATCH 264/442] fix(subscription): fix some expectations data --- .../Subscription/CreateSubscription/028_01.robot | 5 +++-- .../subscription-vehicle-expanded-types-sample.jsonld | 2 ++ .../expectations/subscription-vehicle-sample.jsonld | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 0810552f..3670536a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_expectation_file_path}= subscriptions/expectations/subscription-028-01-expectation.jsonld *** Test Cases *** Create Subscription @@ -14,7 +15,7 @@ Create Subscription [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - ${created_subscription}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} + ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - Check Created Resource Set To ${created_subscription} + Check Created Resource Set To ${expected_subscription} [Teardown] Delete Subscription ${subscription_id} diff --git a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld index 5cb80bfe..cfbc8670 100644 --- a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld @@ -6,6 +6,7 @@ "type":"https://ngsi-ld-test-suite/context#Vehicle" } ], + "timeInterval": 5, "notification":{ "format":"keyValues", "endpoint":{ @@ -13,6 +14,7 @@ "accept":"application/json" } }, + "status": "active", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] diff --git a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld index ae7a20da..3176c53e 100644 --- a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld @@ -6,6 +6,7 @@ "type":"Vehicle" } ], + "timeInterval": 5, "notification":{ "format":"keyValues", "endpoint":{ @@ -13,6 +14,7 @@ "accept":"application/json" } }, + "status": "active", "@context":[ "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] -- GitLab From ccd893896649f88c4ce55c1e3a5b14b1ac304a7b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 08:47:21 +0100 Subject: [PATCH 265/442] fix(029_07): update to v1.5.1 behaviour for isActive (cannot be null) --- .../Subscription/UpdateSubscription/029_07.robot | 7 ++----- .../subscription-isActive-null-update-sample.json | 11 ----------- .../subscription-isActive-update-sample.json | 9 +-------- 3 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 data/subscriptions/fragments/subscription-isActive-null-update-sample.json diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index 0006ebd5..5833a49c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" +Documentation Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -11,9 +11,6 @@ Suite Teardown Delete Initial Subscriptions ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json [Tags] sub-update 5_8_2 -ActiveNull subscriptions/fragments/subscription-isActive-null-update-sample.json - [Tags] sub-update 5_8_2 - *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld @@ -21,7 +18,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample *** Keywords *** Activate Paused Subscription With isActive Member [Arguments] ${subscription_update_fragment_file_path} - [Documentation] Check that you can update a subscription: If isActive is equal to true or null and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + [Documentation] Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/data/subscriptions/fragments/subscription-isActive-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-update-sample.json deleted file mode 100644 index 95e24778..00000000 --- a/data/subscriptions/fragments/subscription-isActive-null-update-sample.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type":"Subscription", - "isActive": null, - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-update-sample.json b/data/subscriptions/fragments/subscription-isActive-update-sample.json index f8305c0c..8672d20d 100644 --- a/data/subscriptions/fragments/subscription-isActive-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-update-sample.json @@ -1,11 +1,4 @@ { "type":"Subscription", - "isActive": false, - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } + "isActive": true } \ No newline at end of file -- GitLab From 526015c1b07717cc2874ba9476f719c10975da7c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 08:53:39 +0100 Subject: [PATCH 266/442] fix(029_08): update to v1.5.1 behaviour for isActive and expiresAt (cannot be null) --- .../Subscription/UpdateSubscription/029_08.robot | 16 ++-------------- .../subscription-expiresAt-update-sample.json | 9 +-------- ...on-isActive-expiresAt-null-update-sample.json | 12 ------------ ...ription-isActive-expiresAt-update-sample.json | 9 +-------- ...Active-null-expiresAt-null-update-sample.json | 12 ------------ ...on-isActive-null-expiresAt-update-sample.json | 12 ------------ 6 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json delete mode 100644 data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json delete mode 100644 data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index 0946108b..aa0b67ee 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" +Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -8,22 +8,10 @@ Suite Setup Setup Initial Subscriptions Suite Teardown Delete Initial Subscriptions *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrueExpiresAtNull - subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json - [Tags] sub-update 5_8_2 - ActiveTrueExpiresAt subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json [Tags] sub-update 5_8_2 -ActiveNullExpiresAtNull - subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json - [Tags] sub-update 5_8_2 - -ActiveNullExpiresAt - subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json - [Tags] sub-update 5_8_2 - *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld @@ -31,7 +19,7 @@ ${subscription_payload_file_path}= subscriptions/subscription-inactive-sample *** Keywords *** Activate Paused Subscription With isActive And ExpiresAt Members [Arguments] ${subscription_update_fragment_file_path} - [Documentation] Check that you can update a subcription: If isActive is equal to true or null and expiresAt is null or corresponds to a DateTime in the future, then status shall be updated to "active" + [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/data/subscriptions/fragments/subscription-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json index f2a5c090..9ccbe330 100644 --- a/data/subscriptions/fragments/subscription-expiresAt-update-sample.json +++ b/data/subscriptions/fragments/subscription-expiresAt-update-sample.json @@ -1,11 +1,4 @@ { "type":"Subscription", - "expiresAt": "2020-08-01T22:07:00Z", - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } + "expiresAt": "2020-08-01T22:07:00Z" } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json deleted file mode 100644 index 7680219d..00000000 --- a/data/subscriptions/fragments/subscription-isActive-expiresAt-null-update-sample.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type":"Subscription", - "isActive": true, - "expiresAt": null, - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json index dfe8088f..17b6ed74 100644 --- a/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json +++ b/data/subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json @@ -1,12 +1,5 @@ { "type":"Subscription", "isActive": true, - "expiresAt": "2030-08-01T22:07:00Z", - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } + "expiresAt": "2030-08-01T22:07:00Z" } \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json deleted file mode 100644 index 7e55e792..00000000 --- a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-null-update-sample.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type":"Subscription", - "isActive": null, - "expiresAt": null, - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json b/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json deleted file mode 100644 index 4b240e94..00000000 --- a/data/subscriptions/fragments/subscription-isActive-null-expiresAt-update-sample.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type":"Subscription", - "isActive": null, - "expiresAt": "2030-08-01T22:07:00Z", - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file -- GitLab From 67c9bbcbf76ddbe672e614c6949a5213e3e8b481 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 08:59:11 +0100 Subject: [PATCH 267/442] fix(029_09): fix payload used to update the subscription --- .../Subscription/UpdateSubscription/029_07.robot | 2 +- .../Subscription/UpdateSubscription/029_09.robot | 2 +- .../fragments/subscription-isActive-false-update-sample.json | 4 ++++ ...ple.json => subscription-isActive-true-update-sample.json} | 0 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 data/subscriptions/fragments/subscription-isActive-false-update-sample.json rename data/subscriptions/fragments/{subscription-isActive-update-sample.json => subscription-isActive-true-update-sample.json} (100%) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index 5833a49c..babf73b2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -8,7 +8,7 @@ Suite Setup Setup Initial Subscriptions Suite Teardown Delete Initial Subscriptions *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrue subscriptions/fragments/subscription-isActive-update-sample.json +ActiveTrue subscriptions/fragments/subscription-isActive-true-update-sample.json [Tags] sub-update 5_8_2 *** Variable *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 4b84ef05..51ef9d3f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-update-sample.json +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-false-update-sample.json *** Test Case *** Update Subscription Status To Paused diff --git a/data/subscriptions/fragments/subscription-isActive-false-update-sample.json b/data/subscriptions/fragments/subscription-isActive-false-update-sample.json new file mode 100644 index 00000000..c5c686bc --- /dev/null +++ b/data/subscriptions/fragments/subscription-isActive-false-update-sample.json @@ -0,0 +1,4 @@ +{ + "type":"Subscription", + "isActive": false +} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-isActive-update-sample.json b/data/subscriptions/fragments/subscription-isActive-true-update-sample.json similarity index 100% rename from data/subscriptions/fragments/subscription-isActive-update-sample.json rename to data/subscriptions/fragments/subscription-isActive-true-update-sample.json -- GitLab From aa17986b2f70aa8bd9fcb7e2a060d9ee64a84789 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 09:26:14 +0100 Subject: [PATCH 268/442] fix(029_10): make the subscription expire before updating its expiration date --- .../Subscription/UpdateSubscription/029_10.robot | 15 ++++++++++----- ...bscription-expiresAt-future-update-sample.json | 9 +-------- resources/ApiUtils.resource | 11 +++++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index b359b990..050ff8c7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" +Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -8,15 +8,20 @@ Suite Teardown Delete Initial Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json *** Test Case *** Activate Expired Subscription - [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future or is null, then status shall be updated to "active", if and only if the previous value of status was "expired" + [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" [Tags] sub-update 5_8_2 - # Update subscription to expired - Update Subscription ${subscription_id} subscriptions/fragments/subscription-expiresAt-update-sample.json ${CONTENT_TYPE_JSON} + # Update subscription to expire in 5 seconds + ${now} = Get Current Date time_zone=UTC + ${in_5_seconds} = Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ + ${update_template_fragment}= Load Json From File ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json + ${update_fragment}= Update Value To Json ${update_template_fragment} $..expiresAt ${in_5_seconds} + Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} + Sleep 10s Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json index 6fde92ed..0e75ce56 100644 --- a/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json +++ b/data/subscriptions/fragments/subscription-expiresAt-future-update-sample.json @@ -1,11 +1,4 @@ { "type":"Subscription", - "expiresAt": "2030-08-01T22:07:00Z", - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } + "expiresAt": "2030-08-01T22:07:00Z" } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5b846cf6..55243114 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -721,6 +721,17 @@ Update Subscription Set Test Variable ${response} [return] ${response} +Update Subscription With Payload + [Arguments] ${subscription_id} ${payload} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${payload} headers=${headers} + Output request + Output response + Set Test Variable ${response} + [return] ${response} + Delete Subscription [Arguments] ${subscription_id} ${response}= DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} -- GitLab From c57b7fb38dd4b9b7a9218f4bf844811ba738bd94 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 10:02:20 +0100 Subject: [PATCH 269/442] fix(046_03): name attribute is expected expanded (no longer in core context) --- .../ContextInformation/Subscription/Notification/046_03.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 538c7d11..84effce0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -43,7 +43,7 @@ After Test *** Test Case *** Check that a notification is sent with all entities - [Documentation] A notification with all all subscribed Entities will be included if query or geoquery are not defined. + [Documentation] A notification with all subscribed Entities will be included if query or geoquery are not defined. [Tags] sub-notification 5_11_7 046_03 Add Initial Entity @@ -56,7 +56,7 @@ Check that a notification is sent with all entities Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] + Should be Equal Eiffel Tower ${notification}[data][0][https://ngsi-ld-test-suite/context#name][value] -- GitLab From 7d47d6987dcfa6df315479def160b9ac2677071a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 10:02:58 +0100 Subject: [PATCH 270/442] fix(046_05): fix expected value in notification payload --- .../ContextInformation/Subscription/Notification/046_05.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 918ce467..183ad992 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -58,5 +58,5 @@ Check that a notification is sent with all entities Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' + Should be True '${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5' Should be Equal Eiffel Tower ${notification}[data][0][name][value] -- GitLab From 5da884138082b069cbc5168f6c245bbafff8e8b3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 11:22:44 +0100 Subject: [PATCH 271/442] fix(046_06): mismatch between subscription and CSR subscription --- .../Subscription/Notification/046_06.robot | 29 ++++++++++++------- ...iption-building-entities-active-query.json | 18 ------------ ...tion-building-entities-active-query.jsonld | 22 ++++++++++++++ resources/NotificationUtils.resource | 26 ----------------- 4 files changed, 40 insertions(+), 55 deletions(-) delete mode 100644 data/subscriptions/subscription-building-entities-active-query.json create mode 100644 data/subscriptions/subscription-building-entities-active-query.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 0c732675..871e0bcc 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -1,37 +1,44 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions +Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Suite Setup Setup Server And Subscriptions +Suite Teardown Delete Server And Subscriptions *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.json +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-location-attribute.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify *** Keywords *** -Setup Initial Subscriptions +Setup Server And Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -Delete Initial Subscriptions +Delete Server And Subscriptions Delete Subscription ${subscription_id} + Stop Local Server *** Test Case *** -Check that a notification is sent with all entities with matching context source - [Documentation] only the subscribed Entities whose origin Context Source matches the referred filter shall be included. +Check that a notification is sent with all matching entities + [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. [Tags] sub-notification 5_11_7 046_06 - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Wait for subscription notification and validate it ${subscription_id} ${entity_building} timeout=${5} + ${notification}= Wait for notification timeout=${10} + + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] diff --git a/data/subscriptions/subscription-building-entities-active-query.json b/data/subscriptions/subscription-building-entities-active-query.json deleted file mode 100644 index 88bcf6af..00000000 --- a/data/subscriptions/subscription-building-entities-active-query.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type":"Subscription", - "isActive": true, - "expiresAt": null, - "entities":[ - { - "type":"Building" - } - ], - "q":"name=\"Eifel Tower\"", - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-query.jsonld b/data/subscriptions/subscription-building-entities-active-query.jsonld new file mode 100644 index 00000000..423a8294 --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-query.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "entities":[ + { + "type":"Building" + } + ], + "watchedAttributes": ["name"], + "q":"name==\"Eiffel Tower\"", + "notification":{ + "format":"keyValues", + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 8d0c0d92..f12791b9 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -62,32 +62,6 @@ Wait for notification and validate it # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} -Wait for subscription notification and validate it - [Arguments] ${expected_subscription_id} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} ${expected_notification_type}=${notification_type} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 200 - - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json - ${notification_data_length}= Get length ${notification}[data] - ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} - - log ${notification} - Should Be Equal ${notification}[type] ${expected_notification_type} - Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} - ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} - Should Be True ${is_date} or ${is_date_with_millis} - ${index}= Set Variable 0 - - # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all - Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} - [return] ${notification} - Wait for no notification [Arguments] ${timeout}=${5} #HTTP server receives it and checks incoming request for correctness -- GitLab From d69fb5d2124ca17cec853a05ce20b4cb00707f3b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 14:50:47 +0100 Subject: [PATCH 272/442] fix(046_02): check on expanded name attribute (no longer in the core context) --- .../ContextInformation/Subscription/Notification/046_02.robot | 2 +- .../subscriptions/subscription-timeInterval-sample-query.jsonld | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 8b87d793..a72dce40 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -61,7 +61,7 @@ Check that a notification is sent on the timeInterval Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] + Should be Equal Eiffel Tower ${notification}[data][0][https://ngsi-ld-test-suite/context#name][value] diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index 0f15abf7..c6e15605 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -7,7 +7,6 @@ "type":"Building" } ], - "q": "name==\"Eiffel%20Tower\"", "notification":{ "endpoint":{ "uri":"http://my.endpoint.org/notify", -- GitLab From ea8dd4ca84793e7af9ce00edfa72ae7474b90bc1 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 15:21:47 +0100 Subject: [PATCH 273/442] fix(046_08): keyValues format and expectations --- .../Subscription/Notification/046_08.robot | 16 +++++++++------- .../subscription-building-entities-active.jsonld | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 189ec830..a9fbdda9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -48,7 +48,7 @@ After Test *** Test Case *** Check that a notification is sent with all attributes [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included - [Tags] sub-notification 5_11_7 046_08_01 + [Tags] sub-notification 5_8_6 046_08_01 Add Initial Entity Setup Initial Subscriptions @@ -57,6 +57,7 @@ Check that a notification is sent with all attributes ${notification}= Wait for notification ${5} Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -69,7 +70,7 @@ Check that a notification is sent with all attributes Check that a notification is sent with all attributes in simplified format [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided - [Tags] sub-notification 5_11_7 046_08_02 + [Tags] sub-notification 5_8_6 046_08_02 Add Initial Entity ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -82,12 +83,13 @@ Check that a notification is sent with all attributes in simplified format Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} - ${notification} Wait for notification - ${list_count}= Count Values In List ${notification} - Should Not Be Equal ${list_count} 0 - Should Be Equal ${notification}[0][id] ${entity_id} + + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should Be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal Eiffel Tower ${notification}[data][0][name] [Teardown] Delete Fixture Data diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld index 210525fc..705456a0 100644 --- a/data/subscriptions/subscription-building-entities-active.jsonld +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -8,6 +8,7 @@ } ], "notification":{ + "format": "normalized", "endpoint":{ "uri":"http://my.endpoint.org/notify", "accept":"application/json" -- GitLab From fcd907751cb721be1f53f45f26733db386e3506a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 17 Dec 2022 15:31:33 +0100 Subject: [PATCH 274/442] fix(046_11): timesSent must be checked on the subscription, not the notification --- .../Subscription/Notification/046_11.robot | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index b678ec07..1e941ef4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -48,7 +48,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} *** Test Cases *** -Check that TimesSent is increased by one +Check that timesSent is increased by one [Documentation] The notification.timesSent member shall be incremented by one. [Tags] sub-notification 5_11_7 046_11 @@ -60,7 +60,10 @@ Check that TimesSent is increased by one ${notification}= Wait for notification timeout=${10} Output ${notification} - Dictionary Should Contain Key ${notification} timesSent - Should be True '${notification}[timesSent] 1 + + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + + Dictionary Should Contain Key ${response}[body][notification] timesSent + Should Be Equal ${1} ${response}[body][notification][timesSent] -- GitLab From 0065ff510050b07ec3d912cf8f0d447911698761 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 18 Dec 2022 09:05:18 +0100 Subject: [PATCH 275/442] fix(046_XX): tests checking status of notifications --- .../Subscription/Notification/046_11.robot | 4 +- .../Subscription/Notification/046_12.robot | 23 ++++-- .../Subscription/Notification/046_13.robot | 47 ++++++++---- .../Subscription/Notification/046_14.robot | 73 +++++++++++++------ .../Subscription/Notification/046_15.robot | 69 ------------------ 5 files changed, 101 insertions(+), 115 deletions(-) delete mode 100644 TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 1e941ef4..50cd066e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -57,9 +57,7 @@ Check that timesSent is increased by one Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification}= Wait for notification timeout=${10} - - Output ${notification} + Wait for notification timeout=${10} Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 346324ec..3f2a4935 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -14,7 +14,7 @@ Suite Teardown After Test ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-no-attributes.jsonld +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify @@ -47,7 +47,7 @@ Delete Initial Entity *** Test Cases *** Check that lastNotification is updated - [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. + [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. [Tags] sub-notification 5_11_7 046_12 Add Initial Entity @@ -55,12 +55,23 @@ Check that lastNotification is updated Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification}= Wait for notification timeout=${10} + Wait for notification timeout=${10} - Dictionary Should Contain Key ${notification} lastNotification + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - ${is_date}= Is Date ${notification}[lastNotification] ${date_format} - ${is_date_with_millis}= Is Date ${notification}[lastNotification] ${date_format_with_millis} + ${notification_info}= Get Value From Json ${response} $.body.notification + Output ${notification_info} + + Dictionary Should Contain Key ${notification_info}[0] status + Should Be Equal ok ${notification_info}[0][status] + + Dictionary Should Contain Key ${notification_info}[0] lastNotification + ${is_date}= Is Date ${notification_info}[0][lastNotification] ${date_format} + ${is_date_with_millis}= Is Date ${notification_info}[0][lastNotification] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} + Dictionary Should Contain Key ${notification_info}[0] lastSuccess + ${is_date}= Is Date ${notification_info}[0][lastSuccess] ${date_format} + ${is_date_with_millis}= Is Date ${notification_info}[0][lastSuccess] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index 75c3d71b..aa250ef3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -1,45 +1,64 @@ *** Settings *** -Documentation The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. - +Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource - -Suite Setup Setup Initial Subscription -Suite Teardown Delete Initial Subscription +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld *** Test Case *** -Check that a notification is only sent if statis is active - [Documentation] The notification.lastNotification member shall be updated with a timestamp representing the current date and time. This test will check the format. +Check that lastFailure and status are updated if a notification could not be sent + [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed [Tags] sub-notification 5_11_7 046_13 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} @{expected_notification_data_entities}= Create List Building Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for redirected request + Sleep 10s + + Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + + ${notification_info}= Get Value From Json ${response} $.body.notification + Output ${notification_info} - @{expected_notification_additional_members}= Create List lastNotification lastSuccess - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} - + Dictionary Should Contain Key ${notification_info}[0] status + Should Be Equal failed ${notification_info}[0][status] + + Dictionary Should Contain Key ${notification_info}[0] lastFailure + ${is_date}= Is Date ${notification_info}[0][lastFailure] ${date_format} + ${is_date_with_millis}= Is Date ${notification_info}[0][lastFailure] ${date_format_with_millis} + Should Be True ${is_date} or ${is_date_with_millis} *** Keywords *** Setup Initial Subscription - Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscription - Stop Local Server Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +Before Test + Setup Initial Subscription + Add Initial Entity +After Test + Delete Initial Subscription + Delete Initial Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 81b2b8a7..c36c1eaa 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -1,42 +1,69 @@ *** Settings *** -Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 + + Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource -Suite Setup Setup Initial Subscription -Suite Teardown Delete Initial Subscription + +Suite Setup Before Test +Suite Teardown After Test *** Variable *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path}= subscriptions/subscription-building-entities-accept-jsonld.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld ${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} -*** Test Case *** -Check that a notification is only sent if statis is active - [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time., Update notification.status to "failed +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} + +*** Test Cases *** +Check that a notification is sent as JSON-LD + [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' [Tags] sub-notification 5_11_7 046_14 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - @{expected_notification_data_entities}= Create List Building + Add Initial Entity + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Wait for redirected failed request + Wait For Request timeout=${10} + Reply By 200 - @{expected_notification_additional_members}= Create List lastNotification lastFailure - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + ${notification_headers} = Get Request Headers + Dictionary Should Not Contain Key ${notification_headers} Link -*** Keywords *** -Setup Initial Subscription - Start Local Server - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} - -Delete Initial Subscription - Stop Local Server - Delete Subscription ${subscription_id} + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification} Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Contain Key ${notification}[data][0] @context diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot deleted file mode 100644 index 8db56cb0..00000000 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_15.robot +++ /dev/null @@ -1,69 +0,0 @@ -*** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 - - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource - -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-accept-jsonld.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify - -*** Keywords *** -Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} - -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} - -After Test - Delete Initial Subscriptions - Delete Initial Entity - Stop Local Server - -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - -Delete Initial Entity - Delete Entity by Id ${entity_id} - -*** Test Cases *** -Check that a notification is sent as JSON-LD - [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' - [Tags] sub-notification 5_11_7 046_10 - - Add Initial Entity - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait For Request timeout=${10} - Reply By 200 - - ${notification_headers} = Get Request Headers - Dictionary Should Not Contain Key ${notification_headers} Link - - ${notification_payload}= Get Request Body - # json.loads parses the payload as json. It fails if the payload is malformed - ${notification} Evaluate json.loads('''${notification_payload}''') json - Dictionary Should Contain Key ${notification}[data][0] @context - - -- GitLab From 49f49973a443e26d4316ba8462f3a9dd3df255da Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 20 Dec 2022 12:16:40 +0100 Subject: [PATCH 276/442] fix(019_XX): misc errors in invalid expectations and paginated checks --- .../Consumption/Entity/QueryEntities/019_03_02.robot | 2 +- .../Consumption/Entity/QueryEntities/019_03_04.robot | 4 ++-- .../Consumption/Entity/QueryEntities/019_06.robot | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index f80a098a..4e9e3e3d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -9,7 +9,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${building_filename}= building-minimal-sample.jsonld ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${invalid_entity_type_one}= invalid_entity_type_one +${invalid_entity_type_one}= type ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 66f6cea8..db5abf46 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= invalid -${invalid_attribute_two}= invalid +${invalid_attribute_one}= id +${invalid_attribute_two}= type *** Test Cases *** Query several entities based on incorrect attribute names diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index ab1e9a76..7ac6e809 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -7,7 +7,6 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${limit}= 2 @@ -29,7 +28,7 @@ Query entities specifying a maximum number of results ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing Number Of Entities ${entity_type} ${2} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} *** Keywords *** -- GitLab From f47062249b8a5fcb4fde930c9034eaeb9952ece3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 31 Jan 2023 08:57:27 +0100 Subject: [PATCH 277/442] fix(013_03): delete fixture entity in teardown --- .../DeleteEntityAttribute/013_03.robot | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 71a97150..34e3bd8f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -3,7 +3,8 @@ Documentation Check that you cannot delete an attribute from an entity with Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities Test Template Delete Attributes *** Variable *** @@ -26,8 +27,6 @@ Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -35,5 +34,10 @@ Delete Attributes Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} + ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${valid_entity_id} -- GitLab From b2d0ab13dd24fb1f4c9b25619a2c4991f05b5990 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 31 Jan 2023 08:57:46 +0100 Subject: [PATCH 278/442] fix(046_06): delete fixture entity in teardown --- .../ContextInformation/Subscription/Notification/046_06.robot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index 871e0bcc..ed4ca9b7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -22,16 +22,18 @@ Setup Server And Subscriptions Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} Delete Server And Subscriptions Delete Subscription ${subscription_id} + Delete Entity by Id Returning Response ${entity_id} Stop Local Server *** Test Case *** Check that a notification is sent with all matching entities [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. [Tags] sub-notification 5_11_7 046_06 - ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification timeout=${10} -- GitLab From acd639f1bb7c74015b50626ad22eb5e71df57705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poujol?= <76944966+gpoujol@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:01:44 +0100 Subject: [PATCH 279/442] fix: error of context and mismatch in expectation file (#5) --- .../007_01.robot | 16 ++++--- .../007_02.robot | 2 +- .../016_01.robot | 2 +- ...l-representation-create-expectation.jsonld | 35 +++++++++++++++ ...-create-with-no-context-expectation.jsonld | 39 +++++++++++++++++ ...artial-update-attribute-expectation.jsonld | 43 +++++++++++++++++++ ...l-representation-update-expectation.jsonld | 19 +++++--- ...mporal-representation-update-sample.jsonld | 2 +- 8 files changed, 141 insertions(+), 17 deletions(-) create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 587016b0..21e4a7f4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -8,23 +8,25 @@ Test Template Create Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** FILENAME CONTENT_TYPE +*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE 007_01_01_Create a temporal representation of an entity - vehicle-temporal-representation-sample.jsonld application/ld+json + vehicle-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json 007_01_02_Create a temporal entity with no context - vehicle-temporal-representation-without-context-sample.jsonld application/json + vehicle-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json *** Keywords *** Create Temporal Entity - [Arguments] ${filename} ${content_type} + [Arguments] ${filename} ${expectation_filename} ${content_type} [Documentation] Check that you can create a temporal representation of an entity [Tags] te-create 5_6_11 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} Check Response Status Code 201 ${response['status']} ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - ${ignored_attributes}= Create List instanceId @context - Check Created Resource Set To ${created_temporal_entity} ${ignored_attributes} + Run Keyword If '${content_type}'=='application/json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + Run Keyword If '${content_type}'=='application/ld+json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + ${ignored_attributes}= Create List instanceId @context + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Check Created Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 9a70df5b..465aff08 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -27,7 +27,7 @@ Create Temporal Entity From File [Tags] te-create 5_6_11 Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To 400 - Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} Create Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot index f14233c6..9a9f5863 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot @@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld ${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld -${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld +${expectation_filename}= vehicle-temporal-representation-partial-update-attribute-expectation.jsonld ${attributeId}= speed *** Test Cases *** diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld new file mode 100644 index 00000000..482dbec5 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld @@ -0,0 +1,35 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld new file mode 100644 index 00000000..7942162a --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld @@ -0,0 +1,39 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld new file mode 100644 index 00000000..3bde9fea --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld @@ -0,0 +1,43 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"BMW" + } + ], + "speed":[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld index 5fd7bd26..1c2a9147 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld @@ -1,22 +1,22 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], + "brandName":[], "speed":[ { "type":"Property", - "value":129, + "value":121, "observedAt":"2020-09-01T12:03:00Z" }, { "type":"Property", "value":80, "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" } ], "fuelLevel":[ @@ -30,6 +30,11 @@ "value":53, "observedAt":"2020-09-01T13:05:00Z" }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + }, { "type":"Property", "value":40, diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld index 95959ee2..00db6892 100644 --- a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file -- GitLab From 5bd99444747f0b591ed62cbbbd87fd1fb8ad9225 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 8 Feb 2023 14:32:16 +0100 Subject: [PATCH 280/442] fix(046_XX): misuses of context handling, add delays to ensure we get the expected notification --- .../Subscription/Notification/046_01.robot | 3 ++- .../Subscription/Notification/046_02.robot | 14 +++++--------- .../Subscription/Notification/046_03.robot | 5 +++-- .../Subscription/Notification/046_04.robot | 1 + .../Subscription/Notification/046_05.robot | 1 + .../Subscription/Notification/046_08.robot | 1 + .../Subscription/Notification/046_09.robot | 1 + .../Subscription/Notification/046_10.robot | 1 + .../Subscription/Notification/046_11.robot | 1 + .../Subscription/Notification/046_12.robot | 1 + .../Subscription/Notification/046_14.robot | 1 + 11 files changed, 18 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index f92c5c01..dc79f31e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -4,7 +4,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test +Suite Setup Before Test Suite Teardown After Test *** Variable *** @@ -49,6 +49,7 @@ Check that a notification is only sent if status is active [Tags] sub-notification 5_11_7 046_01 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index a72dce40..df35844b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -4,7 +4,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test +Suite Setup Before Test Suite Teardown After Test *** Variable *** @@ -44,10 +44,11 @@ After Test *** Test Case *** Check that a notification is sent on the timeInterval - [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." + [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. [Tags] sub-notification 5_11_7 046_02 Add Initial Entity + Sleep 1s Setup Initial Subscriptions ${notification}= Wait for notification timeout=${15} @@ -60,10 +61,5 @@ Check that a notification is sent on the timeInterval Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][https://ngsi-ld-test-suite/context#name][value] - - - - - + Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index 84effce0..cb761040 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -47,6 +47,7 @@ Check that a notification is sent with all entities [Tags] sub-notification 5_11_7 046_03 Add Initial Entity + Sleep 1s Setup Initial Subscriptions ${notification}= Wait for notification ${5} @@ -55,8 +56,8 @@ Check that a notification is sent with all entities Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4.0' or '${notification}[data][0][https://ngsi-ld-test-suite/context#airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][https://ngsi-ld-test-suite/context#name][value] + Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index c876616b..a027eb05 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -49,6 +49,7 @@ Check that a notification is sent with all entities [Tags] sub-notification 5_11_7 046_04 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 183ad992..a2e79d68 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -49,6 +49,7 @@ Check that a notification is sent with all entities [Tags] sub-notification 5_11_7 046_05 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index a9fbdda9..365dc57f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -51,6 +51,7 @@ Check that a notification is sent with all attributes [Tags] sub-notification 5_8_6 046_08_01 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index a9480193..52c9357c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -51,6 +51,7 @@ Check that a notification is sent to the endpoint [Tags] sub-notification 5_11_7 046_09 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 7ca7e30e..06185e8d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -52,6 +52,7 @@ Check that a notification is JSON [Tags] sub-notification 5_11_7 046_10 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 50cd066e..f17154bc 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -53,6 +53,7 @@ Check that timesSent is increased by one [Tags] sub-notification 5_11_7 046_11 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 3f2a4935..d32c1f9e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -51,6 +51,7 @@ Check that lastNotification is updated [Tags] sub-notification 5_11_7 046_12 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index c36c1eaa..1bfef38a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -51,6 +51,7 @@ Check that a notification is sent as JSON-LD [Tags] sub-notification 5_11_7 046_14 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} -- GitLab From 3937a1f0181e13fbfdf665e712ccd80e1680a712 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 8 Feb 2023 14:41:28 +0100 Subject: [PATCH 281/442] fix(046_07): use default context to illustrate term to URI expansion --- .../Subscription/Notification/046_07.robot | 15 +++++++++----- ...ing-entities-active-default-context.jsonld | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 data/subscriptions/subscription-building-entities-active-default-context.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index c6fba8b5..7409fd3a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -12,6 +12,7 @@ Suite Teardown After Test ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld ${subscription_payload_file_path_watchedAttributes}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +${subscription_payload_file_path_default_context}= subscriptions/subscription-building-entities-active-default-context.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify ${entity_building_filepath}= building-simple-attributes-sample.jsonld @@ -52,8 +53,9 @@ After Test *** Test Cases *** Check notification structure [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above - [Tags] sub-notification 5_11_7 046_07_01 + [Tags] sub-notification 5_8_6 046_07_01 Add Initial Entity + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -67,8 +69,9 @@ Check notification structure Check correct attributes are included [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). - [Tags] sub-notification 5_11_7 046_07_02 + [Tags] sub-notification 5_8_6 046_07_02 Add Initial Entity + Sleep 1s Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} @@ -83,12 +86,14 @@ Check correct attributes are included Check URI expansion is observed [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). - [Tags] sub-notification 5_11_7 046_07_03 + [Tags] sub-notification 5_8_6 046_07_03 Add Initial Entity - Setup Initial Subscriptions + Sleep 1s + Setup Initial Subscriptions ${subscription_payload_file_path_default_context} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - ${notification} Wait for notification + ${notification} Wait for notification + Output ${notification} Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} diff --git a/data/subscriptions/subscription-building-entities-active-default-context.jsonld b/data/subscriptions/subscription-building-entities-active-default-context.jsonld new file mode 100644 index 00000000..016724ef --- /dev/null +++ b/data/subscriptions/subscription-building-entities-active-default-context.jsonld @@ -0,0 +1,20 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "isActive": true, + "entities":[ + { + "type":"https://ngsi-ld-test-suite/context#Building" + } + ], + "notification":{ + "attributes": ["https://ngsi-ld-test-suite/context#airQualityLevel"], + "endpoint":{ + "uri":"http://my.endpoint.org/notify", + "accept":"application/json" + } + }, + "@context":[ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} \ No newline at end of file -- GitLab From 2a707f8fc753b4ef093cdaab60cc4c954d5c39a9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 14 Feb 2023 16:01:10 +0100 Subject: [PATCH 282/442] conf: default conf when running local to the CB --- resources/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/variables.py b/resources/variables.py index b055b5a0..4f72b3dd 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -4,7 +4,7 @@ def get_variables(arg=None): 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', 'notification_server_host': '0.0.0.0', 'notification_server_port': 8085, - 'send_notification_server_host': 'host.docker.internal', + 'send_notification_server_host': '0.0.0.0', 'send_notification_server_port': 8085, 'context_source_host': '0.0.0.0', 'context_source_port': 8086 -- GitLab From 3fd66e8690d2edd61abde6ff11b252fe58532e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Poujol?= <76944966+gpoujol@users.noreply.github.com> Date: Thu, 16 Feb 2023 08:51:37 +0100 Subject: [PATCH 283/442] fix/remove attribute with no temporal property in temporal request (#7) --- .../007_01.robot | 6 +-- .../008_01.robot | 2 +- ...l-representation-create-expectation.jsonld | 1 - ...-create-with-no-context-expectation.jsonld | 1 - ...l-representation-update-expectation.jsonld | 1 - ...eate-temporal-representation-sample.jsonld | 37 ++++++++++++++++++ ...presentation-without-context-sample.jsonld | 38 +++++++++++++++++++ ...mporal-representation-update-sample.jsonld | 6 --- 8 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld create mode 100644 data/temporalEntities/vehicle-create-temporal-representation-without-context-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 21e4a7f4..caa98220 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -8,12 +8,12 @@ Test Template Create Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE +*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE 007_01_01_Create a temporal representation of an entity - vehicle-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json + vehicle-create-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json 007_01_02_Create a temporal entity with no context - vehicle-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json + vehicle-create-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json *** Keywords *** Create Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 0ac689c7..9285749c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld +${filename}= vehicle-create-temporal-representation-sample.jsonld ${update_filename}= vehicle-temporal-representation-update-sample.jsonld ${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld index 482dbec5..22b52c9f 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld @@ -1,7 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld index 7942162a..b50a1eab 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-create-with-no-context-expectation.jsonld @@ -1,7 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld index 1c2a9147..e2bf75b9 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld @@ -1,7 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld new file mode 100644 index 00000000..a151d686 --- /dev/null +++ b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld @@ -0,0 +1,37 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z", + "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-create-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/vehicle-create-temporal-representation-without-context-sample.jsonld new file mode 100644 index 00000000..b50a1eab --- /dev/null +++ b/data/temporalEntities/vehicle-create-temporal-representation-without-context-sample.jsonld @@ -0,0 +1,38 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld index 00db6892..735f013d 100644 --- a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"Volvo" - } - ], "speed":[ { "type":"Property", -- GitLab From 21a1d47f01fa27f023ace89f7c07d2bee1ae12ed Mon Sep 17 00:00:00 2001 From: poujol Date: Thu, 9 Mar 2023 08:14:56 +0000 Subject: [PATCH 284/442] chore: use @context hosted in the source code --- ...on-building-and-bus-entities-sample.jsonld | 2 +- ...ce-registration-bus-entities-sample.jsonld | 2 +- ...tration-detailed-information-sample.jsonld | 2 +- ...-source-registration-invalid-sample.jsonld | 2 +- ...gistration-invalid-structure-sample.jsonld | 2 +- ...source-registration-location-sample.jsonld | 2 +- ...istration-managementInterval-sample.jsonld | 2 +- ...xt-source-registration-no-id-sample.jsonld | 2 +- ...stration-observationInterval-sample.jsonld | 2 +- ...registration-past-expiration-sample.jsonld | 2 +- .../context-source-registration-sample.jsonld | 2 +- ...t-source-registration-simple-sample.jsonld | 2 +- ...egistration-vehicle-entities-sample.jsonld | 2 +- ...registration-with-expiration-sample.jsonld | 2 +- ...-only-properties-information-sample.jsonld | 2 +- ...-registration-different-type-sample.jsonld | 2 +- ...tion-empty-watchedAttributes-sample.jsonld | 2 +- .../subscription-expired-sample.jsonld | 2 +- .../subscription-expiresAt-sample.jsonld | 2 +- .../subscription-geoQ-sample.jsonld | 2 +- ...ion-geoQ-without-geoproperty-sample.jsonld | 2 +- .../subscription-inactive-sample.jsonld | 2 +- .../subscription-invalid-query-sample.jsonld | 2 +- .../subscription-invalid-type-sample.jsonld | 2 +- .../subscription-sample.jsonld | 2 +- ...cription-temporalQ-createdAt-sample.jsonld | 2 +- ...ription-temporalQ-modifiedAt-sample.jsonld | 2 +- ...ription-temporalQ-observedAt-sample.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 2 +- ...ription-unreachable-endpoint-sample.jsonld | 2 +- ...bscription-watchedAttributes-sample.jsonld | 2 +- ...ription-without-notification-sample.jsonld | 2 +- .../batch/invalid-json-ld-sample.jsonld | 2 +- .../entities/batch/invalid-json-sample.jsonld | 2 +- .../building-location-attribute-sample.jsonld | 2 +- .../building-location-attribute.jsonld | 2 +- data/entities/building-minimal-sample.jsonld | 2 +- data/entities/building-minimal.jsonld | 2 +- data/entities/building-no-attributes.jsonld | 2 +- ...ing-relationship-of-property-sample.jsonld | 2 +- .../building-relationship-sample.jsonld | 2 +- data/entities/building-relationship.jsonld | 2 +- .../building-simple-attributes-sample.jsonld | 2 +- ...-delete-datasetid-speed-expectation.jsonld | 2 +- ...le-delete-default-speed-expectation.jsonld | 2 +- ...-delete-deleteall-speed-expectation.jsonld | 2 +- ...vehicle-isparked-update-expectation.jsonld | 2 +- ...ehicle-multi-attributes-expectation.jsonld | 2 +- .../vehicle-speed-appended-expectation.jsonld | 2 +- ...eed-different-datasetid-expectation.jsonld | 2 +- ...hicle-update-attributes-expectation.jsonld | 2 +- ...te-datasetid-attributes-expectation.jsonld | 2 +- .../vehicle-update-speed-expectation.jsonld | 2 +- .../airQualityLevel-fragment.jsonld | 2 +- .../fragmentEntities/invalid-fragment.jsonld | 2 +- .../vehicle-attribute-to-add-fragment.jsonld | 2 +- .../vehicle-brandname-fragment.jsonld | 2 +- .../vehicle-isparked-fragment.jsonld | 2 +- .../vehicle-new-attribute-fragment.jsonld | 2 +- ...-speed-different-datasetid-fragment.jsonld | 2 +- ...l-datasetid-different-type-fragment.jsonld | 2 +- ...icle-speed-equal-datasetid-fragment.jsonld | 2 +- ...le-speed-invalid-datasetid-fragment.jsonld | 2 +- ...cle-speed-two-datasetid-01-fragment.jsonld | 2 +- ...cle-speed-two-datasetid-02-fragment.jsonld | 2 +- ...cle-speed-two-datasetid-03-fragment.jsonld | 2 +- .../vehicle-speed-wrong-name-fragment.jsonld | 2 +- data/entities/invalid-json-sample.jsonld | 2 +- .../parking-simple-attributes-sample.jsonld | 2 +- .../vehicle-simple-attributes-sample.jsonld | 2 +- .../vehicle-speed-two-datasetid-sample.jsonld | 2 +- ...cle-two-datasetid-attributes-sample.jsonld | 2 +- .../subscription-028-01-expectation.jsonld | 2 +- ...ption-vehicle-expanded-types-sample.jsonld | 2 +- .../subscription-vehicle-sample.jsonld | 2 +- ...ion-building-entities-accept-jsonld.jsonld | 2 +- ...tion-building-entities-active-query.jsonld | 2 +- ...ties-active-watchedAttributes-query.jsonld | 2 +- ...g-entities-active-watchedAttributes.jsonld | 2 +- ...bscription-building-entities-active.jsonld | 2 +- ...scription-building-entities-default.jsonld | 2 +- .../subscription-inactive-sample.jsonld | 2 +- .../subscription-invalid-json-sample.jsonld | 2 +- data/subscriptions/subscription-sample.jsonld | 2 +- ...scription-timeInterval-sample-query.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 2 +- ...bscription-watchedAttributes-sample.jsonld | 2 +- ...-bus-temporal-representation-sample.jsonld | 2 +- ...sentation-multiple-instances-sample.jsonld | 2 +- ...cule-temporal-representation-sample.jsonld | 2 +- ...cule-temporal-representation-sample.jsonld | 2 +- ...representation-with-location-sample.jsonld | 2 +- .../entity-operations-after-query.jsonld | 2 +- .../entity-operations-before-query.jsonld | 2 +- ...tion-delete-speed-instanceid-sample.jsonld | 2 +- ...le-temporal-representation-fragment.jsonld | 2 +- ...epresentation-invalid-json-fragment.jsonld | 2 +- ...eate-temporal-representation-sample.jsonld | 2 +- ...fied-temporal-representation-sample.jsonld | 2 +- ...icle-temporal-representation-sample.jsonld | 2 +- ...mporal-representation-update-sample.jsonld | 2 +- resources/ngsi-ld-test-suite-context.jsonld | 21 +++++++++++++------ resources/variables.py | 2 +- 103 files changed, 117 insertions(+), 108 deletions(-) diff --git a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld index d28b41ee..595a6bae 100644 --- a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld @@ -19,6 +19,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld index ae6cd094..28b2672a 100644 --- a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld @@ -12,6 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld index d9a9649d..b4826ab6 100644 --- a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld @@ -14,6 +14,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld index 1c01a4b4..5eb0def1 100644 --- a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld index 28176c46..a05b8ef5 100644 --- a/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", "type": "ContextSourceRegistration", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld index bc8a7d24..3f1faa32 100644 --- a/data/csourceRegistrations/context-source-registration-location-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -19,6 +19,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld index cd35ed5b..8ea742e0 100644 --- a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld @@ -16,6 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld index 04ed167a..a64c29ea 100644 --- a/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld @@ -37,6 +37,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld index b6bbf43b..f97a489b 100644 --- a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld @@ -16,6 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld index 4f449784..182acfd5 100644 --- a/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": " 2018-11-29T14:53:15Z", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld index 4f37b16e..42364aee 100644 --- a/data/csourceRegistrations/context-source-registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -38,6 +38,6 @@ "startAt": "2017-11-29T14:53:15Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-simple-sample.jsonld b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld index 096c701b..d8676411 100644 --- a/data/csourceRegistrations/context-source-registration-simple-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld index 374df635..52d23178 100644 --- a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld @@ -12,6 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld index 3ec95d3b..aae82c14 100644 --- a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": "2025-11-29T14:53:15Z", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld index 302815d0..ab355dda 100644 --- a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld @@ -8,6 +8,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld index d15dfb55..ed1ac079 100644 --- a/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld +++ b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld index fd71c4c4..974c0ec3 100644 --- a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expired-sample.jsonld b/data/csourceSubscriptions/subscription-expired-sample.jsonld index 4f4ff095..d0a82db9 100644 --- a/data/csourceSubscriptions/subscription-expired-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expired-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld index 6d6dfe31..0bcd3fdb 100644 --- a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld index 75b92efe..504d7398 100644 --- a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld @@ -20,6 +20,6 @@ "geoproperty": "location" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld index fce0f6ec..40c3e966 100644 --- a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld @@ -19,6 +19,6 @@ "coordinates":[-8.52,41.2] }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-inactive-sample.jsonld b/data/csourceSubscriptions/subscription-inactive-sample.jsonld index a00ea736..8dc52e55 100644 --- a/data/csourceSubscriptions/subscription-inactive-sample.jsonld +++ b/data/csourceSubscriptions/subscription-inactive-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld index 9c155c72..4822c1fa 100644 --- a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld index e8a08488..fd2286f4 100644 --- a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-sample.jsonld b/data/csourceSubscriptions/subscription-sample.jsonld index fd713519..0c796a64 100644 --- a/data/csourceSubscriptions/subscription-sample.jsonld +++ b/data/csourceSubscriptions/subscription-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld index 1878b634..622bbd72 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "createdAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld index 287dc996..13ac0a57 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "modifiedAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld index dfd410e7..f6cbd80d 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "observedAt" }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld index 15fffffe..dbd99490 100644 --- a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld +++ b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld index 39e5322f..f4919f8b 100644 --- a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +++ b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld index de343a44..6e4ebcc0 100644 --- a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld index 671be89d..aca2a04e 100644 --- a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld +++ b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld @@ -7,6 +7,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/batch/invalid-json-ld-sample.jsonld b/data/entities/batch/invalid-json-ld-sample.jsonld index ec4c5389..41010727 100644 --- a/data/entities/batch/invalid-json-ld-sample.jsonld +++ b/data/entities/batch/invalid-json-ld-sample.jsonld @@ -7,7 +7,7 @@ "value":null }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/batch/invalid-json-sample.jsonld b/data/entities/batch/invalid-json-sample.jsonld index f1a5b876..76027922 100644 --- a/data/entities/batch/invalid-json-sample.jsonld +++ b/data/entities/batch/invalid-json-sample.jsonld @@ -3,7 +3,7 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index 1cda399b..569ead7b 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -17,6 +17,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld index e03c467a..68058d33 100644 --- a/data/entities/building-location-attribute.jsonld +++ b/data/entities/building-location-attribute.jsonld @@ -17,7 +17,7 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld index e49a2c9a..15d052fc 100644 --- a/data/entities/building-minimal-sample.jsonld +++ b/data/entities/building-minimal-sample.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal.jsonld b/data/entities/building-minimal.jsonld index d39157ac..f5ef2a60 100644 --- a/data/entities/building-minimal.jsonld +++ b/data/entities/building-minimal.jsonld @@ -2,7 +2,7 @@ "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-no-attributes.jsonld b/data/entities/building-no-attributes.jsonld index 10c9d65e..99efda91 100644 --- a/data/entities/building-no-attributes.jsonld +++ b/data/entities/building-no-attributes.jsonld @@ -6,6 +6,6 @@ "value": "Eiffel Tower" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 5518b700..57826a72 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -24,6 +24,6 @@ "value": false }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-sample.jsonld b/data/entities/building-relationship-sample.jsonld index 4b34bddb..d649d1ce 100644 --- a/data/entities/building-relationship-sample.jsonld +++ b/data/entities/building-relationship-sample.jsonld @@ -6,6 +6,6 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship.jsonld b/data/entities/building-relationship.jsonld index 34c28e02..3ae799de 100644 --- a/data/entities/building-relationship.jsonld +++ b/data/entities/building-relationship.jsonld @@ -6,7 +6,7 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 49993315..3c0922b5 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -20,6 +20,6 @@ "value": false }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } diff --git a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld index 6d9b6829..99eff6f7 100644 --- a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld @@ -24,6 +24,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld index 98f1b652..195b9698 100644 --- a/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld @@ -26,6 +26,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld index df8c093f..0c6924ba 100644 --- a/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld @@ -16,6 +16,6 @@ "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-isparked-update-expectation.jsonld b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld index 18cc1e9f..21807735 100644 --- a/data/entities/expectations/vehicle-isparked-update-expectation.jsonld +++ b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld index f04f1b36..37a8b2cc 100644 --- a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld index 8822fc80..f49a1396 100644 --- a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld @@ -39,6 +39,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld index 59d405ed..0c7cca5d 100644 --- a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld @@ -48,6 +48,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld index 50d7f264..e3a1d2b7 100644 --- a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld index 23c7abfa..8dce6507 100644 --- a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-speed-expectation.jsonld b/data/entities/expectations/vehicle-update-speed-expectation.jsonld index bb9dc338..546631d3 100644 --- a/data/entities/expectations/vehicle-update-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-speed-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld index 8a02a41b..af683762 100644 --- a/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld +++ b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld @@ -6,6 +6,6 @@ "observedAt": "2020-10-10T16:40:00.000Z" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/invalid-fragment.jsonld b/data/entities/fragmentEntities/invalid-fragment.jsonld index 7fc26d82..2dcd2a7c 100644 --- a/data/entities/fragmentEntities/invalid-fragment.jsonld +++ b/data/entities/fragmentEntities/invalid-fragment.jsonld @@ -13,6 +13,6 @@ "value": "BMW" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld index 62f7c601..246b133a 100644 --- a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld @@ -13,6 +13,6 @@ "value": 23 }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index 8c229718..3a1314c6 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -3,5 +3,5 @@ "type": "Property", "value": "BMW" }, - "@context": "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld index c98cf139..5c834ade 100644 --- a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld @@ -4,6 +4,6 @@ "object": "urn:ngsi-ld:Person:JohnDoe" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } diff --git a/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld index 4ed2fd7b..1396ff7b 100644 --- a/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld @@ -4,6 +4,6 @@ "value": 23 }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld index 42bb70af..3788c6fc 100644 --- a/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld @@ -13,6 +13,6 @@ "value": 23 }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld index fc881731..0f1118c2 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld @@ -2,6 +2,6 @@ "type": "Relationship", "object": "urn:ngsi-ld:Entity:01", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld index 251fc430..8387c231 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld @@ -2,6 +2,6 @@ "value": 56, "datasetId": "urn:ngsi-ld:Property:speedometer", "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld index f25aea7c..7614a4c3 100644 --- a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld @@ -9,6 +9,6 @@ "datasetId": "" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld index 46a8756f..b63e9caa 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld @@ -8,6 +8,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld index 8edd2137..a51b3beb 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld index 016311cf..96efb66b 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld index a5a4be17..fb0fab8a 100644 --- a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld @@ -13,6 +13,6 @@ "value": "BMW" }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/invalid-json-sample.jsonld b/data/entities/invalid-json-sample.jsonld index f1a5b876..76027922 100644 --- a/data/entities/invalid-json-sample.jsonld +++ b/data/entities/invalid-json-sample.jsonld @@ -3,7 +3,7 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld index 982cfb89..45479821 100644 --- a/data/entities/parking-simple-attributes-sample.jsonld +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -30,6 +30,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 0553c272..5615bde9 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-speed-two-datasetid-sample.jsonld b/data/entities/vehicle-speed-two-datasetid-sample.jsonld index 72f4422b..d04e0a88 100644 --- a/data/entities/vehicle-speed-two-datasetid-sample.jsonld +++ b/data/entities/vehicle-speed-two-datasetid-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 4b45ca83..8f377f0a 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-028-01-expectation.jsonld b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld index 7551d04c..baeb3c87 100644 --- a/data/subscriptions/expectations/subscription-028-01-expectation.jsonld +++ b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld index cfbc8670..0688e6ec 100644 --- a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld index 3176c53e..74d6507b 100644 --- a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld index efa28dbc..9342ee00 100644 --- a/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld +++ b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld @@ -13,6 +13,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-query.jsonld b/data/subscriptions/subscription-building-entities-active-query.jsonld index 423a8294..138bdca2 100644 --- a/data/subscriptions/subscription-building-entities-active-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-query.jsonld @@ -17,6 +17,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 17104acd..91131d8d 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -16,6 +16,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld index c82401eb..c4a90b29 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld index 705456a0..42b9d8b4 100644 --- a/data/subscriptions/subscription-building-entities-active.jsonld +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-default.jsonld b/data/subscriptions/subscription-building-entities-default.jsonld index 213bb9d9..5616568a 100644 --- a/data/subscriptions/subscription-building-entities-default.jsonld +++ b/data/subscriptions/subscription-building-entities-default.jsonld @@ -12,6 +12,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-inactive-sample.jsonld b/data/subscriptions/subscription-inactive-sample.jsonld index a00ea736..8dc52e55 100644 --- a/data/subscriptions/subscription-inactive-sample.jsonld +++ b/data/subscriptions/subscription-inactive-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-invalid-json-sample.jsonld b/data/subscriptions/subscription-invalid-json-sample.jsonld index bf9772f9..b4b58b74 100644 --- a/data/subscriptions/subscription-invalid-json-sample.jsonld +++ b/data/subscriptions/subscription-invalid-json-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index 6af4f401..0c9d8449 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index c6e15605..fc953e4f 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index c6e15605..fc953e4f 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-watchedAttributes-sample.jsonld b/data/subscriptions/subscription-watchedAttributes-sample.jsonld index de343a44..6e4ebcc0 100644 --- a/data/subscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/subscriptions/subscription-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld index 4ce85a57..8b003642 100644 --- a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 0049e966..efd98374 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -177,6 +177,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index e294b218..12773e34 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index 65c4053a..e0149e90 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index 41201040..d4f1a161 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -60,6 +60,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-after-query.jsonld b/data/temporalEntities/entity-operations-after-query.jsonld index c561155c..c4e59b0d 100644 --- a/data/temporalEntities/entity-operations-after-query.jsonld +++ b/data/temporalEntities/entity-operations-after-query.jsonld @@ -3,6 +3,6 @@ "timerel":"after", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-before-query.jsonld b/data/temporalEntities/entity-operations-before-query.jsonld index f4fba3d9..10e9d52e 100644 --- a/data/temporalEntities/entity-operations-before-query.jsonld +++ b/data/temporalEntities/entity-operations-before-query.jsonld @@ -3,6 +3,6 @@ "timerel":"before", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld index 6a3ff6d6..34e8819a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld @@ -33,6 +33,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld index 8a4c0af9..e68302ae 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld @@ -17,6 +17,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld index b7661abf..d076ab8a 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -42,6 +42,6 @@ } ], "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld index a151d686..17873cc3 100644 --- a/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld @@ -32,6 +32,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld index ee96728f..6692234b 100644 --- a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld @@ -16,6 +16,6 @@ ] }, "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 5f049b3e..8fdc0d93 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -38,6 +38,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld index 735f013d..d5fc2ca0 100644 --- a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -36,6 +36,6 @@ } ], "@context":[ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" ] } \ No newline at end of file diff --git a/resources/ngsi-ld-test-suite-context.jsonld b/resources/ngsi-ld-test-suite-context.jsonld index b9f67ea2..c4a5bfbf 100644 --- a/resources/ngsi-ld-test-suite-context.jsonld +++ b/resources/ngsi-ld-test-suite-context.jsonld @@ -1,7 +1,16 @@ { - "@context":{ - "brandName":"https://ngsi-ld-test-suite/context#brandName", - "speed":"https://ngsi-ld-test-suite/context#speed", - "fuelLevel":"https://ngsi-ld-test-suite/context#fuelLevel" - } -} \ No newline at end of file + "@context": { + "Building": "https://ngsi-ld-test-suite/context#Building", + "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", + "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", + "airQualityLevel": "https://ngsi-ld-test-suite/context#airQualityLevel", + "almostFull": "https://ngsi-ld-test-suite/context#almostFull", + "brandName": "https://ngsi-ld-test-suite/context#brandName", + "fuelLevel": "https://ngsi-ld-test-suite/context#fuelLevel", + "name": "https://ngsi-ld-test-suite/context#name", + "source": "https://ngsi-ld-test-suite/context#source", + "speed": "https://ngsi-ld-test-suite/context#speed", + "subCategory": "https://ngsi-ld-test-suite/context#subCategory" + } +} + diff --git a/resources/variables.py b/resources/variables.py index 4f72b3dd..46fae04b 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,7 +1,7 @@ def get_variables(arg=None): variables = { 'url': 'localhost:8080/ngsi-ld/v1', - 'ngsild_test_suite_context': 'https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld', + 'ngsild_test_suite_context': 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld', 'notification_server_host': '0.0.0.0', 'notification_server_port': 8085, 'send_notification_server_host': '0.0.0.0', -- GitLab From 036669d016f171f43318f59df36facb8ddd99c21 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Fri, 10 Mar 2023 15:32:38 +0100 Subject: [PATCH 285/442] chore: add compound context with core context --- ...rce-registration-building-and-bus-entities-sample.jsonld | 2 +- .../context-source-registration-bus-entities-sample.jsonld | 2 +- ...t-source-registration-detailed-information-sample.jsonld | 2 +- .../context-source-registration-invalid-sample.jsonld | 2 +- ...text-source-registration-invalid-structure-sample.jsonld | 2 +- .../context-source-registration-location-sample.jsonld | 2 +- ...ext-source-registration-managementInterval-sample.jsonld | 2 +- .../context-source-registration-no-id-sample.jsonld | 2 +- ...xt-source-registration-observationInterval-sample.jsonld | 2 +- ...ontext-source-registration-past-expiration-sample.jsonld | 2 +- .../context-source-registration-sample.jsonld | 2 +- .../context-source-registration-simple-sample.jsonld | 2 +- ...ntext-source-registration-vehicle-entities-sample.jsonld | 2 +- ...ontext-source-registration-with-expiration-sample.jsonld | 2 +- ...istration-with-only-properties-information-sample.jsonld | 2 +- ...context-source-registration-different-type-sample.jsonld | 2 +- .../subscription-empty-watchedAttributes-sample.jsonld | 2 +- .../csourceSubscriptions/subscription-expired-sample.jsonld | 2 +- .../subscription-expiresAt-sample.jsonld | 2 +- data/csourceSubscriptions/subscription-geoQ-sample.jsonld | 2 +- .../subscription-geoQ-without-geoproperty-sample.jsonld | 2 +- .../subscription-inactive-sample.jsonld | 2 +- .../subscription-invalid-query-sample.jsonld | 2 +- .../subscription-invalid-type-sample.jsonld | 2 +- data/csourceSubscriptions/subscription-sample.jsonld | 2 +- .../subscription-temporalQ-createdAt-sample.jsonld | 2 +- .../subscription-temporalQ-modifiedAt-sample.jsonld | 2 +- .../subscription-temporalQ-observedAt-sample.jsonld | 2 +- .../subscription-timeInterval-sample.jsonld | 2 +- .../subscription-unreachable-endpoint-sample.jsonld | 2 +- .../subscription-watchedAttributes-sample.jsonld | 2 +- .../subscription-without-notification-sample.jsonld | 2 +- data/entities/batch/invalid-json-ld-sample.jsonld | 2 +- data/entities/batch/invalid-json-sample.jsonld | 2 +- data/entities/building-location-attribute-sample.jsonld | 2 +- data/entities/building-location-attribute.jsonld | 2 +- data/entities/building-minimal-sample.jsonld | 2 +- data/entities/building-minimal.jsonld | 2 +- data/entities/building-no-attributes.jsonld | 2 +- .../building-relationship-of-property-sample.jsonld | 2 +- data/entities/building-relationship-sample.jsonld | 2 +- data/entities/building-relationship.jsonld | 2 +- data/entities/building-simple-attributes-sample.jsonld | 2 +- .../vehicle-delete-datasetid-speed-expectation.jsonld | 2 +- .../vehicle-delete-default-speed-expectation.jsonld | 2 +- .../vehicle-delete-deleteall-speed-expectation.jsonld | 2 +- .../expectations/vehicle-isparked-update-expectation.jsonld | 2 +- .../vehicle-multi-attributes-expectation.jsonld | 2 +- .../expectations/vehicle-speed-appended-expectation.jsonld | 2 +- .../vehicle-speed-different-datasetid-expectation.jsonld | 2 +- .../vehicle-update-attributes-expectation.jsonld | 2 +- .../vehicle-update-datasetid-attributes-expectation.jsonld | 2 +- .../expectations/vehicle-update-speed-expectation.jsonld | 2 +- .../fragmentEntities/airQualityLevel-fragment.jsonld | 2 +- data/entities/fragmentEntities/invalid-fragment.jsonld | 2 +- .../vehicle-attribute-to-add-fragment.jsonld | 2 +- .../fragmentEntities/vehicle-brandname-fragment.jsonld | 2 +- .../fragmentEntities/vehicle-isparked-fragment.jsonld | 2 +- .../fragmentEntities/vehicle-new-attribute-fragment.jsonld | 2 +- .../vehicle-speed-different-datasetid-fragment.jsonld | 2 +- ...cle-speed-equal-datasetid-different-type-fragment.jsonld | 2 +- .../vehicle-speed-equal-datasetid-fragment.jsonld | 2 +- .../vehicle-speed-invalid-datasetid-fragment.jsonld | 2 +- .../vehicle-speed-two-datasetid-01-fragment.jsonld | 2 +- .../vehicle-speed-two-datasetid-02-fragment.jsonld | 2 +- .../vehicle-speed-two-datasetid-03-fragment.jsonld | 2 +- .../vehicle-speed-wrong-name-fragment.jsonld | 2 +- data/entities/invalid-json-sample.jsonld | 2 +- data/entities/parking-simple-attributes-sample.jsonld | 2 +- data/entities/vehicle-simple-attributes-sample.jsonld | 2 +- data/entities/vehicle-speed-two-datasetid-sample.jsonld | 2 +- .../entities/vehicle-two-datasetid-attributes-sample.jsonld | 2 +- .../expectations/subscription-028-01-expectation.jsonld | 2 +- .../subscription-vehicle-expanded-types-sample.jsonld | 2 +- .../expectations/subscription-vehicle-sample.jsonld | 2 +- .../subscription-building-entities-accept-jsonld.jsonld | 2 +- .../subscription-building-entities-active-query.jsonld | 2 +- ...-building-entities-active-watchedAttributes-query.jsonld | 2 +- ...iption-building-entities-active-watchedAttributes.jsonld | 2 +- .../subscription-building-entities-active.jsonld | 2 +- .../subscription-building-entities-default.jsonld | 2 +- data/subscriptions/subscription-inactive-sample.jsonld | 2 +- data/subscriptions/subscription-invalid-json-sample.jsonld | 2 +- data/subscriptions/subscription-sample.jsonld | 2 +- .../subscription-timeInterval-sample-query.jsonld | 2 +- data/subscriptions/subscription-timeInterval-sample.jsonld | 2 +- .../subscription-watchedAttributes-sample.jsonld | 2 +- .../2020-08-bus-temporal-representation-sample.jsonld | 2 +- ...temporal-representation-multiple-instances-sample.jsonld | 2 +- .../2020-08-vehicule-temporal-representation-sample.jsonld | 2 +- .../2020-09-vehicule-temporal-representation-sample.jsonld | 2 +- ...cule-temporal-representation-with-location-sample.jsonld | 2 +- data/temporalEntities/entity-operations-after-query.jsonld | 2 +- data/temporalEntities/entity-operations-before-query.jsonld | 2 +- ...ral-representation-delete-speed-instanceid-sample.jsonld | 2 +- .../vehicle-temporal-representation-fragment.jsonld | 2 +- ...cle-temporal-representation-invalid-json-fragment.jsonld | 2 +- .../vehicle-create-temporal-representation-sample.jsonld | 2 +- ...vehicle-simplified-temporal-representation-sample.jsonld | 2 +- .../vehicle-temporal-representation-sample.jsonld | 2 +- .../vehicle-temporal-representation-update-sample.jsonld | 2 +- .../jsonld-contexts/ngsi-ld-test-suite-compound.jsonld | 6 ++++++ .../ngsi-ld-test-suite.jsonld} | 0 resources/variables.py | 2 +- 104 files changed, 108 insertions(+), 102 deletions(-) create mode 100644 resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld rename resources/{ngsi-ld-test-suite-context.jsonld => jsonld-contexts/ngsi-ld-test-suite.jsonld} (100%) diff --git a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld index 595a6bae..12a546f6 100644 --- a/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld @@ -19,6 +19,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld index 28b2672a..1c39aed2 100644 --- a/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-bus-entities-sample.jsonld @@ -12,6 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld index b4826ab6..4560eee8 100644 --- a/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-detailed-information-sample.jsonld @@ -14,6 +14,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld index 5eb0def1..3a401bad 100644 --- a/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld index a05b8ef5..97515561 100644 --- a/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", "type": "ContextSourceRegistration", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-location-sample.jsonld b/data/csourceRegistrations/context-source-registration-location-sample.jsonld index 3f1faa32..c119434b 100644 --- a/data/csourceRegistrations/context-source-registration-location-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-location-sample.jsonld @@ -19,6 +19,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld index 8ea742e0..329d4b7c 100644 --- a/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-managementInterval-sample.jsonld @@ -16,6 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld index a64c29ea..ed9e1d8e 100644 --- a/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-no-id-sample.jsonld @@ -37,6 +37,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld index f97a489b..35ac3fc0 100644 --- a/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-observationInterval-sample.jsonld @@ -16,6 +16,6 @@ }, "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld index 182acfd5..38760ce0 100644 --- a/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-past-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": " 2018-11-29T14:53:15Z", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-sample.jsonld b/data/csourceRegistrations/context-source-registration-sample.jsonld index 42364aee..68ef4bc9 100644 --- a/data/csourceRegistrations/context-source-registration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-sample.jsonld @@ -38,6 +38,6 @@ "startAt": "2017-11-29T14:53:15Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-simple-sample.jsonld b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld index d8676411..7d83cbbc 100644 --- a/data/csourceRegistrations/context-source-registration-simple-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-simple-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld index 52d23178..4a80a599 100644 --- a/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld @@ -12,6 +12,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld index aae82c14..d638652d 100644 --- a/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-expiration-sample.jsonld @@ -39,6 +39,6 @@ }, "expiresAt": "2025-11-29T14:53:15Z", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld index ab355dda..17425354 100644 --- a/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld @@ -8,6 +8,6 @@ ], "endpoint":"http://my.csource.org:1026", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld index ed1ac079..09591732 100644 --- a/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld +++ b/data/csourceRegistrations/fragments/context-source-registration-different-type-sample.jsonld @@ -38,6 +38,6 @@ "startAt": " 2017-11-29T14:53:15Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld index 974c0ec3..c027db75 100644 --- a/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expired-sample.jsonld b/data/csourceSubscriptions/subscription-expired-sample.jsonld index d0a82db9..f19891b5 100644 --- a/data/csourceSubscriptions/subscription-expired-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expired-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld index 0bcd3fdb..9286e21d 100644 --- a/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-expiresAt-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld index 504d7398..ee67134f 100644 --- a/data/csourceSubscriptions/subscription-geoQ-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-sample.jsonld @@ -20,6 +20,6 @@ "geoproperty": "location" }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld index 40c3e966..59c4e595 100644 --- a/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld +++ b/data/csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld @@ -19,6 +19,6 @@ "coordinates":[-8.52,41.2] }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-inactive-sample.jsonld b/data/csourceSubscriptions/subscription-inactive-sample.jsonld index 8dc52e55..9d513e90 100644 --- a/data/csourceSubscriptions/subscription-inactive-sample.jsonld +++ b/data/csourceSubscriptions/subscription-inactive-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld index 4822c1fa..9a4012e3 100644 --- a/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-query-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld index fd2286f4..3db426ed 100644 --- a/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld +++ b/data/csourceSubscriptions/subscription-invalid-type-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-sample.jsonld b/data/csourceSubscriptions/subscription-sample.jsonld index 0c796a64..aa4cf39e 100644 --- a/data/csourceSubscriptions/subscription-sample.jsonld +++ b/data/csourceSubscriptions/subscription-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld index 622bbd72..fe1ac008 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "createdAt" }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld index 13ac0a57..26bde451 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "modifiedAt" }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld index f6cbd80d..9bb93fdb 100644 --- a/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld +++ b/data/csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld @@ -19,6 +19,6 @@ "timeproperty": "observedAt" }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld index dbd99490..fd01831e 100644 --- a/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld +++ b/data/csourceSubscriptions/subscription-timeInterval-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld index f4919f8b..2dbb680d 100644 --- a/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +++ b/data/csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld index 6e4ebcc0..8858a4e2 100644 --- a/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/csourceSubscriptions/subscription-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld index aca2a04e..2853928b 100644 --- a/data/csourceSubscriptions/subscription-without-notification-sample.jsonld +++ b/data/csourceSubscriptions/subscription-without-notification-sample.jsonld @@ -7,6 +7,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/batch/invalid-json-ld-sample.jsonld b/data/entities/batch/invalid-json-ld-sample.jsonld index 41010727..fdf99195 100644 --- a/data/entities/batch/invalid-json-ld-sample.jsonld +++ b/data/entities/batch/invalid-json-ld-sample.jsonld @@ -7,7 +7,7 @@ "value":null }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/batch/invalid-json-sample.jsonld b/data/entities/batch/invalid-json-sample.jsonld index 76027922..8e4a66a2 100644 --- a/data/entities/batch/invalid-json-sample.jsonld +++ b/data/entities/batch/invalid-json-sample.jsonld @@ -3,7 +3,7 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/building-location-attribute-sample.jsonld b/data/entities/building-location-attribute-sample.jsonld index 569ead7b..081c7a01 100644 --- a/data/entities/building-location-attribute-sample.jsonld +++ b/data/entities/building-location-attribute-sample.jsonld @@ -17,6 +17,6 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld index 68058d33..778fe8f9 100644 --- a/data/entities/building-location-attribute.jsonld +++ b/data/entities/building-location-attribute.jsonld @@ -17,7 +17,7 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld index 15d052fc..b304755a 100644 --- a/data/entities/building-minimal-sample.jsonld +++ b/data/entities/building-minimal-sample.jsonld @@ -2,6 +2,6 @@ "id": "urn:ngsi-ld:Building:randomUUID", "type": "Building", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-minimal.jsonld b/data/entities/building-minimal.jsonld index f5ef2a60..3de15791 100644 --- a/data/entities/building-minimal.jsonld +++ b/data/entities/building-minimal.jsonld @@ -2,7 +2,7 @@ "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", "type": "Building", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-no-attributes.jsonld b/data/entities/building-no-attributes.jsonld index 99efda91..42c0f2af 100644 --- a/data/entities/building-no-attributes.jsonld +++ b/data/entities/building-no-attributes.jsonld @@ -6,6 +6,6 @@ "value": "Eiffel Tower" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld index 57826a72..c87ae1ec 100644 --- a/data/entities/building-relationship-of-property-sample.jsonld +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -24,6 +24,6 @@ "value": false }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship-sample.jsonld b/data/entities/building-relationship-sample.jsonld index d649d1ce..c82bc65b 100644 --- a/data/entities/building-relationship-sample.jsonld +++ b/data/entities/building-relationship-sample.jsonld @@ -6,6 +6,6 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-relationship.jsonld b/data/entities/building-relationship.jsonld index 3ae799de..d2151f1e 100644 --- a/data/entities/building-relationship.jsonld +++ b/data/entities/building-relationship.jsonld @@ -6,7 +6,7 @@ "object": "urn:ngsi-ld:City:Paris" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld index 3c0922b5..ebfce095 100644 --- a/data/entities/building-simple-attributes-sample.jsonld +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -20,6 +20,6 @@ "value": false }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } diff --git a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld index 99eff6f7..a7238cbb 100644 --- a/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-datasetid-speed-expectation.jsonld @@ -24,6 +24,6 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld index 195b9698..4df3a8c4 100644 --- a/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-default-speed-expectation.jsonld @@ -26,6 +26,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld index 0c6924ba..29744061 100644 --- a/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-delete-deleteall-speed-expectation.jsonld @@ -16,6 +16,6 @@ "datasetId": "urn:ngsi-ld:Relationship:parked12345" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-isparked-update-expectation.jsonld b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld index 21807735..b005ba61 100644 --- a/data/entities/expectations/vehicle-isparked-update-expectation.jsonld +++ b/data/entities/expectations/vehicle-isparked-update-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld index 37a8b2cc..06decfb2 100644 --- a/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-multi-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld index f49a1396..1eb89b2c 100644 --- a/data/entities/expectations/vehicle-speed-appended-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-appended-expectation.jsonld @@ -39,6 +39,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld index 0c7cca5d..aff9a0d9 100644 --- a/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld +++ b/data/entities/expectations/vehicle-speed-different-datasetid-expectation.jsonld @@ -48,6 +48,6 @@ "observedAt": "2017-07-29T12:00:04Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld index e3a1d2b7..d8690073 100644 --- a/data/entities/expectations/vehicle-update-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld index 8dce6507..4b178106 100644 --- a/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-datasetid-attributes-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-update-speed-expectation.jsonld b/data/entities/expectations/vehicle-update-speed-expectation.jsonld index 546631d3..afa00eda 100644 --- a/data/entities/expectations/vehicle-update-speed-expectation.jsonld +++ b/data/entities/expectations/vehicle-update-speed-expectation.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld index af683762..32b7ddf4 100644 --- a/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld +++ b/data/entities/fragmentEntities/airQualityLevel-fragment.jsonld @@ -6,6 +6,6 @@ "observedAt": "2020-10-10T16:40:00.000Z" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/invalid-fragment.jsonld b/data/entities/fragmentEntities/invalid-fragment.jsonld index 2dcd2a7c..cc6319ec 100644 --- a/data/entities/fragmentEntities/invalid-fragment.jsonld +++ b/data/entities/fragmentEntities/invalid-fragment.jsonld @@ -13,6 +13,6 @@ "value": "BMW" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld index 246b133a..b01f0570 100644 --- a/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-attribute-to-add-fragment.jsonld @@ -13,6 +13,6 @@ "value": 23 }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index 3a1314c6..ff248fed 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -3,5 +3,5 @@ "type": "Property", "value": "BMW" }, - "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld index 5c834ade..774f93c2 100644 --- a/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-isparked-fragment.jsonld @@ -4,6 +4,6 @@ "object": "urn:ngsi-ld:Person:JohnDoe" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } diff --git a/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld index 1396ff7b..0ff0b6c0 100644 --- a/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-new-attribute-fragment.jsonld @@ -4,6 +4,6 @@ "value": 23 }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld index 3788c6fc..2ab16715 100644 --- a/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-different-datasetid-fragment.jsonld @@ -13,6 +13,6 @@ "value": 23 }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld index 0f1118c2..9a023b68 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-different-type-fragment.jsonld @@ -2,6 +2,6 @@ "type": "Relationship", "object": "urn:ngsi-ld:Entity:01", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld index 8387c231..692d09f7 100644 --- a/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-equal-datasetid-fragment.jsonld @@ -2,6 +2,6 @@ "value": 56, "datasetId": "urn:ngsi-ld:Property:speedometer", "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld index 7614a4c3..5a7640a2 100644 --- a/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-invalid-datasetid-fragment.jsonld @@ -9,6 +9,6 @@ "datasetId": "" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld index b63e9caa..2a4343ae 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-01-fragment.jsonld @@ -8,6 +8,6 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld index a51b3beb..52941b56 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-02-fragment.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld index 96efb66b..fd3c5b3e 100644 --- a/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-two-datasetid-03-fragment.jsonld @@ -19,6 +19,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld index fb0fab8a..d84b42e4 100644 --- a/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-speed-wrong-name-fragment.jsonld @@ -13,6 +13,6 @@ "value": "BMW" }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/invalid-json-sample.jsonld b/data/entities/invalid-json-sample.jsonld index 76027922..8e4a66a2 100644 --- a/data/entities/invalid-json-sample.jsonld +++ b/data/entities/invalid-json-sample.jsonld @@ -3,7 +3,7 @@ "id":"urn:ngsi-ld:Building:randomUUID",, "type":"Building", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" ] } diff --git a/data/entities/parking-simple-attributes-sample.jsonld b/data/entities/parking-simple-attributes-sample.jsonld index 45479821..a42762b4 100644 --- a/data/entities/parking-simple-attributes-sample.jsonld +++ b/data/entities/parking-simple-attributes-sample.jsonld @@ -30,6 +30,6 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-sample.jsonld b/data/entities/vehicle-simple-attributes-sample.jsonld index 5615bde9..53363f9c 100644 --- a/data/entities/vehicle-simple-attributes-sample.jsonld +++ b/data/entities/vehicle-simple-attributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-speed-two-datasetid-sample.jsonld b/data/entities/vehicle-speed-two-datasetid-sample.jsonld index d04e0a88..87e01ca2 100644 --- a/data/entities/vehicle-speed-two-datasetid-sample.jsonld +++ b/data/entities/vehicle-speed-two-datasetid-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld index 8f377f0a..d72a77df 100644 --- a/data/entities/vehicle-two-datasetid-attributes-sample.jsonld +++ b/data/entities/vehicle-two-datasetid-attributes-sample.jsonld @@ -33,6 +33,6 @@ "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" }], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-028-01-expectation.jsonld b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld index baeb3c87..81afd4bd 100644 --- a/data/subscriptions/expectations/subscription-028-01-expectation.jsonld +++ b/data/subscriptions/expectations/subscription-028-01-expectation.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld index 0688e6ec..2ba30b1f 100644 --- a/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld index 74d6507b..d7a68311 100644 --- a/data/subscriptions/expectations/subscription-vehicle-sample.jsonld +++ b/data/subscriptions/expectations/subscription-vehicle-sample.jsonld @@ -16,6 +16,6 @@ }, "status": "active", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld index 9342ee00..6f280dce 100644 --- a/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld +++ b/data/subscriptions/subscription-building-entities-accept-jsonld.jsonld @@ -13,6 +13,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-query.jsonld b/data/subscriptions/subscription-building-entities-active-query.jsonld index 138bdca2..2cce3970 100644 --- a/data/subscriptions/subscription-building-entities-active-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-query.jsonld @@ -17,6 +17,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld index 91131d8d..86bce0f3 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld @@ -16,6 +16,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld index c4a90b29..57412636 100644 --- a/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +++ b/data/subscriptions/subscription-building-entities-active-watchedAttributes.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-active.jsonld b/data/subscriptions/subscription-building-entities-active.jsonld index 42b9d8b4..eb93455e 100644 --- a/data/subscriptions/subscription-building-entities-active.jsonld +++ b/data/subscriptions/subscription-building-entities-active.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-building-entities-default.jsonld b/data/subscriptions/subscription-building-entities-default.jsonld index 5616568a..48bb27b2 100644 --- a/data/subscriptions/subscription-building-entities-default.jsonld +++ b/data/subscriptions/subscription-building-entities-default.jsonld @@ -12,6 +12,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-inactive-sample.jsonld b/data/subscriptions/subscription-inactive-sample.jsonld index 8dc52e55..9d513e90 100644 --- a/data/subscriptions/subscription-inactive-sample.jsonld +++ b/data/subscriptions/subscription-inactive-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-invalid-json-sample.jsonld b/data/subscriptions/subscription-invalid-json-sample.jsonld index b4b58b74..3762671e 100644 --- a/data/subscriptions/subscription-invalid-json-sample.jsonld +++ b/data/subscriptions/subscription-invalid-json-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-sample.jsonld b/data/subscriptions/subscription-sample.jsonld index 0c9d8449..d0451590 100644 --- a/data/subscriptions/subscription-sample.jsonld +++ b/data/subscriptions/subscription-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample-query.jsonld b/data/subscriptions/subscription-timeInterval-sample-query.jsonld index fc953e4f..a6bd1088 100644 --- a/data/subscriptions/subscription-timeInterval-sample-query.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample-query.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-timeInterval-sample.jsonld b/data/subscriptions/subscription-timeInterval-sample.jsonld index fc953e4f..a6bd1088 100644 --- a/data/subscriptions/subscription-timeInterval-sample.jsonld +++ b/data/subscriptions/subscription-timeInterval-sample.jsonld @@ -14,6 +14,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/subscriptions/subscription-watchedAttributes-sample.jsonld b/data/subscriptions/subscription-watchedAttributes-sample.jsonld index 6e4ebcc0..8858a4e2 100644 --- a/data/subscriptions/subscription-watchedAttributes-sample.jsonld +++ b/data/subscriptions/subscription-watchedAttributes-sample.jsonld @@ -15,6 +15,6 @@ } }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld index 8b003642..2b852243 100644 --- a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index efd98374..81c4abbf 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -177,6 +177,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index 12773e34..f4f193b0 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index e0149e90..19c99418 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index d4f1a161..b76e4ed3 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -60,6 +60,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-after-query.jsonld b/data/temporalEntities/entity-operations-after-query.jsonld index c4e59b0d..590f4701 100644 --- a/data/temporalEntities/entity-operations-after-query.jsonld +++ b/data/temporalEntities/entity-operations-after-query.jsonld @@ -3,6 +3,6 @@ "timerel":"after", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/entity-operations-before-query.jsonld b/data/temporalEntities/entity-operations-before-query.jsonld index 10e9d52e..a5033a05 100644 --- a/data/temporalEntities/entity-operations-before-query.jsonld +++ b/data/temporalEntities/entity-operations-before-query.jsonld @@ -3,6 +3,6 @@ "timerel":"before", "timeAt":"2020-08-02T12:05:00Z", "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld index 34e8819a..4c30edb7 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld @@ -33,6 +33,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld index e68302ae..d806a9c8 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-fragment.jsonld @@ -17,6 +17,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld index d076ab8a..4b106045 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -42,6 +42,6 @@ } ], "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld index 17873cc3..99cbf890 100644 --- a/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-create-temporal-representation-sample.jsonld @@ -32,6 +32,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld index 6692234b..8ffa880f 100644 --- a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld @@ -16,6 +16,6 @@ ] }, "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index 8fdc0d93..a6506961 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -38,6 +38,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld index d5fc2ca0..19ea07fb 100644 --- a/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-update-sample.jsonld @@ -36,6 +36,6 @@ } ], "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld new file mode 100644 index 00000000..74225243 --- /dev/null +++ b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld @@ -0,0 +1,6 @@ +{ + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + ] +} diff --git a/resources/ngsi-ld-test-suite-context.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld similarity index 100% rename from resources/ngsi-ld-test-suite-context.jsonld rename to resources/jsonld-contexts/ngsi-ld-test-suite.jsonld diff --git a/resources/variables.py b/resources/variables.py index 46fae04b..f24138c4 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,7 +1,7 @@ def get_variables(arg=None): variables = { 'url': 'localhost:8080/ngsi-ld/v1', - 'ngsild_test_suite_context': 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/ngsi-ld-test-suite-context.jsonld', + 'ngsild_test_suite_context': 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld', 'notification_server_host': '0.0.0.0', 'notification_server_port': 8085, 'send_notification_server_host': '0.0.0.0', -- GitLab From c5d378397d5adc65f9deaf53a6b196f1bcc7636b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 11 Mar 2023 15:04:11 +0100 Subject: [PATCH 286/442] fix(009): fix Delete Temporal Representation of Entities TCs --- .../DeleteTemporalRepresentationOfEntity/009_02.robot | 8 ++++---- .../DeleteTemporalRepresentationOfEntity/009_03.robot | 4 ++-- .../vehicle-temporal-representation-sample.jsonld | 6 ------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 9268967d..5c78f4bc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -8,16 +8,16 @@ Test Template Delete Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE ID +*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE 009_02_01_Delete a temporal representation of an entity with an empty entity id - 400 ${EMPTY} + 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} 009_02_02 Delete a temporal representation of an entity with an invalid entity id - 400 invalidId + 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Temporal Entity - [Arguments] ${status_code} ${id} + [Arguments] ${status_code} ${id} ${problem_type} [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId [Tags] te-delete 5_6_16 ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 3d09dad8..826558e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -10,10 +10,10 @@ ${status_code}= 404 *** Test Cases *** 009_03 Delete a temporal representation of an entity with a unknown entity id - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing entity id [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld index a6506961..99cbf890 100644 --- a/data/temporalEntities/vehicle-temporal-representation-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", -- GitLab From ae5cbdf7773901fc8e25ef46e683d53874858953 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 11 Mar 2023 15:59:04 +0100 Subject: [PATCH 287/442] fix(017): incorrect test setup --- .../DeleteAttributeInstance/017_02.robot | 9 ++++++--- ...-representation-delete-speed-instanceid-sample.jsonld | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 52dfc8c9..bda39116 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -3,7 +3,8 @@ Documentation Check that you cannot delete an attribute instance in temporal Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity Test Template Delete attribute instance *** Variable *** @@ -37,9 +38,8 @@ Delete attribute instance [Tags] tea-instance-delete 5_6_15 ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} -Create Id +Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} @@ -47,3 +47,6 @@ Create Id ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld index 4c30edb7..3bfbec07 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", -- GitLab From 0c29939236c6d4366db0ad72e1582d8a00f407bf Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 12 Mar 2023 13:45:56 +0100 Subject: [PATCH 288/442] fix: bunch of fixes in Temporal API Test Cases --- .../021_01.robot | 4 +- .../021_05.robot | 2 +- .../021_08.robot | 2 +- .../021_11.robot | 21 ++++----- .../021_13.robot | 2 +- .../AppendAttributes/014_02.robot | 22 +++++---- .../AppendAttributes/014_03.robot | 4 +- .../DeleteAttribute/015_02.robot | 18 ++++---- .../DeleteAttribute/015_03.robot | 2 +- .../DeleteAttributeInstance/017_02.robot | 7 +-- ...-bus-temporal-representation-sample.jsonld | 6 --- ...sentation-multiple-instances-sample.jsonld | 6 --- ...cule-temporal-representation-sample.jsonld | 6 --- ...cule-temporal-representation-sample.jsonld | 6 --- ...representation-with-location-sample.jsonld | 6 --- ...tation-unretrievable-context-sample.jsonld | 6 --- ...l-representation-020-01-expectation.jsonld | 4 -- ...l-representation-020-02-expectation.jsonld | 4 -- ...epresentation-020-04-01-expectation.jsonld | 7 +-- ...epresentation-020-04-02-expectation.jsonld | 13 +----- ...epresentation-020-04-03-expectation.jsonld | 8 +--- ...epresentation-020-05-01-expectation.jsonld | 4 -- ...epresentation-020-05-02-expectation.jsonld | 4 -- ...l-representation-020-10-expectation.jsonld | 27 ++++++----- ...ntation-added-attribute-expectation.jsonld | 6 --- ...ete-fuelLevel-datasetid-expectation.jsonld | 6 --- ...tation-delete-fuelLevel-expectation.jsonld | 6 --- ...ion-deleteall-fuelLevel-expectation.jsonld | 6 --- ...artial-update-attribute-expectation.jsonld | 6 --- ...epresentation-021-01-01-expectation.jsonld | 8 ---- ...epresentation-021-01-02-expectation.jsonld | 8 ---- ...l-representation-021-03-expectation.jsonld | 8 ---- ...l-representation-021-04-expectation.jsonld | 8 ---- ...l-representation-021-05-expectation.jsonld | 46 ------------------- ...l-representation-021-06-expectation.jsonld | 4 -- ...l-representation-021-07-expectation.jsonld | 8 ---- ...l-representation-021-08-expectation.jsonld | 18 ++++---- ...epresentation-021-09-01-expectation.jsonld | 4 -- ...epresentation-021-09-02-expectation.jsonld | 4 -- ...epresentation-021-11-01-expectation.jsonld | 8 ---- ...epresentation-021-11-02-expectation.jsonld | 12 ----- ...epresentation-021-13-01-expectation.jsonld | 10 +--- ...epresentation-021-13-02-expectation.jsonld | 10 +--- ...epresentation-invalid-json-fragment.jsonld | 6 --- ...cle-temporal-invalid-context-sample.jsonld | 6 --- ...presentation-without-context-sample.jsonld | 6 --- resources/ApiUtils.resource | 11 +++-- 47 files changed, 83 insertions(+), 323 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 9c30ce15..4835e721 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -15,10 +15,10 @@ ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-samp ${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld +After after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld [Tags] te-query 5_7_4 -Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld +Before before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld [Tags] te-query 5_7_4 *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index dba78de4..aaaa9549 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -19,7 +19,7 @@ Query the temporal evolution of entities matching the given type(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 55b03d74..aab99ae5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -17,7 +17,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90 timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 90a849e3..7f557d06 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -9,37 +9,34 @@ Test Template Query the temporal evolution of entities with a limit to the n *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: ${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-11-expectation.jsonld -*** Test Cases *** LIMIT EXPECTATION_FILE TEMPORAL_ENTITIES_REPRESENTATION_IDS +*** Test Cases *** LIMIT Query Some entities - ${2} vehicles-temporal-representation-021-11-01-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + ${2} [Tags] te-query 5_7_4 Query All entities - ${20} vehicles-temporal-representation-021-11-02-expectation.jsonld ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} ${third_temporal_entity_representation_id} + ${3} [Tags] te-query 5_7_4 *** Keywords *** Query the temporal evolution of entities with a limit to the number of entities to be retrieved - [Arguments] ${limit} ${expectation_file} @{temporal_entities_representation_ids} + [Arguments] ${limit} [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus,Vehicle Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing Number Of Entities Vehicle ${limit} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} Set Suite Variable ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index a63eda6c..7bd851b6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -23,7 +23,7 @@ Before entity-operations-before-query.jsonld vehicles-temporal Query the temporal evolution of entities using the entityOperations method [Arguments] ${payload_file} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method - Query Temporal Representation Of Entities Via Post ${payload_file} + Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 19e0aefa..f8a5d788 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -12,32 +12,34 @@ ${status_code}= 400 *** Test Cases *** 014_02_01_Add an attribute to a temporal representation of an entity with invalid content - Add an Attribute To a Temporal Entity vehicle-temporal-representation-invalid-json-fragment.jsonld + Add an Attribute To a Temporal Entity From File vehicle-temporal-representation-invalid-json-fragment.jsonld 014_02_02_Add an attribute to a temporal representation of an entity with empty content - Add an Attribute To a Temporal Entity vehicle-temporal-representation-empty-json-fragment.jsonld + Add an Attribute To a Temporal Entity From File vehicle-temporal-representation-empty-json-fragment.jsonld 014_02_03_Add an attribute to a temporal representation of an entity with an empty entity id - Fail To Add Attribute To Temporal Entity ${EMPTY} + Add Attribute To Temporal Entity ${EMPTY} 014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id - Fail To Add Attribute To Temporal Entity thisIsAninvalidId + Add Attribute To Temporal Entity thisIsAninvalidId *** Keywords *** -Add an Attribute To a Temporal Entity +Add an Attribute To a Temporal Entity From File [Arguments] ${update_filename} - [Documentation] Check that an error is raised if you delete a temporal enitity with empty/invalid content + [Documentation] Check that an error is raised if you add a temporal entity attribute with empty/invalid content [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response['status']} + Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Check RL Response Status Code Set To ${status_code} + Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} + Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} -Fail To Add Attribute To Temporal Entity +Add Attribute To Temporal Entity [Arguments] ${id} - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId + [Documentation] Check that an error is raised if you add a temporal entity attribute with a non existing/invalid EnityId [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 8d07f1bc..9b14db12 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with not found +Documentation Check that an error is raised if you add an attribute to a non existent entity Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource @@ -12,7 +12,7 @@ ${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you delete a temporal enitity with not found + [Documentation] Check that an error is raised if you add an attribute to a non existent entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index ab42f3b4..36c975e3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -3,7 +3,8 @@ Documentation Check that an error is raised if you delete an attribute to te Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity Test Template Delete attribute from temporal entity with unknow entity/attribute id *** Variable *** @@ -24,17 +25,18 @@ ${filename}= vehicle-temporal-representation-sample.jsonld *** Keywords *** Delete attribute from temporal entity with unknow entity/attribute id [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id [Tags] tea-delete 5_6_13 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} -Create Id +Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} Set Suite Variable ${valid_temporal_entity_id} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index f56aea0e..5a13f3cb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -27,7 +27,7 @@ Delete Attribute Check Response Status Code 201 ${response['status']} ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index bda39116..3f71940b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -22,13 +22,10 @@ ${status_code}= 400 017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId -017_02_04_delete an attribute instance in temporal representation of an entity if the instance id is not present - ${temporal_entity_representation_id} speed ${EMPTY} - -017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name +017_02_04_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} -017_02_06_delete an attribute instance in temporal representation of an entity if the attribute name is not present +017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} *** Keywords *** diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld index 2b852243..6144fcb1 100644 --- a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Bus:randomUUID", "type":"Bus", - "brandName":[ - { - "type":"Property", - "value":"Mercedes" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 81c4abbf..b25b175d 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"Volvo" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index f4f193b0..36eafba4 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"Volvo" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index 19c99418..bfbc5ca5 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index b76e4ed3..95f6ffc0 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"Audi" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld index 7eaec7d1..87ccc946 100644 --- a/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld +++ b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Bus:randomUUID", "type":"Bus", - "brandName":[ - { - "type":"Property", - "value":"Mercedes" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld index 0cef750a..7e6d410f 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld @@ -1,10 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"https://ngsi-ld-test-suite/context#Vehicle", - "https://ngsi-ld-test-suite/context#brandName":{ - "type":"Property", - "value":"Volvo" - }, "https://ngsi-ld-test-suite/context#speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld index 74f8d774..93c69aa9 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld @@ -1,10 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld index 1a212875..2ef6fc8a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld @@ -1,10 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -16,5 +12,6 @@ "value":40, "observedAt":"2020-08-01T14:07:00Z" } - ] + ], + "speed": [] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld index eb29e25a..605f67d9 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld @@ -1,25 +1,16 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":{ + "fuelLevel":[{ "type":"Property", "value":67, "observedAt":"2020-08-01T12:03:00Z" - }, + }], "speed":[ { "type":"Property", "value":120, "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld index 4af9cc6c..c0390362 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld @@ -1,15 +1,11 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":{ + "fuelLevel":[{ "type":"Property", "value":67, "observedAt":"2020-08-01T12:03:00Z" - }, + }], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld index 8799061b..0c5cf14a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -1,10 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld index f8de9cff..421a6ae7 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -1,10 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld index 14fa90a4..032999f9 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld @@ -1,15 +1,20 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName": "Volvo", - "speed":[ - [ 120, "2020-08-01T12:03:00Z" ], - [ 80, "2020-08-01T12:05:00Z" ], - [ 100, "2020-08-01T12:07:00Z" ] - ], - "fuelLevel":[ - [ 67, "2020-08-01T12:03:00Z" ], - [ 53, "2020-08-01T13:05:00Z" ], - [ 40, "2020-08-01T14:07:00Z" ] - ] + "speed":{ + "type": "Property", + "values":[ + [ 120, "2020-08-01T12:03:00Z" ], + [ 80, "2020-08-01T12:05:00Z" ], + [ 100, "2020-08-01T12:07:00Z" ] + ] + }, + "fuelLevel":{ + "type": "Property", + "values":[ + [ 67, "2020-08-01T12:03:00Z" ], + [ 53, "2020-08-01T13:05:00Z" ], + [ 40, "2020-08-01T14:07:00Z" ] + ] + } } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld index bac6a5d2..e369877c 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld index 595adf93..bdf28c38 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld index a9184301..9687c225 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld index 21f9b9a4..90083d35 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld index 3bde9fea..0fbbb7c0 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld index 6fb2bc95..cdb6290a 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -34,10 +30,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld index 5c0a60b0..cb63a419 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld index 4abeba3b..a864acbf 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "speed":[ { "type":"Property", @@ -154,10 +150,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld index fdbbaea5..5044fa08 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld index 7043d27c..94f0976a 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld @@ -1,53 +1,7 @@ [ - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":[ - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - }, - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":120, - "observedAt":"2020-08-01T12:03:00Z" - } - ] - }, { "id":"urn:ngsi-ld:Bus:randomUUID", "type":"Bus", - "brandName":{ - "type":"Property", - "value":"Mercedes" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld index c5cd1101..ea0a97e4 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld index fdbbaea5..5044fa08 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld index 1923befa..0e177cd5 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -29,6 +25,11 @@ "value":120, "observedAt":"2020-08-01T12:03:00Z" }, + { + "type": "Property", + "value": 80, + "observedAt": "2020-08-01T12:05:00Z" + }, { "type":"Property", "value":100, @@ -39,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", @@ -66,6 +63,11 @@ "value":120, "observedAt":"2020-09-01T12:03:00Z" }, + { + "type": "Property", + "value": 80, + "observedAt": "2020-09-01T12:05:00Z" + }, { "type":"Property", "value":100, diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld index fc6f36e2..bb57e441 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Audi" - }, "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld index 8d6466fc..5930cc29 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Audi" - }, "speed":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld index fdbbaea5..5044fa08 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld index 5396ce0d..e48ad9d2 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,10 +40,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", @@ -86,10 +78,6 @@ { "id":"urn:ngsi-ld:Bus:randomUUID", "type":"Bus", - "brandName":{ - "type":"Property", - "value":"Mercedes" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld index 4adef51e..224342c6 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-01-expectation.jsonld @@ -2,18 +2,12 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - } + "fuelLevel": [], + "speed": [] }, { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - }, "fuelLevel":[ { "type":"Property", diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld index 7fbe7c43..4ae3b0a3 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-13-02-expectation.jsonld @@ -2,10 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, "fuelLevel":[ { "type":"Property", @@ -44,9 +40,7 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"BMW" - } + "fuelLevel": [], + "speed": [] } ] \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld index 4b106045..cd5e61bd 100644 --- a/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld +++ b/data/temporalEntities/fragments/vehicle-temporal-representation-invalid-json-fragment.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:8313926113148778",, "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld index 9f8f2dd8..33659f6b 100644 --- a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld index e3dba459..b50a1eab 100644 --- a/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld +++ b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld @@ -1,12 +1,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":[ - { - "type":"Property", - "value":"BMW" - } - ], "speed":[ { "type":"Property", diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 55243114..a378cb17 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -341,12 +341,12 @@ Append Attribute To Temporal Entity Append Attribute To Temporal Entity Using Session [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} Create Session OneRequest ${url} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} - Output request - Output response + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} expected_status=any + Output ${response.json()} + Set Test Variable ${response} [return] ${response} Partial Update Attribute From Temporal Entity @@ -529,9 +529,10 @@ Query Temporal Representation Of Entities Set Test Variable ${response} Query Temporal Representation Of Entities Via Post - [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_LD_JSON} + [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary Set To Dictionary ${headers} Content-Type ${content_type} + Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} ${response}= POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} Output request -- GitLab From d0fa29ae3ba5bf167e83936b99d43ca831f0e3b9 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 12 Mar 2023 14:11:35 +0100 Subject: [PATCH 289/442] fix(044_02): fix response status check after creating a temporal entity --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index cf2382e2..0793a171 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -60,7 +60,7 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) [Tags] te-query 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} -- GitLab From 7a9e929837093e584d33792ccd8fe170d1270626 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 20 Mar 2023 19:52:21 +0100 Subject: [PATCH 290/442] fix: incorrect Link headers in API utils keywords --- resources/ApiUtils.resource | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index a378cb17..68d3f6de 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -56,7 +56,7 @@ Query Entity &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} @@ -77,7 +77,7 @@ Query Entities &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type=${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} -- GitLab From 76267c8df60857d3ee04db4b0e0d840503f51590 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 21 Mar 2023 11:28:26 +0100 Subject: [PATCH 291/442] fix: temporal queries using a geoquery --- .../021_09.robot | 2 +- ...representation-with-location-sample.jsonld | 30 +++++++++++-------- ...epresentation-021-09-01-expectation.jsonld | 24 +++++++++++---- ...epresentation-021-09-02-expectation.jsonld | 26 +++++++++------- 4 files changed, 54 insertions(+), 28 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index ff1be30b..a2fde19f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-09-expectation.json Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld [Tags] te-query 5_7_4 -Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld +Within Polygon contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld [Tags] te-query 5_7_4 *** Keywords *** diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld index 95f6ffc0..6b4f6c1e 100644 --- a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -37,20 +37,26 @@ ], "location":[ { - "type":"Point", - "coordinates":[ - -8.5, - 41.2 - ], - "observedAt":"2020-10-01T12:03:00Z" + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + 2.35, + 42.22 + ] + }, + "observedAt":"2020-10-01T12:03:00Z" }, { - "type":"Point", - "coordinates":[ - 2.35, - 42.22 - ], - "observedAt":"2020-10-01T12:05:00Z" + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ] + }, + "observedAt":"2020-10-01T12:05:00Z" } ], "@context":[ diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld index bb57e441..f72267e5 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld @@ -38,12 +38,26 @@ ], "location":[ { - "type":"Point", - "coordinates":[ - -8.5, - 41.2 - ], + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + 2.35, + 42.22 + ] + }, "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ] + }, + "observedAt":"2020-10-01T12:05:00Z" } ] } diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld index 5930cc29..f72267e5 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld @@ -38,19 +38,25 @@ ], "location":[ { - "type":"Point", - "coordinates":[ - -8.5, - 41.2 - ], + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + 2.35, + 42.22 + ] + }, "observedAt":"2020-10-01T12:03:00Z" }, { - "type":"Point", - "coordinates":[ - -8.45, - 41.22 - ], + "type": "GeoProperty", + "value": { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ] + }, "observedAt":"2020-10-01T12:05:00Z" } ] -- GitLab From 621c609879227923ab671a27dc50ca3677a844cc Mon Sep 17 00:00:00 2001 From: poujol Date: Wed, 29 Mar 2023 16:02:28 +0000 Subject: [PATCH 292/442] fix(016_01): using timeproperty parameter instead of sysAttrs options --- .../DeleteAttributeInstance/017_01.robot | 2 +- .../DeleteAttributeInstance/017_03.robot | 4 +- .../ModifyAttributeInstance/016_01.robot | 39 ++++++++++++++++++ .../016_02.robot | 29 ++++++++------ .../016_03.robot | 23 ++++++----- .../016_01.robot | 40 ------------------- ...ntation-added-attribute-expectation.jsonld | 2 +- ...l-representation-create-expectation.jsonld | 5 ++- ...ete-fuelLevel-datasetid-expectation.jsonld | 2 +- ...tation-delete-fuelLevel-expectation.jsonld | 2 +- ...ion-deleteall-fuelLevel-expectation.jsonld | 2 +- ...dify-attribute-instance-expectation.jsonld | 37 +++++++++++++++++ ...artial-update-attribute-expectation.jsonld | 37 ----------------- ...l-representation-update-expectation.jsonld | 2 +- ...temporal-instanceid-update-fragment.jsonld | 4 -- ...-modify-attribute-instance-fragment.jsonld | 7 ++++ resources/ApiUtils.resource | 2 +- 17 files changed, 125 insertions(+), 114 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/{PartialUpdateAttributeInstance => ModifyAttributeInstance}/016_02.robot (56%) rename TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/{PartialUpdateAttributeInstance => ModifyAttributeInstance}/016_03.robot (60%) delete mode 100644 TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot create mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld delete mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld delete mode 100644 data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld create mode 100644 data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index 4206061e..b0b0ed18 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -18,7 +18,7 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc Set Suite Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index e4e72ea9..4aadafe9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -4,7 +4,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Create Id -Test Template Partially Update Temporal Entity +Test Template Delete Attribute Instance *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -22,7 +22,7 @@ ${status_code}= 404 ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 *** Keywords *** -Partially Update Temporal Entity +Delete Attribute Instance [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] tea-instance-delete 5_6_15 diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot new file mode 100644 index 00000000..f75abc6c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Check that you can modify an attribute instance in temporal representation of an entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Variable *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +${expectation_filename}= vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld +${attributeId}= speed + +*** Test Cases *** +016_01_Modify attribute instance in temporal representation of an entity + [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity + [Tags] tea-partial-update 5_6_14 + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} + + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${instanceId_before_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + + ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId_before_update} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Check Response Status Code 204 ${response['status']} + + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${instanceId_after_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + + Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} + + ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context modifiedAt + Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot similarity index 56% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index fbae4f06..2bfdfe95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -1,44 +1,44 @@ *** Settings *** -Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Create Id -Test Template Partially Update Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld ${status_code}= 400 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_02_01_update an attribute instance in temporal representation of an entity if the entity id is not valid +016_02_01_modify attribute instance in temporal representation of an entity if the entity id is not valid invalidId speed ${valid_instanceId} -016_02_02_update an attribute instance in temporal representation of an entity if the entity id is not present +016_02_02_modify attribute instance in temporal representation of an entity if the entity id is not present ${EMPTY} speed ${valid_instanceId} -016_02_03_update an attribute instance in temporal representation of an entity if the instance id is not valid +016_02_03_modify attribute instance in temporal representation of an entity if the instance id is not valid ${temporal_entity_representation_id} speed invalidId -016_02_04_update an attribute instance in temporal representation of an entity if the instance id is not present +016_02_04_modify attribute instance in temporal representation of an entity if the instance id is not present ${temporal_entity_representation_id} speed ${EMPTY} -016_02_05_update an attribute instance in temporal representation of an entity if the attribute name is not a valid name +016_02_05_modify attribute instance in temporal representation of an entity if the attribute name is not a valid name ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} -016_02_06_update an attribute instance in temporal representation of an entity if the attribute name is not present +016_02_06_modify attribute instance in temporal representation of an entity if the attribute name is not present ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} *** Keywords *** -Partially Update Temporal Entity +Modify Attribute Instance Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right [Tags] tea-partial-update 5_6_14 - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -48,3 +48,6 @@ Create Id ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot similarity index 60% rename from TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot rename to TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 7e4dc05b..168d4040 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -1,35 +1,35 @@ *** Settings *** -Documentation Check that you cannot partially update an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Create Id -Test Template Partially Update Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld ${status_code}= 404 *** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_03_01_update an attribute instance in temporal representation of an entity if the entity with given id is not found +016_03_01_modify attribute instance in temporal representation of an entity if the entity with given id is not found ${unknown_temporal_entity_id} speed ${valid_instanceId} -016_03_02_update an attribute instance in temporal representation of an entity if the target attribute is not found +016_03_02_modify attribute instance in temporal representation of an entity if the target attribute is not found ${temporal_entity_representation_id} speed2 ${valid_instanceId} -016_03_03_update an attribute instance in temporal representation of an entity if the target attribute instance is not found +016_03_03_modify attribute instance in temporal representation of an entity if the target attribute instance is not found ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 *** Keywords *** -Partially Update Temporal Entity +Modify Attribute Instance Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially update an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found [Tags] tea-partial-update 5_6_14 - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -41,3 +41,6 @@ Create Id ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot deleted file mode 100644 index 9a9f5863..00000000 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_01.robot +++ /dev/null @@ -1,40 +0,0 @@ -*** Settings *** -Documentation Check that you can partially update an attribute instance of a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld -${expectation_filename}= vehicle-temporal-representation-partial-update-attribute-expectation.jsonld -${attributeId}= speed - -*** Test Cases *** -016_01_Partially update an attribute instance of a temporal representation of an entity - [Documentation] Check that you can partially update an attribute instance of a temporal representation of an entity - [Tags] tea-partial-update 5_6_14 - ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} - ${createdAt_before_update}= Set Variable ${response['body']['speed'][0]['createdAt']} - ${modifiedAt_before_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} - ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Partial Update Attribute From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs - ${createdAt_after_update}= Set Variable ${response['body']['speed'][0]['createdAt']} - ${modifiedAt_after_update}= Set Variable ${response['body']['speed'][0]['modifiedAt']} - Should Be Equal As Strings ${createdAt_before_update} ${modifiedAt_before_update} - Should Be Equal As Strings ${createdAt_before_update} ${createdAt_after_update} - ${modifiedAt_before_update_date}= Convert Date ${modifiedAt_before_update} epoch - ${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch - Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld index e369877c..c4089b8e 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-added-attribute-expectation.jsonld @@ -49,6 +49,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld index 22b52c9f..7c893130 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-create-expectation.jsonld @@ -30,5 +30,8 @@ "observedAt":"2020-09-01T14:07:00Z", "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" } - ] + ], + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld index bdf28c38..ad6ecbd1 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld @@ -26,6 +26,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld index 9687c225..6b84b98c 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld @@ -22,6 +22,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld index 90083d35..29f7c564 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld @@ -14,6 +14,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld new file mode 100644 index 00000000..375f5a31 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld @@ -0,0 +1,37 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": [ + { + "type": "Property", + "value": 129, + "observedAt": "2020-09-01T12:03:00Z" + }, + { + "type": "Property", + "value":80, + "observedAt": "2020-09-01T12:05:00Z" + } + ], + "fuelLevel": [ + { + "type": "Property", + "value": 67, + "observedAt": "2020-09-01T12:03:00Z" + }, + { + "type": "Property", + "value": 53, + "observedAt": "2020-09-01T13:05:00Z" + }, + { + "type": "Property", + "value": 40, + "observedAt": "2020-09-01T14:07:00Z", + "datasetId": "urn:ngsi-ld:Vehicle:12345-fuel" + } + ], + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld deleted file mode 100644 index 0fbbb7c0..00000000 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-partial-update-attribute-expectation.jsonld +++ /dev/null @@ -1,37 +0,0 @@ -{ - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "speed":[ - { - "type":"Property", - "value":129, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - } - ], - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z", - "datasetId":"urn:ngsi-ld:Vehicle:12345-fuel" - } - ], - "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" - ] - } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld index e2bf75b9..33fb63cd 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-update-expectation.jsonld @@ -42,6 +42,6 @@ } ], "@context":[ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld deleted file mode 100644 index df735987..00000000 --- a/data/temporalEntities/fragments/vehicle-temporal-instanceid-update-fragment.jsonld +++ /dev/null @@ -1,4 +0,0 @@ -{ - "value":129, - "observedAt":"2020-09-01T12:03:00Z" -} \ No newline at end of file diff --git a/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld b/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld new file mode 100644 index 00000000..f9261a45 --- /dev/null +++ b/data/temporalEntities/fragments/vehicle-temporal-modify-attribute-instance-fragment.jsonld @@ -0,0 +1,7 @@ +[ + { + "type":"Property", + "value":129, + "observedAt":"2020-09-01T12:03:00Z" + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 68d3f6de..6176176b 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -349,7 +349,7 @@ Append Attribute To Temporal Entity Using Session Set Test Variable ${response} [return] ${response} -Partial Update Attribute From Temporal Entity +Modify Attribute Instance From Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" -- GitLab From 3a7d995243de9d65e630b48af324a89596ab3110 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Wed, 12 Apr 2023 14:46:59 +0200 Subject: [PATCH 293/442] fix: use valid name according 4.6.2 --- data/entities/fragmentEntities/vehicle-brandname-fragment.json | 2 +- .../entities/fragmentEntities/vehicle-brandname-fragment.jsonld | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.json b/data/entities/fragmentEntities/vehicle-brandname-fragment.json index 2675db21..cfa70d67 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.json +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.json @@ -1,5 +1,5 @@ { - "https://ngsi-ld-test-suite/context#brandName": { + "brandName": { "type": "Property", "value": "BMW" } diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index ff248fed..f9a73524 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -1,5 +1,5 @@ { - "https://ngsi-ld-test-suite/context#brandName": { + "brandName": { "type": "Property", "value": "BMW" }, -- GitLab From a877e61df75802defdb7d4559e1c6fd68ed7ef27 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Wed, 3 May 2023 13:51:38 +0200 Subject: [PATCH 294/442] feat: upgrade all libraries --- .../Subscription/Notification/046_10.robot | 3 +- .../Subscription/Notification/046_14.robot | 3 +- requirements.txt | 14 +- resources/ApiUtils.resource | 130 +++++++++--------- scripts/run_tests.sh | 3 - 5 files changed, 76 insertions(+), 77 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 06185e8d..04828132 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -61,7 +61,8 @@ Check that a notification is JSON Reply By 200 ${notification_headers} = Get Request Headers - Dictionary Should Contain Item ${notification_headers} Link ${expected_header_links} + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Contain Item ${notification_headers_dict} Link ${expected_header_links} ${notification_payload}= Get Request Body # json.loads parses the payload as json. It fails if the payload is malformed diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 1bfef38a..4b6b5cff 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -60,7 +60,8 @@ Check that a notification is sent as JSON-LD Reply By 200 ${notification_headers} = Get Request Headers - Dictionary Should Not Contain Key ${notification_headers} Link + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Not Contain Key ${notification_headers_dict} Link ${notification_payload}= Get Request Body # json.loads parses the payload as json. It fails if the payload is malformed diff --git a/requirements.txt b/requirements.txt index 95fc1974..516a6e77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -robotframework==3.2.2 -RESTinstance==1.0.2 +robotframework==6.0.2 +RESTinstance==1.3.0 robotframework-jsonschemalibrary==1.0 -robotframework-jsonlibrary==0.3.1 -robotframework-requests==0.8.0 -deepdiff==5.2.1 -robotframework-httpctrl==0.1.6 -robotframework-metrics==3.2.0 +robotframework-jsonlibrary==0.5 +robotframework-requests==0.9.4 +deepdiff==6.3.0 +robotframework-httpctrl==0.3.1 +robotframework-metrics==3.3.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 6176176b..e4e35282 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -37,14 +37,14 @@ ${response} *** Keywords *** Delete Entity by Id Returning Response [Arguments] ${id} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} Output request Output response [return] ${response} Delete Entity by Id [Arguments] ${id} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} Output request Output response @@ -61,7 +61,7 @@ Query Entity Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} ${request}= Output request Output response Set Test Variable ${response} @@ -89,7 +89,7 @@ Query Entities Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - ${response}= GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} @@ -108,7 +108,7 @@ Query Entities Via POST Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - ${response}= POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} + ${response}= REST.POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} Output request Output response [return] ${response} @@ -118,7 +118,7 @@ Retrieve Entity by Id ${headers}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} Output request Output response Set Test Variable ${response} @@ -130,7 +130,7 @@ Create Entity Selecting Content Type &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='${EMPTY}' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} ${request}= Output request Output response [return] ${request} ${response} @@ -139,7 +139,7 @@ Append Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -148,7 +148,7 @@ Append Entity Attributes With Parameters [Arguments] ${id} ${fragment_filename} ${content_type} ${options} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} body=${fragment_payload} headers=${headers} + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -174,7 +174,7 @@ Update Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} + ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -187,7 +187,7 @@ Delete Entity Attributes Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} Output request Output response [return] ${response} @@ -198,7 +198,7 @@ Partial Update Entity Attributes Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} + ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -211,7 +211,7 @@ Retrieve Entity Types Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} Output request Output response @@ -223,7 +223,7 @@ Retrieve Entity Type &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} Output request Output response @@ -237,7 +237,7 @@ Retrieve Attributes Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response @@ -249,7 +249,7 @@ Retrieve Attribute &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} Output request Output response @@ -260,7 +260,7 @@ Create Context Source Registration With Return &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${context} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} ${request}= Output request Output response [return] ${request} ${response} @@ -278,7 +278,7 @@ Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} + ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} ${request}= Output request Output response [return] ${response} @@ -295,7 +295,7 @@ Update Context Source Registration Using Session Delete Context Source Registration With Return [Arguments] ${registration_id} - ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} Output request Output response [return] ${response} @@ -305,7 +305,7 @@ Create Entity ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} Output request Output response @@ -315,7 +315,7 @@ Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} + ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} Output request Output response [return] ${response} @@ -334,7 +334,7 @@ Append Attribute To Temporal Entity [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} + ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -354,7 +354,7 @@ Modify Attribute Instance From Temporal Entity &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} + ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} Output request Output response [return] ${response} @@ -367,14 +367,14 @@ Delete Attribute From Temporal Entity Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} Output request Output response [return] ${response} Delete Temporal Representation Of Entity With Returning Response [Arguments] ${temporal_entity_representation_id} - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} Output request Output response [return] ${response} @@ -393,7 +393,7 @@ Get Temporal Representation Of Entity Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request Output response [return] ${response} @@ -402,7 +402,7 @@ Delete Attribute Instance From Temporal Entity [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} &{headers}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} headers=${headers} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} headers=${headers} Output request Output response [return] ${response} @@ -411,7 +411,7 @@ Update Temporal Representation Of Entity Selecting Content Type [Arguments] ${temporal_entity_representation_id} ${attrId} ${instanceId} ${fragment_filename} ${content_type} ${temporal_entity_fragment}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} body=${temporal_entity_fragment} headers=${headers} + ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} body=${temporal_entity_fragment} headers=${headers} Output request Output response [return] ${response} @@ -422,7 +422,7 @@ Batch Create Entities Set To Dictionary ${headers} Content-Type ${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} + ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} Output request Output response Set Test Variable ${response} @@ -430,7 +430,7 @@ Batch Create Entities Batch Upsert Entities [Arguments] @{entities_to_be_upserted} ${update_option}=replace &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} + ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} Output request Output response Set Test Variable ${response} @@ -438,7 +438,7 @@ Batch Upsert Entities Batch Update Entities [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} + ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} Output request Output response Set Test Variable ${response} @@ -446,7 +446,7 @@ Batch Update Entities Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} + ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Run Keyword If not ${teardown} Set Test Variable ${response} @@ -474,7 +474,7 @@ Create Temporal Representation Of Entity ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} + ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} Output request Output response @@ -494,7 +494,7 @@ Retrieve Temporal Representation Of Entity Run Keyword If '${endTimeAt}'!='' Set To Dictionary ${params} endTimeAt=${endTimeAt} Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} @@ -523,7 +523,7 @@ Query Temporal Representation Of Entities Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} @@ -534,7 +534,7 @@ Query Temporal Representation Of Entities Via Post Set To Dictionary ${headers} Content-Type ${content_type} Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} - ${response}= POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} + ${response}= REST.POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} Output request Output response Set Test Variable ${response} @@ -542,7 +542,7 @@ Query Temporal Representation Of Entities Via Post Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} Output request Output response @@ -550,7 +550,7 @@ Create Context Source Registration [Arguments] ${context_source_registration_payload} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${context_source_registration_payload} headers=${headers} + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${context_source_registration_payload} headers=${headers} ${request}= Output request Output response @@ -560,7 +560,7 @@ Create Context Source Registration Update Context Source Registration [Arguments] ${context_source_registration_id} ${update_fragment} - ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} body=${update_fragment} + ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} body=${update_fragment} Output request Output response @@ -588,7 +588,7 @@ Query Context Source Registrations Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response @@ -597,7 +597,7 @@ Query Context Source Registrations Delete Context Source Registration [Arguments] ${context_source_registration_id} - ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} Output request Output response @@ -609,7 +609,7 @@ Retrieve Context Source Registration &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} Output request Output response @@ -620,7 +620,7 @@ Create Context Source Registration Subscription &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} ${request}= Output request Output response @@ -630,7 +630,7 @@ Create Context Source Registration Subscription Update Context Source Registration Subscription [Arguments] ${subscription_id} ${subscription_update_fragment} - ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} + ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} Output request Output response @@ -642,7 +642,7 @@ Retrieve Context Source Registration Subscription &{headers}= Create Dictionary Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} Output request Output response @@ -658,7 +658,7 @@ Query Context Source Registration Subscriptions Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response @@ -667,7 +667,7 @@ Query Context Source Registration Subscriptions Delete Context Source Registration Subscription [Arguments] ${subscription_id} - ${response}= DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Output request Output response @@ -687,7 +687,7 @@ Create Subscription Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} Output request Output response [return] ${response} @@ -697,7 +697,7 @@ Create Subscription From Subscription Payload &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} Output request Output response @@ -716,7 +716,7 @@ Update Subscription Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} - ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} + ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response Set Test Variable ${response} @@ -727,7 +727,7 @@ Update Subscription With Payload &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${payload} headers=${headers} + ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${payload} headers=${headers} Output request Output response Set Test Variable ${response} @@ -735,7 +735,7 @@ Update Subscription With Payload Delete Subscription [Arguments] ${subscription_id} - ${response}= DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} Output request Output response Set Suite Variable ${response} @@ -751,7 +751,7 @@ Query Subscriptions Run Keyword If '${offset}'!='' Set To Dictionary ${params} offset=${offset} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response @@ -764,7 +764,7 @@ Retrieve Subscription Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} ${request}= Output request Output response Set Test Variable ${response} @@ -774,7 +774,7 @@ Update Context Source Registration Subscription By Selecting Content Type [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} + ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response [return] ${response} @@ -783,7 +783,7 @@ Retrieve Entity Types With Return [Arguments] ${accept}=${EMPTY} &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} Output request Output response [return] ${response} @@ -792,7 +792,7 @@ Retrieve Entity Type With Return [Arguments] ${type} ${accept}=${EMPTY} &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} Output request Output response [return] ${response} @@ -801,7 +801,7 @@ Retrieve Attributes With Return [Arguments] ${accept}=${EMPTY} &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} Output request Output response [return] ${response} @@ -810,7 +810,7 @@ Retrieve Attribute With Return [Arguments] ${attribute_name} ${accept}=${EMPTY} &{headers}= Create Dictionary Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} Output request Output response [return] ${response} @@ -818,7 +818,7 @@ Retrieve Attribute With Return Create Context Source Registration Subscription With Return [Arguments] ${subscription_payload} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} ${request}= Output request Output ${response} [return] ${request} ${response} @@ -826,7 +826,7 @@ Create Context Source Registration Subscription With Return Batch Upsert Entities By Selecting Content Type [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} + ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} Output request Output response Set Test Variable ${response} @@ -834,7 +834,7 @@ Batch Upsert Entities By Selecting Content Type Batch Update Entities By Selecting Content Type [Arguments] @{entities_to_be_updated} ${content_type}=${CONTENT_TYPE_LD_JSON} ${overwrite_option}=overwrite &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} + ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} Output request Output response Set Test Variable ${response} @@ -842,7 +842,7 @@ Batch Update Entities By Selecting Content Type Batch Delete Entities By Selecting Content Type [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} + ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Run Keyword If not ${teardown} Set Test Variable ${response} @@ -869,7 +869,7 @@ Query Context Source Registrations With Return Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} ${request}= Output request Output response @@ -899,7 +899,7 @@ Query Temporal Representation Of Entities With Return Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} ${request}= Output request Output response [return] ${request} ${response} diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index a5cf2f64..6216528f 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -6,9 +6,6 @@ robot --outputdir ./results ./TP/NGSI-LD # run all tests with base url overriden robot --variable url:"URL_HERE" --outputdir ./results . -# specify which tests are mandatory -robot --critical mandatory --outputdir ./results . - # run by specific tag(s) robot --include mandatory --outputdir ./results . -- GitLab From 685d300ab5b2fe105d144eb0ee19ba569ba8ea61 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 31 May 2023 14:05:06 +0000 Subject: [PATCH 295/442] chore: add missing implicit imports and refactor variables declaration for improved IDE integration --- README.md | 21 ++++++++++++++++----- resources/ApiUtils.resource | 1 + resources/AssertionUtils.resource | 5 +++++ resources/JsonUtils.resource | 1 + resources/MockServerUtils.resource | 1 + resources/NotificationUtils.resource | 2 +- resources/variables.py | 21 ++++++++------------- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 45f30139..3c0126f6 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ * Confirm its installation with: -```$ python --version``` (Ubuntu) +```$ python3 --version``` (Ubuntu) ```$ python3 --version``` (MacOS) * At this point, you can launch Python3 interpreter: -```$ python``` (Ubuntu) +```$ python3``` (Ubuntu) ```$ python3``` (MacOS) @@ -28,6 +28,15 @@ * In case pip is not installed, [follow the official pip installation guide](https://pip.pypa.io/en/latest/installing/). +## Install IDE (PyCharm) + +* Install [PyCharm](https://www.jetbrains.com/fr-fr/pycharm/download) + +* Install [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server) + +* Define as variable the path of the working directory: in Settings > Languages & Frameworks > Robot Framework (Project), +insert the following: `{"EXECDIR": "{path}/auth-test-suite"}` + ## Install IDE (VSCode) * Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux) @@ -41,14 +50,16 @@ ## Configure the environment In the `resources/variables.py` file, configure the following: -* URL of the context broker under test (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1) -* Notification server host and port (an address accessible from the context broker) +* `url` : It is the url of the context broker which is to be tested (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1). +* `notification_server_host` and `notification_server_port` : This is the address and port used to create the local server to listen to notifications (the address must be accessible by the context broker). +* `send_notification_server_host` and `send_notification_server_port` : This is the address and port used when creating the subscription on the context broker (generally it is the same information as `notification_server_host` and `notification_server_port`). +* `context_source_host` and `context_source_port` : The address and port used for the context source. ## Install the project requirements Browse the base project root folder and execute the following command: -```$ python -m pip install -r requirements.txt``` (Ubuntu) +```$ python3 -m pip install -r requirements.txt``` (Ubuntu) ```$ python3 -m pip install -r requirements.txt``` (MacOS) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e4e35282..fe594ea9 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -5,6 +5,7 @@ Library REST ${url} Library RequestsLibrary Library OperatingSystem Library Collections +Library JSONLibrary *** Variables *** ${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5a422f3b..5f60fae0 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,5 +1,10 @@ *** Settings *** Library ${EXECDIR}/libraries/assertionUtils.py +Library RequestsLibrary +Library Collections +Library JSONLibrary +Library REST +Library String *** Variable *** ${id_regex_expr}= root\\['id'\\] diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 726f3bd3..0617a816 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -2,6 +2,7 @@ Library String Library DateTime Library JSONLibrary +Variables ${EXECDIR}/resources/variables.py *** Variable *** ${date_format}= %Y-%m-%dT%H:%M:%SZ diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index fa46cdd3..8290f67d 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -1,6 +1,7 @@ *** Settings *** Documentation Mock http server for subscriber Library HttpCtrl.Server +Variables ${EXECDIR}/resources/variables.py *** Keywords *** Start Context Source Mock Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index f12791b9..43af2820 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -5,13 +5,13 @@ Library Collections Library HttpCtrl.Server Library ${EXECDIR}/libraries/assertionUtils.py Library ${EXECDIR}/libraries/dateTimeUtils.py +Variables ${EXECDIR}/resources/variables.py *** Variable *** ${notification_type}= ContextSource Notfication ${date_format}= %Y-%m-%dT%H:%M:%SZ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ - *** Keywords *** Start Local Server [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} diff --git a/resources/variables.py b/resources/variables.py index f24138c4..f0c933b8 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,13 +1,8 @@ -def get_variables(arg=None): - variables = { - 'url': 'localhost:8080/ngsi-ld/v1', - 'ngsild_test_suite_context': 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld', - 'notification_server_host': '0.0.0.0', - 'notification_server_port': 8085, - 'send_notification_server_host': '0.0.0.0', - 'send_notification_server_port': 8085, - 'context_source_host': '0.0.0.0', - 'context_source_port': 8086 - } - return variables - \ No newline at end of file +url = 'localhost:8080/ngsi-ld/v1' +ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' +notification_server_host = '0.0.0.0' +notification_server_port = 8085 +send_notification_server_host = '0.0.0.0' +send_notification_server_port = 8085 +context_source_host = '0.0.0.0' +context_source_port = 8086 -- GitLab From 802275019d6e78f8ce7a326672aedd00b28ce76a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 31 May 2023 14:09:08 +0000 Subject: [PATCH 296/442] chore: run Robotidy on all TCs and resources files --- .idea/runConfigurations/Check_Format.xml | 24 + .idea/runConfigurations/Format_Files.xml | 23 + .pre-commit-config.yaml | 6 + README.md | 37 +- TP/NGSI-LD/CommonBehaviours/043.robot | 71 +- TP/NGSI-LD/CommonBehaviours/044_01.robot | 45 +- TP/NGSI-LD/CommonBehaviours/044_02.robot | 62 +- TP/NGSI-LD/CommonBehaviours/044_03.robot | 58 +- TP/NGSI-LD/CommonBehaviours/044_04.robot | 38 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 27 +- .../027_01_01.robot | 39 +- .../027_01_02.robot | 37 +- .../RetrieveAvailableAttributes/025_01.robot | 46 +- .../024_01_01.robot | 45 +- .../024_01_02.robot | 43 +- .../RetrieveAvailableEntityTypes/022_01.robot | 56 +- .../026_01.robot | 46 +- .../023_01.robot | 56 +- .../Entity/QueryEntities/019_01_01.robot | 44 +- .../Entity/QueryEntities/019_01_02.robot | 50 +- .../Entity/QueryEntities/019_01_03.robot | 41 +- .../Entity/QueryEntities/019_01_04.robot | 48 +- .../Entity/QueryEntities/019_01_05.robot | 42 +- .../Entity/QueryEntities/019_02_01.robot | 44 +- .../Entity/QueryEntities/019_02_02.robot | 50 +- .../Entity/QueryEntities/019_02_03.robot | 41 +- .../Entity/QueryEntities/019_02_04.robot | 44 +- .../Entity/QueryEntities/019_02_05.robot | 41 +- .../Entity/QueryEntities/019_03_01.robot | 42 +- .../Entity/QueryEntities/019_03_02.robot | 45 +- .../Entity/QueryEntities/019_03_03.robot | 40 +- .../Entity/QueryEntities/019_03_04.robot | 38 +- .../Entity/QueryEntities/019_03_05.robot | 50 +- .../Entity/QueryEntities/019_04.robot | 47 +- .../Entity/QueryEntities/019_05.robot | 47 +- .../Entity/QueryEntities/019_06.robot | 50 +- .../Entity/RetrieveEntity/018_01_01.robot | 22 +- .../Entity/RetrieveEntity/018_01_02.robot | 38 +- .../Entity/RetrieveEntity/018_01_03.robot | 29 +- .../Entity/RetrieveEntity/018_02.robot | 25 +- .../Entity/RetrieveEntity/018_03_01.robot | 19 +- .../Entity/RetrieveEntity/018_03_02.robot | 33 +- .../Entity/RetrieveEntity/018_04.robot | 29 +- .../Entity/RetrieveEntity/018_05.robot | 26 +- .../Entity/RetrieveEntity/018_06.robot | 50 +- .../021_01.robot | 70 +- .../021_02.robot | 56 +- .../021_03.robot | 56 +- .../021_04.robot | 55 +- .../021_05.robot | 41 +- .../021_06.robot | 52 +- .../021_07.robot | 56 +- .../021_08.robot | 56 +- .../021_09.robot | 68 +- .../021_10.robot | 44 +- .../021_11.robot | 61 +- .../021_12.robot | 34 +- .../021_13.robot | 62 +- .../020_01.robot | 31 +- .../020_02.robot | 35 +- .../020_03.robot | 36 +- .../020_04.robot | 50 +- .../020_05.robot | 47 +- .../020_06.robot | 16 +- .../020_07.robot | 16 +- .../020_08.robot | 34 +- .../020_09.robot | 49 +- .../020_10.robot | 36 +- .../CreateBatchOfEntities/003_01.robot | 46 +- .../CreateBatchOfEntities/003_02.robot | 31 +- .../CreateBatchOfEntities/003_03.robot | 27 +- .../CreateBatchOfEntities/003_04.robot | 22 +- .../CreateBatchOfEntities/003_05.robot | 17 +- .../CreateBatchOfEntities/003_06.robot | 21 +- .../CreateBatchOfEntities/003_07.robot | 17 +- .../CreateBatchOfEntities/003_08.robot | 21 +- .../CreateBatchOfEntities/003_09.robot | 26 +- .../DeleteBatchOfEntities/006_01.robot | 21 +- .../DeleteBatchOfEntities/006_02.robot | 33 +- .../DeleteBatchOfEntities/006_03.robot | 27 +- .../UpdateBatchOfEntities/005_01.robot | 53 +- .../UpdateBatchOfEntities/005_02.robot | 55 +- .../UpdateBatchOfEntities/005_03.robot | 51 +- .../UpdateBatchOfEntities/005_04.robot | 27 +- .../UpsertBatchOfEntities/004_01.robot | 41 +- .../UpsertBatchOfEntities/004_02.robot | 55 +- .../UpsertBatchOfEntities/004_03.robot | 45 +- .../UpsertBatchOfEntities/004_04.robot | 49 +- .../UpsertBatchOfEntities/004_05.robot | 27 +- .../UpsertBatchOfEntities/004_06.robot | 27 +- .../Entities/CreateEntity/001_01.robot | 47 +- .../Entities/CreateEntity/001_02.robot | 28 +- .../Entities/CreateEntity/001_03.robot | 35 +- .../Entities/CreateEntity/001_04.robot | 25 +- .../Entities/CreateEntity/001_05.robot | 19 +- .../Entities/CreateEntity/001_06.robot | 28 +- .../Entities/CreateEntity/001_07.robot | 19 +- .../Entities/CreateEntity/001_08.robot | 28 +- .../Entities/CreateEntity/001_09.robot | 29 +- .../Entities/DeleteEntity/002_01.robot | 22 +- .../Entities/DeleteEntity/002_02.robot | 27 +- .../Entities/DeleteEntity/002_03.robot | 21 +- .../AppendEntityAttributes/010_01.robot | 67 +- .../AppendEntityAttributes/010_02.robot | 48 +- .../AppendEntityAttributes/010_03.robot | 23 +- .../DeleteEntityAttribute/013_01.robot | 53 +- .../DeleteEntityAttribute/013_02.robot | 46 +- .../DeleteEntityAttribute/013_03.robot | 48 +- .../PartialAttributeUpdate/012_01.robot | 47 +- .../PartialAttributeUpdate/012_02.robot | 62 +- .../PartialAttributeUpdate/012_03.robot | 61 +- .../UpdateEntityAttributes/011_01.robot | 46 +- .../UpdateEntityAttributes/011_02.robot | 54 +- .../UpdateEntityAttributes/011_03.robot | 23 +- .../007_01.robot | 53 +- .../007_02.robot | 29 +- .../009_01.robot | 29 +- .../009_02.robot | 34 +- .../009_03.robot | 25 +- .../008_01.robot | 38 +- .../AppendAttributes/014_01.robot | 38 +- .../AppendAttributes/014_02.robot | 43 +- .../AppendAttributes/014_03.robot | 33 +- .../DeleteAttribute/015_01.robot | 63 +- .../DeleteAttribute/015_02.robot | 61 +- .../DeleteAttribute/015_03.robot | 57 +- .../DeleteAttributeInstance/017_01.robot | 45 +- .../DeleteAttributeInstance/017_02.robot | 69 +- .../DeleteAttributeInstance/017_03.robot | 61 +- .../ModifyAttributeInstance/016_01.robot | 58 +- .../ModifyAttributeInstance/016_02.robot | 75 +- .../ModifyAttributeInstance/016_03.robot | 66 +- .../CreateSubscription/028_01.robot | 24 +- .../CreateSubscription/028_02.robot | 25 +- .../CreateSubscription/028_03.robot | 31 +- .../CreateSubscription/028_04.robot | 28 +- .../DeleteSubscription/032_01.robot | 25 +- .../DeleteSubscription/032_02.robot | 14 +- .../DeleteSubscription/032_03.robot | 29 +- .../Subscription/Notification/046_01.robot | 79 +- .../Subscription/Notification/046_02.robot | 86 +- .../Subscription/Notification/046_03.robot | 80 +- .../Subscription/Notification/046_04.robot | 81 +- .../Subscription/Notification/046_05.robot | 82 +- .../Subscription/Notification/046_06.robot | 71 +- .../Subscription/Notification/046_07.robot | 136 +- .../Subscription/Notification/046_08.robot | 121 +- .../Subscription/Notification/046_09.robot | 65 +- .../Subscription/Notification/046_10.robot | 86 +- .../Subscription/Notification/046_11.robot | 82 +- .../Subscription/Notification/046_12.robot | 101 +- .../Subscription/Notification/046_13.robot | 60 +- .../Subscription/Notification/046_14.robot | 85 +- .../QuerySubscriptions/031_01.robot | 59 +- .../QuerySubscriptions/031_02.robot | 72 +- .../RetrieveSubscription/030_01.robot | 22 +- .../RetrieveSubscription/030_02.robot | 14 +- .../RetrieveSubscription/030_03.robot | 31 +- .../UpdateSubscription/029_01.robot | 34 +- .../UpdateSubscription/029_02.robot | 26 +- .../UpdateSubscription/029_03.robot | 35 +- .../UpdateSubscription/029_04.robot | 35 +- .../UpdateSubscription/029_05.robot | 45 +- .../UpdateSubscription/029_06.robot | 42 +- .../UpdateSubscription/029_07.robot | 31 +- .../UpdateSubscription/029_08.robot | 31 +- .../UpdateSubscription/029_09.robot | 31 +- .../UpdateSubscription/029_10.robot | 42 +- .../UpdateSubscription/029_11.robot | 35 +- .../033_01_01.robot | 28 +- .../033_01_02.robot | 28 +- .../033_01_03.robot | 30 +- .../033_02.robot | 34 +- .../033_03.robot | 21 +- .../033_04.robot | 32 +- .../033_05.robot | 27 +- .../033_06.robot | 31 +- .../033_07.robot | 31 +- .../033_08.robot | 31 +- .../033_09.robot | 32 +- .../035_01.robot | 23 +- .../035_02.robot | 34 +- .../035_03.robot | 19 +- .../037_01.robot | 60 +- .../037_02.robot | 18 +- .../037_03.robot | 39 +- .../037_04.robot | 39 +- .../037_05.robot | 40 +- .../037_06.robot | 51 +- .../037_07.robot | 60 +- .../037_08.robot | 39 +- .../037_09.robot | 69 +- .../037_10.robot | 71 +- .../037_11.robot | 65 +- .../036_01.robot | 27 +- .../036_02.robot | 16 +- .../036_03.robot | 39 +- .../036_04.robot | 39 +- .../036_05.robot | 54 +- .../034_01.robot | 46 +- .../034_02.robot | 57 +- .../034_03.robot | 28 +- .../038_01.robot | 34 +- .../038_02.robot | 28 +- .../038_03.robot | 29 +- .../038_04.robot | 29 +- .../038_05.robot | 33 +- .../038_06.robot | 29 +- .../038_07.robot | 33 +- .../038_08.robot | 44 +- .../038_09.robot | 23 +- .../042_01.robot | 23 +- .../042_02.robot | 16 +- .../042_03.robot | 16 +- .../NotificationBehaviour/047_01.robot | 43 +- .../NotificationBehaviour/047_02.robot | 57 +- .../NotificationBehaviour/047_03.robot | 49 +- .../NotificationBehaviour/047_04.robot | 48 +- .../NotificationBehaviour/047_05.robot | 45 +- .../NotificationBehaviour/047_06.robot | 41 +- .../NotificationBehaviour/047_07.robot | 53 +- .../NotificationBehaviour/047_08.robot | 50 +- .../NotificationBehaviour/047_09.robot | 52 +- .../NotificationBehaviour/047_10.robot | 48 +- .../NotificationBehaviour/047_11.robot | 49 +- .../NotificationBehaviour/047_12.robot | 50 +- .../NotificationBehaviour/047_13.robot | 48 +- .../NotificationBehaviour/047_14.robot | 48 +- .../NotificationBehaviour/047_15.robot | 48 +- .../NotificationBehaviour/047_16.robot | 63 +- .../041_01.robot | 45 +- .../041_02.robot | 65 +- .../041_03.robot | 68 +- .../041_04.robot | 32 +- .../040_01.robot | 31 +- .../040_02.robot | 16 +- .../040_03.robot | 16 +- .../039_01.robot | 36 +- .../039_02.robot | 21 +- .../039_03.robot | 25 +- .../039_04.robot | 42 +- .../039_05.robot | 39 +- pyproject.toml | 6 + requirements.txt | 3 +- resources/ApiUtils.resource | 1967 +++++++++++------ resources/AssertionUtils.resource | 492 +++-- resources/HttpUtils.resource | 8 +- resources/JsonUtils.resource | 103 +- resources/MockServerUtils.resource | 38 +- resources/NotificationUtils.resource | 119 +- 250 files changed, 7999 insertions(+), 4953 deletions(-) create mode 100644 .idea/runConfigurations/Check_Format.xml create mode 100644 .idea/runConfigurations/Format_Files.xml create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.idea/runConfigurations/Check_Format.xml b/.idea/runConfigurations/Check_Format.xml new file mode 100644 index 00000000..dbdb34d8 --- /dev/null +++ b/.idea/runConfigurations/Check_Format.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Format_Files.xml b/.idea/runConfigurations/Format_Files.xml new file mode 100644 index 00000000..e5c737c2 --- /dev/null +++ b/.idea/runConfigurations/Format_Files.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..54f26c88 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/MarketSquare/robotframework-tidy + id: robotidy + rev: 4.2.1 + hooks: + - id: robotidy diff --git a/README.md b/README.md index 3c0126f6..5c314cd0 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,38 @@ Browse the base project root folder and execute the following command: Further details on each library can be found in [PyPi](https://pypi.org/) and [Robot Framework Standard Libraries](http://robotframework.org/robotframework/#standard-libraries) +## Run configurations (PyCharm) + +Two sample configurations have been created: + +- one to check if there are syntax or format changes to be done according to Robotidy (`Check Format`) +- one to make the syntax and format changes according to Robotidy (`Format Files`) + +To launch a run configuration, choose one of the two configurations from the Run menu and click on it to run it. + +## Pre commit + +Before each commit, a formatting according to the rules of [Robotidy](https://github.com/MarketSquare/robotframework-tidy) + is done for files with the `.robot` or `.resource` extension. If nothing has been modified, the commit is done normally. + Otherwise, the commit displays an error message with all the modifications made by Robotidy to format the file. Modified + files can then be added to the commit. + +To use it, install `pre-commit` with the following commands (using pip): + +```$ pip install pre-commit``` + +Then install the Git hook scripts: + +```$ pre-commit install``` + +Now, it will run automatically on every commit. + +To manually launch the tool, the following command can be used: + +```$ ./venv/bin/python -m robotidy .``` + +Further details can be found on the [pre-commit](https://pre-commit.com) site. + ## Execute the tests Configure the context broker URL in the resources/variables.py file @@ -91,10 +123,6 @@ A sample report can be seen at https://robotmetrics.netlify.app/# ```$ python3 -m robot.testdoc TP/NGSI-LD api_docs/TestCases.html``` -## Tidy the Test Cases - -```$ python3 -m robot.tidy --recursive TP/NGSI-LD``` - # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) @@ -103,6 +131,7 @@ A sample report can be seen at https://robotmetrics.netlify.app/# * [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary) * [Requests Library](https://github.com/MarketSquare/robotframework-requests) * [Deep Diff](https://github.com/seperman/deepdiff) +* [Robotidy Library ](https://github.com/MarketSquare/robotframework-tidy) # Useful links diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index d3b2f18b..3643488a 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -1,53 +1,68 @@ *** Settings *** -Documentation Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${expected_status_code}= 503 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-unretrievable-context-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** Variable *** -${expected_status_code}= 503 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-unretrievable-context-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld *** Test Cases *** 043_01 Create entity - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create subscription) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription) [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) [Tags] te-create 5_2_2 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Batch entity create) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create) [Tags] be-create 5_2_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -56,16 +71,18 @@ ${registration_filename}= csourceRegistrations/context-source-registration-un @{entities_to_be_created}= Create List ${first_entity} ${second_entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To ${expected_status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration - [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) + [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) [Tags] csr-create 5_2_2 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 6101bbdb..32b3ecf9 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -1,26 +1,37 @@ *** Settings *** -Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.json +${attribute_id}= brandName +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-brandname-fragment.json -${attribute_id}= brandName -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json *** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${vehicle_fragment} + ... ${CONTENT_TYPE_MERGE_PATCH_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -30,6 +41,10 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-sample. ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_fragment} + ... ${CONTENT_TYPE_MERGE_PATCH_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 0793a171..475f6508 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -1,28 +1,34 @@ *** Settings *** -Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= subscriptions/subscription-sample.jsonld +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +${registration_type}= Vehicle +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${teatype}= Vehicle +${content_type}= application/json -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= subscriptions/subscription-sample.jsonld -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld -${registration_type}= Vehicle -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${teatype}= Vehicle -${content_type}= application/json *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) [Tags] e-query 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response['status']} @@ -46,11 +52,15 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) [Tags] csr-query 6_3_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} accept=*/* + ${request} ${response}= Query Context Source Registrations With Return + ... id=${registration_id} + ... type=${registration_type} + ... context=${ngsild_test_suite_context} + ... accept=*/* Check Response Status Code 200 ${response['status']} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -60,9 +70,17 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) [Tags] te-query 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} accept=*/* + ${request} ${response}= Query Temporal Representation Of Entities With Return + ... entity_types=${teatype} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... context=${ngsild_test_suite_context} + ... accept=*/* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Headers Containing Content-Type set to ${response} ${content_type} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index efc916b2..f0b61393 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -1,31 +1,41 @@ *** Settings *** -Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${vehicle_attribute}= speed +${vehicle_fragment}= vehicle-brandname-fragment.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld +${tea_id_prefix}= urn:ngsi-ld:Vehicle: +${tea_filename}= vehicle-temporal-representation-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${content_type}= application/xml -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= speed -${vehicle_fragment}= vehicle-brandname-fragment.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${content_type}= application/xml *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${content_type} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${vehicle_attribute} + ... ${vehicle_fragment} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -43,7 +53,10 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) [Tags] e-create 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -72,6 +85,9 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) [Tags] te-create 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${tea_filename} + ... ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index a46c31c4..1f8b1b7e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -1,23 +1,29 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${accept}= application/xml -${status_code}= 406 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${accept}= application/xml +${status_code}= 406 +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-simple-attributes-sample.jsonld +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld + *** Test Cases *** 044_04_01_endpoint get /entities/{entityId} [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) [Tags] e-query 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} @@ -49,5 +55,9 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... accept=${accept} Check Response Status Code Set To ${status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index f8b63f49..20f32c37 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${accept}= application/geo+json +${status_code}= 406 +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -*** Variable *** -${accept}= application/geo+json -${status_code}= 406 -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** 044_05_01 Retrieve subscription by id @@ -25,7 +28,11 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-08-01T12:05:00Z + ... accept=${accept} Check Response Status Code Set To ${status_code} 044_05_03 Query context source registration diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index f4cf0a39..cf01a312 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -1,28 +1,39 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Case *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Attribute Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute [Tags] ed-attr 5_7_10 Retrieve Attribute attribute_name=airQualityLevel Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index 1cf3cc6c..c2fb7083 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/attribute-027-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/attribute-027-01-expectation.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Attribute [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Tags] ed-attr 5_7_10 @@ -19,10 +23,15 @@ Retrieve Detailed Representation Of Available Attribute Check Response Status Code Set To 200 Check Response Body Containing Attribute element ${expectation_file} + *** Keywords *** Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index be48c9dd..17bb74b3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -1,35 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Available Attributes + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json - [Tags] ed-attrs 5_7_8 + [Tags] ed-attrs 5_7_8 + ${EMPTY} types/expectations/attribute-list-025-01-01-expectation.json +WithJsonLdContext [Tags] ed-attrs 5_7_8 + ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-list-025-01-02-expectation.json - [Tags] ed-attrs 5_7_8 *** Keywords *** Retrieve Available Attributes - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD attributes + [Arguments] ${context} ${expectation_file} Retrieve Attributes ${context} Check Response Status Code Set To 200 Check Response Body Containing AttributeList element ${expectation_file} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index 850b8d6f..2ba0b2bf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -1,30 +1,45 @@ *** Settings *** -Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Case *** +Documentation Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Entity Type Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type [Tags] ed-type 5_7_7 Retrieve Entity Type type=Building Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index fe997933..761260d9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a detailed representation of a specified NGSI-LD entity type + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${expectation_file}= types/expectations/entity-type-info-024-01-expectation.json + + +*** Test Cases *** Retrieve Detailed Representation Of Available Entity Type [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type [Tags] ed-type 5_7_7 @@ -19,12 +23,21 @@ Retrieve Detailed Representation Of Available Entity Type Check Response Status Code Set To 200 Check Response Body Containing EntityTypeInfo element ${expectation_file} + *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index e3a33a8e..22b2d42a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -1,30 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve a list of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list of NGSI-LD entity types + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Available Entity Types + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json - [Tags] ed-types 5_7_5 + [Tags] ed-types 5_7_5 + ${EMPTY} types/expectations/entity-type-list-022-01-01-expectation.json +WithJsonLdContext [Tags] ed-types 5_7_5 + ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-list-022-01-02-expectation.json - [Tags] ed-types 5_7_5 *** Keywords *** Retrieve Available Entity Types - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list of NGSI-LD entity types + [Arguments] ${context} ${expectation_file} Retrieve Entity Types ${context} Check Response Status Code Set To 200 Check Response Body Containing EntityTypeList element ${expectation_file} @@ -32,8 +36,16 @@ Retrieve Available Entity Types Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${first_filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${second_filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index e6df2a5c..77ac8a2d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -1,35 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Details Of Available Attributes -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Details Of Available Attributes + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/attribute-026-01-01-expectation.json - [Tags] ed-attrs-details 5_7_9 + [Tags] ed-attrs-details 5_7_9 + ${EMPTY} types/expectations/attribute-026-01-01-expectation.json +WithJsonLdContext [Tags] ed-attrs-details 5_7_9 + ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/attribute-026-01-02-expectation.json - [Tags] ed-attrs-details 5_7_9 *** Keywords *** Retrieve Details Of Available Attributes - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes + [Arguments] ${context} ${expectation_file} Retrieve Attributes context=${context} details=${TRUE} Check Response Status Code Set To 200 Check Response Body Containing Attribute element ${expectation_file} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index b03c52f3..3f76ca0e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -1,30 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Details Of Available Entity Types -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${first_filename}= building-simple-attributes-sample.json -${second_filename}= vehicle-simple-attributes-sample.json - -*** Test Cases *** CONTEXT EXPECTATION_FILE +Documentation Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Details Of Available Entity Types + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${first_filename}= building-simple-attributes-sample.json +${second_filename}= vehicle-simple-attributes-sample.json + + +*** Test Cases *** CONTEXT EXPECTATION_FILE WithoutJsonLdContext - ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json - [Tags] ed-types-details 5_7_6 + [Tags] ed-types-details 5_7_6 + ${EMPTY} types/expectations/entity-type-023-01-01-expectation.json +WithJsonLdContext [Tags] ed-types-details 5_7_6 + ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json -WithJsonLdContext ${ngsild_test_suite_context} types/expectations/entity-type-023-01-02-expectation.json - [Tags] ed-types-details 5_7_6 *** Keywords *** Retrieve Details Of Available Entity Types - [Arguments] ${context} ${expectation_file} [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types + [Arguments] ${context} ${expectation_file} Retrieve Entity Types context=${context} details=${TRUE} Check Response Status Code Set To 200 Check Response Body Containing EntityType element ${expectation_file} @@ -32,8 +36,16 @@ Retrieve Details Of Available Entity Types Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Create Entity Selecting Content Type ${first_filename} ${first_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} - Create Entity Selecting Content Type ${second_filename} ${second_entity_id} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${first_filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${second_filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index ddecc8f5..6a44b0d9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -1,36 +1,54 @@ *** Settings *** -Documentation Check that you can query several entities based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on ids -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 1bbc2efd..a33dd671 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -1,41 +1,57 @@ *** Settings *** -Documentation Check that you can query several entities based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the entities types -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking + *** Test Cases *** Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${parking_filename} + ... ${parking_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} - Check Response Body Containing List Containing Entity Elements With Different Types ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity Elements With Different Types + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index 9e10a94a..e4dece98 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query several entities based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on the given id pattern -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + *** Test Cases *** Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} - ${response}= Query Entities entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities + ... entity_id_pattern=${entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 65ac3884..1cdc121f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -1,35 +1,51 @@ *** Settings *** -Documentation Check that you can query several entities based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities based on attribute names + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${filename2}= building-minimal-sample.jsonld +${expectation_filename}= building-attributes-query-expectation.json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${filename2}= building-minimal-sample.jsonld -${expectation_filename}= building-attributes-query-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename2} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename2} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 9a8d7ab3..754d15c2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -1,34 +1,50 @@ *** Settings *** -Documentation Check that you can query entitites based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites based on a list of properties -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-geoproperty-query-expectation.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location + *** Test Cases *** Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Query Entities + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geometry_property} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index f194aab7..f27065ef 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -1,36 +1,54 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on ids -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities Via POST + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index f5a903a5..854ba8a4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -1,41 +1,57 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the entities types -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the entities types -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${parking_filename}= parking-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${parking_filename}= parking-simple-attributes-sample.jsonld ${expectation_filename}= two-types-vehicle-offstreetparking-expectation.jsonld ${building_entity_type}= https://ngsi-ld-test-suite/context#Building -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking + *** Test Cases *** Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${parking_filename} ${parking_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${parking_filename} + ... ${parking_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entity_types_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entity_types_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 38397fdf..32450318 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on the given id pattern -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_id_pattern}= urn:ngsi-ld:Building:.* +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_id_pattern}= urn:ngsi-ld:Building:.* + *** Test Cases *** Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST entity_id_pattern=${entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities Via POST + ... entity_id_pattern=${entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 04edd2e6..bc09646d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -1,33 +1,49 @@ *** Settings *** -Documentation Check that you can query several entities via POST Interaction based on attribute names -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query several entities via POST Interaction based on attribute names + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${expectation_filename}= building-minimal-expectation.json +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${expectation_filename}= building-minimal-expectation.json -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_retrieved} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_retrieved} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 8a7c4828..b4d9dfe6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that you can query entitites via POST Interaction based on a list of properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entitites via POST Interaction based on a list of properties -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld ${expectation_filename}= building-minimal-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${geometry_property}= location +${entity_type}= https://ngsi-ld-test-suite/context#Building +${geometry_property}= location + *** Test Cases *** Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} geoproperty=${geometry_property} + ${response}= Query Entities Via POST + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index b1fe0765..1538368d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -1,34 +1,48 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested ids are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested ids are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${entity_invalid_id_one}= thisisaninvaliduri1 +${entity_invalid_id_two}= thisisaninvaliduri2 -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${entity_invalid_id_one}= thisisaninvaliduri1 -${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index 4e9e3e3d..c6e8d8d2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -1,34 +1,49 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested entity types are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested entity types are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${building_filename}= building-minimal-sample.jsonld +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld +${invalid_entity_type_one}= type +${invalid_entity_type_two}= invalid_entity_type_two -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${building_filename}= building-minimal-sample.jsonld -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${invalid_entity_type_one}= type -${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${building_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${building_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${vehicle_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${vehicle_filename} + ... ${vehicle_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_entity_type_one} ${invalid_entity_type_two} + ${entity_types_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${invalid_entity_type_one} + ... ${invalid_entity_type_two} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + *** Keywords *** Delete Entities [Arguments] ${building_entity_id} ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 9c86bba1..2ab80b97 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -1,32 +1,46 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested id pattern is incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested id pattern is incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_entity_id_pattern}= invalid_entity_id_pattern** -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Test Cases *** Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_id_pattern=${invalid_entity_id_pattern} entity_types=${entity_types_to_be_retrieved} + ${response}= Query Entities + ... entity_id_pattern=${invalid_entity_id_pattern} + ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index db5abf46..12ab098d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -1,33 +1,45 @@ *** Settings *** -Documentation Check that you cannot query entities if the requested attribute names are incorrect -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entities if the requested attribute names are incorrect + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${invalid_attribute_one}= id +${invalid_attribute_two}= type -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= id -${invalid_attribute_two}= type *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index f603c3f1..1f1255e1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -1,35 +1,53 @@ *** Settings *** -Documentation Check that you cannot query entitites if the request has a wrong geometryProperty -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query entitites if the request has a wrong geometryProperty + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld +${entity_type}= Building +${georel}= invalid +${geometry}= Point +${coordinates}= [-8.503,41.202] +${geoproperty}= location -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld -${entity_type}= Building -${georel}= invalid -${geometry}= Point -${coordinates}= [-8.503,41.202] -${geoproperty}= location *** Test Cases *** Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geoproperty} georel=${georel} geometry=${geometry} coordinates=${coordinates} context=${ngsild_test_suite_context} + ${response}= Query Entities + ... entity_types=${entity_types_to_be_retrieved} + ... geoproperty=${geoproperty} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... context=${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index 4dd311ff..9cb3a2af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -1,37 +1,56 @@ *** Settings *** -Documentation Check that the queried entities by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by Id can be returned in a simplified representation -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${entity_type}= https://ngsi-ld-test-suite/context#Building +${options_parameter}= keyValues +${entity_type}= https://ngsi-ld-test-suite/context#Building + *** Test Cases *** Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} options=${options_parameter} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... options=${options_parameter} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 9fa6c4eb..b903862f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -1,37 +1,56 @@ *** Settings *** -Documentation Check that the queried entities by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entities by id can be returned in a geoJSON format -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${entity_type}= https://ngsi-ld-test-suite/context#Building -${accept_header}= application/geo+json +${entity_type}= https://ngsi-ld-test-suite/context#Building +${accept_header}= application/geo+json + *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} accept=${accept_header} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... accept=${accept_header} Check Response Status Code 200 ${response['status']} - Check Response Body Containing List Containing Entity elements ${expectation_filename} ${entities_ids_to_be_compared} ${response['body']} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response['body']} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 7ac6e809..7d239a29 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -1,36 +1,56 @@ *** Settings *** -Documentation Check that you can query entities specifying a maximum number of results -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query entities specifying a maximum number of results + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${entity_type}= https://ngsi-ld-test-suite/context#Building +${limit}= 2 -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${limit}= 2 *** Test Cases *** Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${first_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${second_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${third_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${third_entity_id} + ${entities_ids_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${first_entity_id} + ... ${second_entity_id} + ... ${third_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_ids=${entities_ids_to_be_retrieved} entity_types=${entity_types_to_be_retrieved} limit=${limit} + ${response}= Query Entities + ... entity_ids=${entities_ids_to_be_retrieved} + ... entity_types=${entity_types_to_be_retrieved} + ... limit=${limit} Check Response Status Code 200 ${response['status']} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Number Of Entities ${entity_type} ${2} + Check Response Body Containing Number Of Entities ${entity_type} ${2} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index f1d81a93..98120195 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -1,20 +1,26 @@ *** Settings *** -Documentation Check that you can get an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can get an entity by id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-expectation.jsonld + *** Test Cases *** 018_01_01_Get an entity by id [Documentation] Check that you can get an entity by id [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index a4badafb..88ea67fa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -1,25 +1,37 @@ *** Settings *** -Documentation Check that you can query some attributes from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query some attributes from an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${expectation_filename}= building-simple-attributes-query-expectation.jsonld +${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel +${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${expectation_filename}= building-simple-attributes-query-expectation.jsonld -${attribute_airqualitylevel}= https://ngsi-ld-test-suite/context#airQualityLevel -${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCategory *** Test Cases *** 018_01_02_Query some attributes from an entity [Documentation] Check that you can query some attributes from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_airqualitylevel} ${attribute_subcategory} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${attributes_to_be_retrieved}= Catenate + ... SEPARATOR=, + ... ${attribute_airqualitylevel} + ... ${attribute_subcategory} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index ba2888ba..2b311a5a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that you can query the geometry property from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can query the geometry property from an entity -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-geoproperty-query-expectation.jsonld -${geometry_property}= location +${geometry_property}= location + *** Test Cases *** 018_01_03_Query the geometry property from an entity [Documentation] Check that you can query the geometry property from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} geoproperty=${geometry_property} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... geoproperty=${geometry_property} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index e03d9525..2ba3ed12 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot get an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Get Entity With Invalid/Missing Id +Documentation Check that you cannot get an entity with invalid/missing id -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01_Get an entity if the Entity Id is not present - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Get Entity With Invalid/Missing Id + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +018_02_01_Get an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 018_02_02_Get an entity if the Entity Id is not a valid URI - thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Get Entity With Invalid/Missing Id - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 50e53357..56ef5bb5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -1,11 +1,14 @@ *** Settings *** -Documentation Check that you cannot get an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if the entity id is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** Get an entity if the Entity Id is not known to the system @@ -14,5 +17,7 @@ Get an entity if the Entity Id is not known to the system ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 01e547bb..630c6754 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -1,24 +1,35 @@ *** Settings *** -Documentation Check that you cannot get an entity if an attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot get an entity if an attribute is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld +${attribute_not_known}= property_not_found -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld -${attribute_not_known}= property_not_found *** Test Cases *** Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} attrs=${attributes_to_be_retrieved} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... attrs=${attributes_to_be_retrieved} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 1b623a6e..1370d9c2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that the queried entity by Id can be returned in a simplified representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by Id can be returned in a simplified representation -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.jsonld -${options_parameter}= keyValues +${options_parameter}= keyValues + *** Test Cases *** Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} options=${options_parameter} + ${request} ${response}= Query Entity + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... options=${options_parameter} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 828c3b0d..5d5eb854 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -1,22 +1,28 @@ *** Settings *** -Documentation Check that the queried entity by id can be returned in a geoJSON format -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the queried entity by id can be returned in a geoJSON format -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute-sample.jsonld ${expectation_filename}= building-simple-attributes-simplified-expectation.json -${options_parameter}= keyValues -${accept_header}= application/geo+json +${options_parameter}= keyValues +${accept_header}= application/geo+json + *** Test Cases *** Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} Check Response Status Code 200 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 5854b089..40246d08 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -1,38 +1,46 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entity -Suite Teardown Delete Created Entity -Test Template Check Json-LD Resolution When retrieving an entity - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json -${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entity +Suite Teardown Delete Created Entity +Test Template Check JSON-LD Resolution When retrieving an entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json +${empty_jsonld_expectation_filename}= building-simple-attributes-sample-expanded-expectation.json ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-compacted-expectation.json -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext - ${EMPTY} ${empty_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + [Tags] e-retrieve 6_3_5 + ${EMPTY} ${empty_jsonld_expectation_filename} CreationTimeJsonLdContext - ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} - [Tags] e-retrieve 6_3_5 + [Tags] e-retrieve 6_3_5 + ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} + *** Keywords *** -Check Json-LD Resolution When retrieving an entity - [Arguments] ${context} ${expected_payload} +Check JSON-LD Resolution When retrieving an entity [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Arguments] ${context} ${expected_payload} ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Set Suite Variable ${entity_id} Delete Created Entity diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 4835e721..1d280eb4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -1,42 +1,58 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld - -*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Before before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld + + +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +After [Tags] te-query 5_7_4 + after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld +Before [Tags] te-query 5_7_4 + before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities - [Arguments] ${timerel} ${timeAt} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities + [Arguments] ${timerel} ${timeAt} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index c9ddf4ea..73695a9d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -1,34 +1,52 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of certain attributes of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of certain attributes of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of certain attributes of entities [Documentation] Check that you can query the temporal evolution of certain attributes of entities [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... attrs=${temporal_attributes_to_be_retrieved} + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 8e4ae663..b48e938e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of the last N instances of entities attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of the last N instances of entities attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... lastN=${14} + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 91ec8bba..8ad92735 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -1,33 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities using a context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index aaaa9549..f6809bec 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -1,27 +1,38 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given type(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: +Documentation Check that you can query the temporal evolution of entities matching the given type(s) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld + -*** Test Case *** +*** Test Cases *** Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index a7109959..67c5a413 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -1,34 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given identifier(s) [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... entity_ids=${entity_ids_to_be_retrieved} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index 4c55cf96..c6ef14aa 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given id pattern -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given id pattern + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... entity_id_pattern=urn:ngsi-ld:Vehicle:.* + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index aab99ae5..8ea5288c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -1,33 +1,51 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld + + +*** Test Cases *** Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90 timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... ngsild_query=speed>90 + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} + *** Keywords *** Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index a2fde19f..7d2f24ab 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -1,40 +1,58 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld -${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld - -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Within Polygon contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE +Near Point [Tags] te-query 5_7_4 + near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld +Within Polygon [Tags] te-query 5_7_4 + contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities matching the given NGSI-LD geo-query - [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... geoproperty=${geoproperty} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index ea947e1d..544dc923 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -1,31 +1,43 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource -Suite Setup Create Initial Context Source Registration -Suite Teardown Delete Initial Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_url}= http://${context_source_host}:${context_source_port} - -*** Test Case *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Suite Setup Create Initial Context Source Registration +Suite Teardown Delete Initial Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_url}= http://${context_source_host}:${context_source_port} + + +*** Test Cases *** Query the temporal evolution of entities matching the given NGSI-LD context source filter [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} csf=endpoint=="${context_source_url}" timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... csf=endpoint=="${context_source_url}" + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Wait for redirected request Check Response Status Code Set To 200 + *** Keywords *** Create Initial Context Source Registration Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Context Source Registration Sample With Reachable Context Source + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 7f557d06..2b30e80d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -1,42 +1,57 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + *** Test Cases *** LIMIT Query Some entities - ${2} - [Tags] te-query 5_7_4 - + [Tags] te-query 5_7_4 + ${2} Query All entities - ${3} - [Tags] te-query 5_7_4 + [Tags] te-query 5_7_4 + ${3} + *** Keywords *** Query the temporal evolution of entities with a limit to the number of entities to be retrieved - [Arguments] ${limit} [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved + [Arguments] ${limit} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus,Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} limit=${limit} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... limit=${limit} + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Number Of Entities Vehicle ${limit} + Check Response Body Containing Number Of Entities Vehicle ${limit} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${third_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${third_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} Set Suite Variable ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index 8aea5ab2..dfed8f79 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot query the temporal evolution of entities with an invalid request or invalid request content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Case *** + +*** Test Cases *** Query the temporal evolution of entities with an invalid request [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request [Tags] te-query 5_7_4 - Query Temporal Representation Of Entities timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities + ... timerel=after + ... timeAt=2020-07-01T12:05:00Z + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 7bd851b6..2f865194 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -1,38 +1,50 @@ *** Settings *** -Documentation Check that you can query the temporal evolution of entities using the entityOperations method -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Query the temporal evolution of entities using the entityOperations method - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld - -*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE -After entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld - [Tags] te-query 5_7_4 - -Before entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld - [Tags] te-query 5_7_4 +Documentation Check that you can query the temporal evolution of entities using the entityOperations method + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities using the entityOperations method + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + + +*** Test Cases *** PAYLOAD_FILE EXPECTATION_FILE +After [Tags] te-query 5_7_4 + entity-operations-after-query.jsonld vehicles-temporal-representation-021-13-01-expectation.jsonld +Before [Tags] te-query 5_7_4 + entity-operations-before-query.jsonld vehicles-temporal-representation-021-13-02-expectation.jsonld + *** Keywords *** Query the temporal evolution of entities using the entityOperations method - [Arguments] ${payload_file} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method - Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + [Arguments] ${payload_file} ${expectation_file} + Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List + ... ${first_temporal_entity_representation_id} + ... ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + Check Response Body Containing List Containing EntityTemporal elements + ... ${expectation_file} + ... ${temporal_entities_representation_ids} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 357363c8..884d2046 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -1,23 +1,30 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity [Documentation] Check that you can retrieve the temporal evolution of an entity [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 6f72293b..bd965bf3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity using a context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity using a context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index bc181809..16ad9623 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of certain attributes of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of certain attributes of an entity [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... attrs=${temporal_attributes_to_be_retrieved} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 558a569e..8e5789b9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -1,33 +1,43 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 -Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE +After [Tags] te-retrieve 5_7_3 + after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld +Before [Tags] te-retrieve 5_7_3 + before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld +Between [Tags] te-retrieve 5_7_3 + between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld -Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld - [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 16a2ec54..274a150b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -1,32 +1,41 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of the last N instances of entity attributes - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of the last N instances of entity attributes + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld -*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE -Retrieve Some Instances - ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld - [Tags] te-retrieve 5_7_3 +*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE +Retrieve Some Instances + [Tags] te-retrieve 5_7_3 + ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld Retrieve All Instances - ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld - [Tags] te-retrieve 5_7_3 + [Tags] te-retrieve 5_7_3 + ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + *** Keywords *** Retrieve the temporal evolution of the last N instances of entity attributes - [Arguments] ${lastN} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} + [Arguments] ${lastN} ${vehicle_expectation_file} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... lastN=${lastN} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 7354c0af..7cfec33b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve the temporal evolution of an entity with an invalid id [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 762b54f1..1d44b0f5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve the temporal evolution of a non-existing entity [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity [Tags] te-retrieve 5_7_3 Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 11ece9f5..a56bd842 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -1,25 +1,35 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of non-existing entity attributes [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... attrs=${temporal_attributes_to_be_retrieved} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index 24c23044..b8b5ce55 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -1,33 +1,42 @@ *** Settings *** -Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Retrieve the temporal evolution of an entity with an invalid request content - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity with an invalid request content + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT -After after ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 -Before before ${EMPTY} ${EMPTY} - [Tags] te-retrieve 5_7_3 +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT +After [Tags] te-retrieve 5_7_3 + after ${EMPTY} ${EMPTY} +Before [Tags] te-retrieve 5_7_3 + before ${EMPTY} ${EMPTY} +Between [Tags] te-retrieve 5_7_3 + between 2020-08-01T12:00:00Z ${EMPTY} -Between between 2020-08-01T12:00:00Z ${EMPTY} - [Tags] te-retrieve 5_7_3 *** Keywords *** Retrieve the temporal evolution of an entity with an invalid request content - [Arguments] ${timerel} ${timeAt} ${endTimeAt} [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 3a8e53a5..0cea8d05 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -1,24 +1,34 @@ *** Settings *** -Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities - -*** Variable *** -${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +Documentation Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld -*** Test Case *** + +*** Test Cases *** Retrieve the temporal evolution of an entity with the simplified temporal representation [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} options=${options} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... options=${options} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + Check Response Body Containing EntityTemporal element + ... ${vehicle_expectation_file} + ... ${temporal_entity_representation_id} + *** Keywords *** Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 6e57f39b..d79401ef 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -1,33 +1,35 @@ *** Settings *** -Documentation Check that you can create a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Batch Create Entity Scenarios +Documentation Check that you can create a batch of entities -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME -MinimalEntity building-minimal-sample.jsonld - [Tags] be-create 5_6_7 +Test Template Batch Create Entity Scenarios -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-create 5_6_7 -EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-create 5_6_7 +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME +MinimalEntity [Tags] be-create 5_6_7 + building-minimal-sample.jsonld +EntityWithSimpleProperties + [Tags] be-create 5_6_7 + building-simple-attributes-sample.jsonld +EntityWithSimpleRelationships + [Tags] be-create 5_6_7 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-create 5_6_7 + [Tags] be-create 5_6_7 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Create Entity Scenarios - [Arguments] ${filename} [Documentation] Check that you can create a batch of entities + [Arguments] ${filename} ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${filename} ${first_entity_id} @@ -38,6 +40,10 @@ Batch Create Entity Scenarios ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities ${entities_to_be_queried} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${entities_to_be_queried} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Created Resources Set To ${entities_to_be_created} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index f5533c25..9f0e90eb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you can create a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Documentation Check that you can create a batch of entities where some will succeed and others will fail -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of two valid entities and one invalid entity [Documentation] Check that you can create a batch of two valid entities and one invalid entity [Tags] be-create 5_6_7 @@ -22,16 +26,23 @@ Create a batch of two valid entities and one invalid entity Batch Create Entities @{entities_to_be_created} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${existing_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} + *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index e60bc441..afbc5db4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot create a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Batch Entity With Invalid Request Scenarios +Documentation Check that you cannot create a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-create 5_6_7 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Batch Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-create 5_6_7 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson [Tags] be-create 5_6_7 + batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-create 5_6_7 *** Keywords *** Create Batch Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot create a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index 1a547522..f78f2faa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -1,20 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Batch Create Entities + ... @{entities_to_be_created} + ... content_type=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 201 Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 292e09ad..de136701 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] be-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index 3c8855f2..538c0f8d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] be-create 6_3_5 @@ -16,5 +19,7 @@ Create a batch of one entity containing a JSON-LD @context with a JSON content t @{entities_to_be_created}= Create List ${entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index 29ba557f..9aa8dc7a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] be-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index e9f550f6..9926817d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] be-create 6_3_5 @@ -16,5 +19,7 @@ Create a batch of one entity not containing a JSON-LD @context with a JSON-LD co @{entities_to_be_created}= Create List ${entity} Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 6db7bf66..53810f46 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -1,20 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Create a batch of one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Batch Create Entities + ... @{entities_to_be_created} + ... content_type=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index b305333c..917b0813 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you can delete a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Documentation Check that you can delete a batch of entities -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] be-delete 5_6_10 @@ -19,6 +23,7 @@ Delete a batch of entities Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources + *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index f37b0f36..abe62e7e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -1,29 +1,36 @@ *** Settings *** -Documentation Check that you can delete a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: - -*** Test Case *** -Delete a batch of non existing and existing entities - [Documentation] Check that you can delete a batch of non existing and existing entities +Documentation Check that you can delete a batch of entities where some will succeed and others will fail + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** +Delete a batch of non-existing and existing entities + [Documentation] Check that you can delete a batch of non-existing and existing entities [Tags] be-delete 5_6_10 ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources + *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index bf013682..c36cc59e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot delete a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Delete Entity With Invalid Request Scenarios +Documentation Check that you cannot delete a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-delete 5_6_10 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Delete Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-delete 5_6_10 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson [Tags] be-delete 5_6_10 + batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-delete 5_6_10 *** Keywords *** Batch Delete Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot delete a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 68953588..9cd6e877 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -1,33 +1,36 @@ *** Settings *** -Documentation Check that you can update a batch of entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Update Entity Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json - [Tags] be-update 5_6_9 +Documentation Check that you can update a batch of entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Update Entity Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld -EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-update 5_6_9 +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + [Tags] be-update 5_6_9 + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json +EntityWithSimpleRelationships + [Tags] be-update 5_6_9 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json - [Tags] be-update 5_6_9 + [Tags] be-update 5_6_9 + building-relationship-of-property-sample.jsonld fragmentEntities/airQualityLevel-with-relationship-fragment.json + *** Keywords *** Batch Update Entity Scenarios - [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can update a batch of entities + [Arguments] ${filename} ${update_fragment_filename} ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @@ -41,7 +44,11 @@ Batch Update Entity Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 264a45f0..005e8145 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -1,39 +1,42 @@ *** Settings *** -Documentation Check that you can update a batch of entities with noOverwrite option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Update Entity With NoOverwrite Option Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld - -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 - [Tags] be-update 5_6_9 +Documentation Check that you can update a batch of entities with noOverwrite option -EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 - [Tags] be-update 5_6_9 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Update Entity With NoOverwrite Option Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld + +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS +EntityWithSimpleProperties + [Tags] be-update 5_6_9 + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 +EntityWithSimpleRelationships + [Tags] be-update 5_6_9 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 - [Tags] be-update 5_6_9 + [Tags] be-update 5_6_9 + building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 + *** Keywords *** Batch Update Entity With NoOverwrite Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} ${expected_status} [Documentation] Check that you can update a batch of entities with noOverwrite option + [Arguments] ${filename} ${update_fragment_filename} ${expected_status} ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite - Check Response Status Code Set To ${expected_status} + Check Response Status Code Set To ${expected_status} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -41,7 +44,11 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 77275037..9cfe8864 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -1,41 +1,58 @@ *** Settings *** -Documentation Check that you can update a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_payload_filename}= building-simple-attributes-sample.jsonld +Documentation Check that you can update a batch of entities where some will succeed and others will fail + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_payload_filename}= building-simple-attributes-sample.jsonld ${update_fragment_filename}= fragmentEntities/simple-attributes-relationship-of-property-fragment.json -*** Test Case *** -Update a batch of non existing and existing entities - [Documentation] Check that you can update a batch of non existing and existing entities + +*** Test Cases *** +Update a batch of non-existing and existing entities + [Documentation] Check that you can update a batch of non-existing and existing entities [Tags] be-update 5_6_9 - ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} - ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} + ${first_existing_entity}= Load Entity + ... building-relationship-of-property-sample.jsonld + ... ${first_existing_entity_id} + ${second_existing_entity}= Load Entity + ... building-relationship-of-property-sample.jsonld + ... ${second_existing_entity_id} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} - ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_existing_entity_id} + ${second_created_entity}= Load Test Sample + ... entities/${entity_payload_filename} + ... ${second_existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${first_updated_entity}= Upsert Element In Entity ${first_created_entity} ${update_fragment} ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} Batch Delete Entities @{expected_successful_entities_ids} + *** Keywords *** Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index d7944d3e..e00b0a4e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot update a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Update Entity With Invalid Request Scenarios +Documentation Check that you cannot update a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-update 5_6_9 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Update Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-update 5_6_9 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd [Tags] be-update 5_6_9 + batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-update 5_6_9 *** Keywords *** Batch Update Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot update a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index 5eceefe3..7901378a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -1,30 +1,33 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing entities and they will be created -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Batch Upsert Entity Scenarios +Documentation Check that you can upsert a batch of non-existing entities and they will be created + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Batch Upsert Entity Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Entity Scenarios + [Documentation] Check that you can upsert a batch of non-existing entities [Arguments] ${filename} - [Documentation] Check that you can upsert a batch of non existing entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} ${first_entity}= Load Entity ${filename} ${first_entity_id} @@ -35,6 +38,10 @@ Batch Upsert Entity Scenarios Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 47992d03..b41d692c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -1,44 +1,57 @@ *** Settings *** -Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Non-existing And Existing Entities Scenarios -Test Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of non-existing and existing entities where non-existing will be created and existing will be replaced + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Non-existing And Existing Entities Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Non-existing And Existing Entities Scenarios + [Documentation] Check that you can upsert a batch of non-existing and existing entities [Arguments] ${filename} - [Documentation] Check that you can upsert a batch of non existing and existing entities ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} - @{entities_to_be_upserted}= Create List ${new_entity} ${first_existing_entity} ${second_existing_entity} + @{entities_to_be_upserted}= Create List + ... ${new_entity} + ... ${first_existing_entity} + ... ${second_existing_entity} Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code Set To 201 Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - @{upserted_entities_ids}= Create List ${new_entity_id} ${first_existing_entity_id} ${second_existing_entity_id} + @{upserted_entities_ids}= Create List + ... ${new_entity_id} + ... ${first_existing_entity_id} + ... ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index a79bec7b..882bab4d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -1,32 +1,35 @@ *** Settings *** -Documentation Check that you can upsert a batch of existing entities and they will be replaced -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Existing Entities Scenarios -Test Teardown Delete Initial Entities +Documentation Check that you can upsert a batch of existing entities and they will be replaced + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Existing Entities Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME EntityWithSimpleProperties - building-simple-attributes-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld EntityWithSimpleRelationships - building-relationship-sample.jsonld - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld + *** Keywords *** Batch Upsert Existing Entities Scenarios - [Arguments] ${filename} [Documentation] Check that you can upsert a batch of existing entities + [Arguments] ${filename} ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} @@ -34,7 +37,11 @@ Batch Upsert Existing Entities Scenarios Check Response Status Code Set To 204 @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 0bd4d44b..9673baf0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -1,33 +1,36 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities with update option -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Setup Initial Entities -Test Template Batch Upsert Entities With Update Option Scenarios -Test Teardown Delete Initial Entities - -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Documentation Check that you can upsert a batch of entities with update option + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities +Test Template Batch Upsert Entities With Update Option Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: ${existing_entity_payload_filename}= building-minimal-sample.jsonld -*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME -EntityWithSimpleProperties - building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json - [Tags] be-upsert 5_6_8 +*** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME +EntityWithSimpleProperties + [Tags] be-upsert 5_6_8 + building-simple-attributes-sample.jsonld fragmentEntities/simple-attributes-fragment.json EntityWithSimpleRelationships - building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json - [Tags] be-upsert 5_6_8 - + [Tags] be-upsert 5_6_8 + building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json - [Tags] be-upsert 5_6_8 + [Tags] be-upsert 5_6_8 + building-relationship-of-property-sample.jsonld fragmentEntities/simple-attributes-relationship-of-property-fragment.json + *** Keywords *** Batch Upsert Entities With Update Option Scenarios - [Arguments] ${filename} ${update_fragment_filename} [Documentation] Check that you can upsert a batch of entities with update option + [Arguments] ${filename} ${update_fragment_filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @@ -42,7 +45,11 @@ Batch Upsert Entities With Update Option Scenarios ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index dbcfb12e..b66d407e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can upsert a batch of entities where some will succeed and others will fail -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Upsert a batch of two valid entities and one invalid entity [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity [Tags] be-upsert 5_6_8 @@ -22,11 +25,17 @@ Upsert a batch of two valid entities and one invalid entity Batch Upsert Entities @{entities_to_be_upserted} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${third_entity_id} - &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + &{expected_batch_operation_result}= Create Batch Operation Result + ... ${expected_successful_entities_ids} + ... ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_updated_entities_ids} Building context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Query Entities + ... ${expected_updated_entities_ids} + ... Building + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} Check Updated Resources Set To ${upserted_entities} Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 584c2a75..1b8c9cc3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot upsert a batch of entities with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Batch Upsert Entity With Invalid Request Scenarios +Documentation Check that you cannot upsert a batch of entities with an invalid request -*** Test Cases *** FILENAME PROBLEM_TYPE -InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} - [Tags] be-upsert 5_6_8 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Batch Upsert Entity With Invalid Request Scenarios + + +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson [Tags] be-upsert 5_6_8 + batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd [Tags] be-upsert 5_6_8 + batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} -InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} - [Tags] be-upsert 5_6_8 *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios - [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot upsert a batch of entities with an invalid request + [Arguments] ${filename} ${problem_type} Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 950f90ac..a2a680ab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -1,37 +1,46 @@ *** Settings *** -Documentation Check that you can create an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Entity Scenarios +Documentation Check that you can create an entity -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME CONTENT_TYPE -001_01_01_MinimalEntity - building-minimal-without-context-sample.jsonld application/json +Test Template Create Entity Scenarios -001_01_02_EntityWithSimpleProperties - building-simple-attributes-sample.jsonld application/ld+json -001_01_03_EntityWithRelationshipsProperties - building-relationship-of-property-sample.jsonld application/ld+json +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Cases *** FILENAME CONTENT_TYPE +001_01_01_MinimalEntity + building-minimal-without-context-sample.jsonld application/json +001_01_02_EntityWithSimpleProperties + building-simple-attributes-sample.jsonld application/ld+json +001_01_03_EntityWithRelationshipsProperties + building-relationship-of-property-sample.jsonld application/ld+json 001_01_04_EntityWithLocationAttribute - building-location-attribute-sample.jsonld application/ld+json + building-location-attribute-sample.jsonld application/ld+json + *** Keywords *** Create Entity Scenarios - [Arguments] ${filename} ${content_type} [Documentation] Check that you can create an entity [Tags] e-create 5_6_1 + [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} - Run Keyword If '${content_type}'=='application/json' Retrieve Entity by Id ${entity_id} ${content_type} - Run Keyword If '${content_type}'=='application/ld+json' Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + IF '${content_type}'=='application/json' + Retrieve Entity by Id ${entity_id} ${content_type} + END + IF '${content_type}'=='application/ld+json' + Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + END Check Created Resource Set To ${created_entity} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index a02843a9..061bdd72 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -1,25 +1,29 @@ *** Settings *** -Documentation Check that you cannot create an entity with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Entity With Invalid Request Scenarios +Documentation Check that you cannot create an entity with an invalid request -*** Test Cases *** FILENAME ERROR_TYPE -001_02_01_InvalidJson - invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Entity With Invalid Request Scenarios -001_02_02_EmptyJson - empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +*** Test Cases *** FILENAME ERROR_TYPE +001_02_01_InvalidJson + invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +001_02_02_EmptyJson + empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext - building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Create Entity With Invalid Request Scenarios - [Arguments] ${filename} ${error_type} [Documentation] Check that you cannot create an entity with an invalid request [Tags] e-create 5_6_1 + [Arguments] ${filename} ${error_type} Request Entity From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${error_type} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${error_type} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index e0fac02b..c5dc1981 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -1,23 +1,34 @@ *** Settings *** -Documentation Check that you cannot create an entity with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create an entity with an existing id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${content_type}= application/ld+json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal-sample.jsonld +${content_type}= application/ld+json + + +*** Test Cases *** Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${content_type} Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index beefc9dd..3c5d816c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -1,19 +1,26 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index e586dc5d..826c6940 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] e-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index eaec816c..5b39952d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -1,19 +1,27 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index ed53efb7..4e40f111 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] e-create 6_3_5 diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index 1de14b95..51efb05e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -1,19 +1,27 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.json + + +*** Test Cases *** Create one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index 04a0f4dd..e48f067a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -1,19 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-simple-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** Create one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 0ba8c5ac..1a5a555f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -1,18 +1,24 @@ *** Settings *** -Documentation Check that you can delete an entity by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an entity by id -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** Delete an entity [Documentation] Check that you can delete an entity by id [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json + ${request} ${response}= Create Entity Selecting Content Type + ... building-simple-attributes-sample.jsonld + ... ${entity_id} + ... application/ld+json Check Response Status Code 201 ${response['status']} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 56ca59e8..a3b5e073 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -1,23 +1,28 @@ *** Settings *** -Documentation Check that you cannot delete an entity with invalid/missing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Entity Scenarios +Documentation Check that you cannot delete an entity with invalid/missing id -*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -002_02_01_Delete an entity if the Entity Id is not present - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Entity Scenarios + +*** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE +002_02_01_Delete an entity if the Entity Id is not present + ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 002_02_02_Delete an entity if the Entity Id is not a valid URI - thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Delete Entity Scenarios - [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id [Tags] e-delete 5_6_6 + [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index 9ff21f86..fc9f8d10 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -1,19 +1,24 @@ *** Settings *** -Documentation Check that you cannot delete an entity if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an entity if the entity id is not known to the system -*** Variable *** -${building_id_prefix}= urn:ngsi-ld:Building: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: ${expected_status_code}= 404 -*** Test Case *** + +*** Test Cases *** Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index fbb6af91..345f90e0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -1,33 +1,54 @@ *** Settings *** -Documentation Check that you can append entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can append entity attributes + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** 010_01_01_Append entity attributes - Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld + Append Attributes Without Params + ... 204 + ... vehicle-new-attribute-fragment.jsonld + ... vehicle-speed-appended-expectation.jsonld 010_01_02_Append entity attributes - Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld + Append Attributes With Params + ... 207 + ... vehicle-attribute-to-add-fragment.jsonld + ... add-attribute-expectation.jsonld + ... vehicle-speed-appended-expectation.jsonld 010_01_03_Append entity attributes - Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes Without Params + ... 204 + ... vehicle-speed-different-datasetid-fragment.jsonld + ... vehicle-speed-different-datasetid-expectation.jsonld 010_01_04_Append entity attributes - Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld + Append Attributes With Params + ... 204 + ... vehicle-speed-different-datasetid-fragment.jsonld + ... ${EMPTY} + ... vehicle-speed-different-datasetid-expectation.jsonld + *** Keywords *** Append Attributes Without Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] ea-append 5_6_3 + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} @@ -37,16 +58,28 @@ Append Attributes Without Params [Teardown] Delete Entity by Id Returning Response ${entity_id} Append Attributes With Params - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} [Documentation] Check that you can append entity attributes [Tags] ea-append 5_6_3 + [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite + ${response}= Append Entity Attributes With Parameters + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... noOverwrite Check Response Status Code ${status_code} ${response['status']} # ignore the reason for the not updated attribute as this detail is up to each context broker implementation - Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']} root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + IF "${expectation_response_body}"!="${EMPTY}" + Check Response Body Content + ... ${expectation_response_body} + ... ${response['body']} + ... root\\['notUpdated'\\]\\[0\\]\\['reason'\\] + END ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index a0ba000b..79a09e95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -1,15 +1,18 @@ *** Settings *** -Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -${status_code}= 400 -${invalid_fragment_filename}= invalid-fragment.jsonld +Documentation Check that you cannot append entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld +${status_code}= 400 +${invalid_fragment_filename}= invalid-fragment.jsonld + *** Test Cases *** 010_02_01_Append entity attributes if the entity Id is not present @@ -21,17 +24,23 @@ ${invalid_fragment_filename}= invalid-fragment.jsonld 010_02_03_Append entity attributes with invalid entity fragments Append entity attributes with invalid entity fragments + *** Keywords *** Append Attributes - [Arguments] ${entity_invalid_id} [Documentation] Check that you cannot append entity attributes with invalid/missing id or invalid request body [Tags] ea-append 5_6_3 + [Arguments] ${entity_invalid_id} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -39,9 +48,16 @@ Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Append Entity Attributes Using Session ${entity_id} ${invalid_fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Append Entity Attributes Using Session + ... ${entity_id} + ... ${invalid_fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... ${EMPTY} Check RL Response Status Code Set To ${status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 3421a072..caecdd7d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that you cannot append entity attributes if the entity id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot append entity attributes if the entity id is not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-attribute-to-add-fragment.jsonld *** Test Cases *** Append entity attributes when the entity id is not known to the system @@ -15,9 +18,11 @@ Append entity attributes when the entity id is not known to the system ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -*** Keywords *** +*** Keywords *** [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 9837ae42..3dd3b1ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -1,35 +1,46 @@ *** Settings *** -Documentation Check that you can delete an attribute from an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 204 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${attribute_id}= speed - -*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME -013_01_01_delete an attribute with the default instance - ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +Documentation Check that you can delete an attribute from an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 204 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${attribute_id}= speed -013_01_02_delete an attribute with the datasetId - urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld +*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME +013_01_01_delete an attribute with the default instance + ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld +013_01_02_delete an attribute with the datasetId + urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld 013_01_03_delete all target attribute instances - ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld + ${EMPTY} true vehicle-delete-deleteall-speed-expectation.jsonld + *** Keywords *** Delete Attributes - [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} [Documentation] Check that you can delete an attribute from an entity [Tags] ea-delete 5_6_5 + [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${datasetId} + ... ${deleteAll} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 2ef3f055..094b3eaa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -013_02_01_delete an attribute if the Entity Id is not present - ${EMPTY} speed +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -013_02_02_delete an attribute if the Entity Id is not a valid URI - thisIsAnInvalidURI speed +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +013_02_01_delete an attribute if the Entity Id is not present + ${EMPTY} speed +013_02_02_delete an attribute if the Entity Id is not a valid URI + thisIsAnInvalidURI speed 013_02_03_delete an attribute if the Attribute Name is not present - ${valid_entity_id} ${EMPTY} + ${valid_entity_id} ${EMPTY} + *** Keywords *** Delete Attributes - [Arguments] ${entity_id} ${attribute_id} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 34e3bd8f..9d2c56c4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -1,32 +1,35 @@ *** Settings *** -Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities -Test Template Delete Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 -${filename}= vehicle-two-datasetid-attributes-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID -013_03_01_delete an attribute when the Entity Id is not known to the system - ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +Documentation Check that you cannot delete an attribute from an entity with invalid/missing ids + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Delete Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -013_03_02_delete an attribute when the Entity does not contain the target attribute id - ${valid_entity_id} notFound ${EMPTY} +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID DATASETID +013_03_01_delete an attribute when the Entity Id is not known to the system + ${not_found_entity_id} speed urn:ngsi-ld:Property:gpsBxyz123-speed +013_03_02_delete an attribute when the Entity does not contain the target attribute id + ${valid_entity_id} notFound ${EMPTY} 013_03_03_delete an attribute when the Entity does not contain the target attribute with same datasetId - ${valid_entity_id} speed urn:ngsi-ld:Property:notFound + ${valid_entity_id} speed urn:ngsi-ld:Property:notFound + *** Keywords *** Delete Attributes - [Arguments] ${entity_id} ${attribute_id} ${datasetId} [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 + [Arguments] ${entity_id} ${attribute_id} ${datasetId} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -34,7 +37,10 @@ Delete Attributes Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 3c697912..e8117d22 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -1,31 +1,42 @@ *** Settings *** -Documentation Check that you can perform a partial update on an entity attribute -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 204 - -*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME -012_01_01_Check that you can partially update an attribute - vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld +Documentation Check that you can perform a partial update on an entity attribute + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 204 + +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_01_01_Check that you can partially update an attribute + vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld 012_01_02_Check that you can partially update an attribute by specifying the datasetId - vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld + vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld + *** Keywords *** Update Attributes - [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} [Documentation] Check that you can perform a partial update on an entity attribute [Tags] ea-partial-update 5_6_4 + [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index d9652e38..2195665d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -1,42 +1,52 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld -${status_code}= 400 - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME -012_02_01_Make a partial attribute update if the Entity Id is not present - ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +Documentation Check that you cannot perform a partial update on an entity attribute with invalid/missing ids -012_02_02_Make a partial attribute update if the Entity Id is not a valid URI - thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -012_02_03_Make a partial attribute update if the Attribute Id is not present - ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld +Suite Setup Setup Initial Entities +Test Template Update Attributes -012_02_04_Make a partial attribute update if the Attribute type does not match - ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld +${status_code}= 400 + + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID FRAGMENT_FILENAME +012_02_01_Make a partial attribute update if the Entity Id is not present + ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_02_Make a partial attribute update if the Entity Id is not a valid URI + thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld +012_02_03_Make a partial attribute update if the Attribute Id is not present + ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld +012_02_04_Make a partial attribute update if the Attribute type does not match + ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld 012_02_05_Make a partial attribute update if the entity fragment is empty - ${valid_entity_id} speed empty-fragment.json + ${valid_entity_id} speed empty-fragment.json + *** Keywords *** Update Attributes - [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] ea-partial-update 5_6_4 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index dee5e2f4..5eda275e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -1,40 +1,51 @@ *** Settings *** -Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Test Template Partial Update Attributes - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-speed-two-datasetid-sample.jsonld -${status_code}= 404 -${attribute_id}= speed - -*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME -012_03_01_Partial update when the Entity Id is not known to the system - ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld +Documentation Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system -012_03_02_Partial update when no default instance and no datasetId specified - ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Partial Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld +${status_code}= 404 +${attribute_id}= speed -012_03_03_Partial update when no instance with the datasetId specified - ${valid_entity_id} vehicle-isparked-fragment.jsonld +*** Test Cases *** ENTITY_ID FRAGMENT_FILENAME +012_03_01_Partial update when the Entity Id is not known to the system + ${not_found_entity_id} vehicle-attribute-to-add-fragment.jsonld +012_03_02_Partial update when no default instance and no datasetId specified + ${valid_entity_id} vehicle-speed-invalid-datasetid-fragment.jsonld +012_03_03_Partial update when no instance with the datasetId specified + ${valid_entity_id} vehicle-isparked-fragment.jsonld 012_03_04_Partial update when no instance with the attrId specified - ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld + ${valid_entity_id} vehicle-speed-wrong-name-fragment.jsonld + *** Keywords *** Partial Update Attributes - [Arguments] ${entity_id} ${fragment_filename} [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system [Tags] ea-partial-update 5_6_4 - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${valid_entity_id} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${fragment_filename} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${valid_entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Partial Update Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index c4a76f10..af12e56b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check that you can update entity attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Attributes +Documentation Check that you can update entity attributes -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-two-datasetid-attributes-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME -011_01_01_Check that you can update existing attributes with no datasetId - 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +Test Template Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-two-datasetid-attributes-sample.jsonld -011_01_02_Check that you can update existing attributes with the datasetId - 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME +011_01_01_Check that you can update existing attributes with no datasetId + 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld +011_01_02_Check that you can update existing attributes with the datasetId + 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld 011_01_03_Check that you can update only some attributes while others failed - 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld + 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld + *** Keywords *** Update Attributes - [Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename} [Documentation] Check that you can update entity attributes [Tags] ea-update 5_6_2 + [Arguments] + ... ${status_code} + ... ${fragment_filename} + ... ${expectation_response_filename} + ... ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} - Run Keyword If "${expectation_response_filename}"!="${EMPTY}" Check Response Body Content ${expectation_response_filename} ${response['body']} + IF "${expectation_response_filename}"!="${EMPTY}" + Check Response Body Content ${expectation_response_filename} ${response['body']} + END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index 9041bebc..c786688c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -1,44 +1,68 @@ *** Settings *** -Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes with invalid/missing id or invalid request body + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: *** Test Cases *** 011_02_01_Update an attribute if the Entity Id is not present - Update Attributes ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + Update Attributes + ... ${EMPTY} + ... vehicle-two-datasetid-attributes-sample.jsonld + ... vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_02_Update an attribute if the Entity Id is not a valid URI - Update Attributes thisisaninvaliduri vehicle-two-datasetid-attributes-sample.jsonld vehicle-speed-two-datasetid-01-fragment.jsonld + Update Attributes + ... thisisaninvaliduri + ... vehicle-two-datasetid-attributes-sample.jsonld + ... vehicle-speed-two-datasetid-01-fragment.jsonld 011_02_03_Update entity attributes with invalid entity fragments - Update entity attributes with invalid entity fragments vehicle-speed-two-datasetid-sample.jsonld invalid-fragment.jsonld + Update entity attributes with invalid entity fragments + ... vehicle-speed-two-datasetid-sample.jsonld + ... invalid-fragment.jsonld + *** Keywords *** Update Attributes - [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} [Documentation] Check that you cannot update entity attributes with invalid/missing id or invalid request body [Tags] ea-update 5_6_2 + [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id Returning Response ${entity_id} Update entity attributes with invalid entity fragments - [Arguments] ${filename} ${fragment_filename} [Documentation] Check that you cannot update an attribute if the entity fragment is invalid [Tags] ea-update 5_6_2 + [Arguments] ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${request} ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Update Entity Attributes Using Session ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${EMPTY} + Update Entity Attributes Using Session + ... ${entity_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} + ... ${EMPTY} Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 8ba03764..4fed6327 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -1,12 +1,15 @@ *** Settings *** -Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update entity attributes if the entity id or attributes are not known to the system + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${fragment_filename}= vehicle-speed-two-datasetid-01-fragment.jsonld *** Test Cases *** Update entity attributes when the entity id is not known to the system @@ -15,9 +18,11 @@ Update entity attributes when the entity id is not known to the system ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} -*** Keywords *** +*** Keywords *** [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index caa98220..409b05be 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -1,32 +1,49 @@ *** Settings *** -Documentation Check that you can create a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Temporal Entity +Documentation Check that you can create a temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE -007_01_01_Create a temporal representation of an entity - vehicle-create-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json +Test Template Create Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: + +*** Test Cases *** FILENAME EXPECTATION_FILENAME CONTENT_TYPE +007_01_01_Create a temporal representation of an entity + vehicle-create-temporal-representation-sample.jsonld vehicle-temporal-representation-create-expectation.jsonld application/ld+json 007_01_02_Create a temporal entity with no context - vehicle-create-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json + vehicle-create-temporal-representation-without-context-sample.jsonld vehicle-temporal-representation-create-with-no-context-expectation.jsonld application/json + *** Keywords *** Create Temporal Entity - [Arguments] ${filename} ${expectation_filename} ${content_type} [Documentation] Check that you can create a temporal representation of an entity [Tags] te-create 5_6_11 + [Arguments] ${filename} ${expectation_filename} ${content_type} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${content_type} Check Response Status Code 201 ${response['status']} - ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Run Keyword If '${content_type}'=='application/json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - Run Keyword If '${content_type}'=='application/ld+json' Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} - ${ignored_attributes}= Create List instanceId @context - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} + ${created_temporal_entity}= Load Test Sample + ... temporalEntities/${filename} + ... ${temporal_entity_representation_id} + IF '${content_type}'=='application/json' + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + END + IF '${content_type}'=='application/ld+json' + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + END + ${ignored_attributes}= Create List instanceId @context + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} Check Created Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 465aff08..53d97144 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -1,11 +1,14 @@ *** Settings *** -Documentation Check that you cannot create a temporal entity with an empty/invalid json/id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a temporal entity with an empty/invalid json/id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${status_code}= 400 -*** Variable *** -${status_code}= 400 *** Test Cases *** 007_02_01_Create a temporal entity with an invalid json @@ -20,20 +23,26 @@ ${status_code}= 400 007_02_04_Create a temporal invalid URI Create Temporal Entity invalidId vehicle-temporal-representation-sample.jsonld + *** Keywords *** Create Temporal Entity From File - [Arguments] ${filename} [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id [Tags] te-create 5_6_11 - Create Temporal Representation Of Entity Selecting Content Type Using Session ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${filename} + Create Temporal Representation Of Entity Selecting Content Type Using Session + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To 400 Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} Create Temporal Entity - [Arguments] ${entity_id} ${filename} [Documentation] Check that you cannot create a temporal entity with an invalid @context [Tags] te-create 5_6_11 - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${filename} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index f8e9fa2d..d03e8368 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -1,21 +1,30 @@ *** Settings *** -Documentation Check that you can delete a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete a temporal representation of an entity with simple temporal properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** Delete a temporal representation of an entity with simple temporal properties [Documentation] Check that you can delete a temporal representation of an entity with simple temporal properties [Tags] te-delete 5_6_16 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + ${response}= Delete Temporal Representation Of Entity With Returning Response + ... ${temporal_entity_representation_id} Check Response Status Code 204 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index 5c78f4bc..c9c03003 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -1,26 +1,32 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Temporal Entity +Documentation Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE -009_02_01_Delete a temporal representation of an entity with an empty entity id - 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} +*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE +009_02_01_Delete a temporal representation of an entity with an empty entity id + 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} 009_02_02 Delete a temporal representation of an entity with an invalid entity id - 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Delete Temporal Entity - [Arguments] ${status_code} ${id} ${problem_type} - [Documentation] Check that an error is raised if you delete a temporal enitity with an empty/invalid EnityId + [Documentation] Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId [Tags] te-delete 5_6_16 + [Arguments] ${status_code} ${id} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 826558e2..5f2a3cf7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -1,19 +1,24 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with a non existing/invalid EnityId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal entity with a non-existing/invalid EntityId + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 404 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 404 *** Test Cases *** -009_03 Delete a temporal representation of an entity with a unknown entity id - [Documentation] Check that an error is raised if you delete a temporal enitity with a non existing entity id +009_03 Delete a temporal representation of an entity with an unknown entity id + [Documentation] Check that an error is raised if you delete a temporal entity with a non-existing entity id [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 9285749c..c2042366 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -1,26 +1,40 @@ *** Settings *** -Documentation Check that you can update a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can update a temporal representation of an entity with simple temporal properties -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-create-temporal-representation-sample.jsonld -${update_filename}= vehicle-temporal-representation-update-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-create-temporal-representation-sample.jsonld +${update_filename}= vehicle-temporal-representation-update-sample.jsonld ${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld + *** Test Cases *** 008_01_Update a temporal representation of an entity with simple temporal properties [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties [Tags] te-update 5_6_11 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${update_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index ca86bcfa..7331164d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -1,26 +1,40 @@ *** Settings *** -Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can add a simple temporal attribute to a temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld ${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld + *** Test Cases *** 014_01_Add an attribute to a temporal entity with simple temporal properties [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Append Attribute To Temporal Entity + ... ${temporal_entity_representation_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index f8a5d788..3360b677 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal enitity with empty/invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you delete a temporal entity with empty/invalid content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 400 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 400 *** Test Cases *** 014_02_01_Add an attribute to a temporal representation of an entity with invalid content @@ -23,26 +26,36 @@ ${status_code}= 400 014_02_04_Add an attribute to a temporal representation of an entity with an invalid entity id Add Attribute To Temporal Entity thisIsAninvalidId + *** Keywords *** Add an Attribute To a Temporal Entity From File - [Arguments] ${update_filename} [Documentation] Check that an error is raised if you add a temporal entity attribute with empty/invalid content [Tags] tea-append 5_6_12 + [Arguments] ${update_filename} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Append Attribute To Temporal Entity Using Session ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON} + Append Attribute To Temporal Entity Using Session + ... ${temporal_entity_representation_id} + ... ${update_filename} + ... ${CONTENT_TYPE_LD_JSON} Check RL Response Status Code Set To ${status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Add Attribute To Temporal Entity - [Arguments] ${id} - [Documentation] Check that an error is raised if you add a temporal entity attribute with a non existing/invalid EnityId + [Documentation] Check that an error is raised if you add a temporal entity attribute with a non-existing/invalid EntityId [Tags] tea-append 5_6_12 + [Arguments] ${id} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 9b14db12..2f50f7ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -1,23 +1,32 @@ *** Settings *** -Documentation Check that an error is raised if you add an attribute to a non existent entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an error is raised if you add an attribute to a non-existent entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-representation-fragment.jsonld +${status_code}= 404 -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-representation-fragment.jsonld -${status_code}= 404 *** Test Cases *** Add Attribute To Temporal Entity - [Documentation] Check that an error is raised if you add an attribute to a non existent entity + [Documentation] Check that an error is raised if you add an attribute to a non-existent entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Append Attribute To Temporal Entity ${not_found_temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Append Attribute To Temporal Entity + ... ${not_found_temporal_entity_representation_id} + ... ${fragment_filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 6ab2e152..94a7fd93 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -1,38 +1,55 @@ *** Settings *** -Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Attribute From A Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 204 -${attribute_id}= fuelLevel - -*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE -015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId - false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +Documentation Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Attribute From A Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 204 +${attribute_id}= fuelLevel -015_01_02_Delete an attribute from a temporal representation of an entity with datasetId - false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld +*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE +015_01_01_Delete an attribute from a temporal representation of an entity without deleteAll/datasetId + false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld +015_01_02_Delete an attribute from a temporal representation of an entity with datasetId + false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld 015_01_03_Delete an attribute from a temporal representation of an entity with deleteAll - true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld + true ${EMPTY} vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld + *** Keywords *** Delete Attribute From A Temporal Entity - [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} [Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties [Tags] tea-delete 5_6_13 + [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${datasetId} ${deleteAll} ${ngsild_test_suite_context} + ${response}= Delete Attribute From Temporal Entity + ... ${temporal_entity_representation_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${datasetId} + ... ${deleteAll} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index 36c975e3..f6d074b4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -1,40 +1,53 @@ *** Settings *** -Documentation Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity -Test Template Delete attribute from temporal entity with unknow entity/attribute id - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 -${filename}= vehicle-temporal-representation-sample.jsonld - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id - ${EMPTY} speed +Documentation Check that an error is raised if you delete an attribute to temporal entity with an unknown/invalid Entity/Attribute Id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Delete attribute from temporal entity with unknow entity/attribute id + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${status_code}= 400 +${filename}= vehicle-temporal-representation-sample.jsonld -015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id - invalidId speed +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_02_01_Delete an attribute to a temporal representation of an entity with a missing entity id + ${EMPTY} speed +015_02_02_Delete an attribute to a temporal representation of an entity with an invalid entity id + invalidId speed 015_02_03_Delete an attribute to a temporal representation of an entity with an invalid attribute id - ${valid_temporal_entity_id} invalid(Name + ${valid_temporal_entity_id} invalid(Name + *** Keywords *** Delete attribute from temporal entity with unknow entity/attribute id - [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that an error is raised if you delete an attribute to temporal entity with a unknown/invalid Entity/Attribute Id + [Documentation] Check that an error is raised if you delete an attribute to temporal entity with an unknown/invalid Entity/Attribute Id [Tags] tea-delete 5_6_13 - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false + [Arguments] ${entity_id} ${attribute_id} + ${response}= Delete Attribute From Temporal Entity + ... ${entity_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${EMPTY} + ... false Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${valid_temporal_entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} Set Suite Variable ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 5a13f3cb..918a4a95 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -1,33 +1,48 @@ *** Settings *** -Documentation Check that an error is raised if you delete a temporal entity with a unknown EntityId/AttributeId -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Test Template Delete Attribute - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 - -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID -015_03_01_Delete an attribute to a temporal entity if the entity id doesn't exist - ${unknown_temporal_entity_id} fuelLevel +Documentation Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 + + +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +015_03_01_Delete an attribute to a temporal entity if the entity id does not exist + ${unknown_temporal_entity_id} fuelLevel 015_03_02_Delete an attribute to a temporal entity if the entity does not contain the target attribute - ${valid_temporal_entity_id} notExistingAttribute + ${valid_temporal_entity_id} notExistingAttribute + *** Keywords *** Delete Attribute - [Arguments] ${entity_id} ${attribute_id} - [Documentation] Check that an error is raised if you delete a temporal enitity with a unknown EntityId/AttributeId + [Documentation] Check that an error is raised if you delete a temporal entity with an unknown EntityId/Attribute Id [Tags] tea-delete 5_6_13 - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${valid_temporal_entity_id} ${filename} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${entity_id} ${attribute_id} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${valid_temporal_entity_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Delete Attribute From Temporal Entity ${entity_id} ${attribute_id} ${CONTENT_TYPE_JSON} ${EMPTY} false ${ngsild_test_suite_context} + ${response}= Delete Attribute From Temporal Entity + ... ${entity_id} + ... ${attribute_id} + ... ${CONTENT_TYPE_JSON} + ... ${EMPTY} + ... false + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index b0b0ed18..ccfbb73a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -1,29 +1,48 @@ *** Settings *** -Documentation Check that you can delete an attribute instance in temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete an attribute instance in temporal representation of an entity -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${attributeId}= speed +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${attributeId}= speed ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld + *** Test Cases *** 017_01_Delete an attribute instance in temporal representation of an entity [Documentation] Check that you can delete an attribute instance in temporal representation of an entity [Tags] tea-instance-delete 5_6_15 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${response}= Delete Attribute Instance From Temporal Entity + ... ${temporal_entity_representation_id} + ... ${attributeId} + ... ${instanceId} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 3f71940b..79f7aea0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -1,47 +1,60 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity -Test Template Delete attribute instance - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right -017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid - ${temporal_entity_representation_id} speed invalidId +Suite Setup Create Temporal Entity +Suite Teardown Delete Temporal Entity +Test Template Delete attribute instance -017_02_04_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name - ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 400 + + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_02_01_delete an attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} +017_02_02_delete an attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} +017_02_03_delete an attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId +017_02_04_delete an attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Name ${valid_instanceId} 017_02_05_delete an attribute instance in temporal representation of an entity if the attribute name is not present - ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + *** Keywords *** Delete attribute instance - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right [Tags] tea-instance-delete 5_6_15 - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Delete Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 4aadafe9..59d1a523 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -1,42 +1,57 @@ *** Settings *** -Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Test Template Delete Attribute Instance - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${status_code}= 404 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found - ${unknown_temporal_entity_id} speed ${valid_instanceId} +Documentation Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Test Template Delete Attribute Instance + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${status_code}= 404 -017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found - ${temporal_entity_representation_id} speed2 ${valid_instanceId} +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +017_03_01_delete an attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} +017_03_02_delete an attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} 017_03_03_delete an attribute instance in temporal representation of an entity if the target attribute instance is not found - ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + *** Keywords *** Delete Attribute Instance - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Documentation] Check that you cannot delete an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not found [Tags] tea-instance-delete 5_6_15 - ${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Delete Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index f75abc6c..10f330e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -1,15 +1,18 @@ *** Settings *** -Documentation Check that you can modify an attribute instance in temporal representation of an entity -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +Documentation Check that you can modify an attribute instance in temporal representation of an entity + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld ${expectation_filename}= vehicle-temporal-representation-modify-attribute-instance-expectation.jsonld -${attributeId}= speed +${attributeId}= speed + *** Test Cases *** 016_01_Modify attribute instance in temporal representation of an entity @@ -18,22 +21,41 @@ ${attributeId}= speed ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId_before_update}= Set Variable ${response['body']['speed'][0]['instanceId']} - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId_before_update} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_representation_id} + ... ${attributeId} + ... ${instanceId_before_update} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + Retrieve Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${instanceId_after_update}= Set Variable ${response['body']['speed'][0]['instanceId']} - Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} + Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} - ${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id} - ${ignored_attributes}= Create List instanceId @context modifiedAt + ${temporal_entity_expectation_payload}= Load Test Sample + ... temporalEntities/expectations/${expectation_filename} + ... ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context modifiedAt Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index 2bfdfe95..133be618 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -1,51 +1,64 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity -Test Template Modify Attribute Instance Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld -${status_code}= 400 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_02_01_modify attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right -016_02_02_modify attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -016_02_03_modify attribute instance in temporal representation of an entity if the instance id is not valid - ${temporal_entity_representation_id} speed invalidId +Suite Setup Create Id +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity -016_02_04_modify attribute instance in temporal representation of an entity if the instance id is not present - ${temporal_entity_representation_id} speed ${EMPTY} -016_02_05_modify attribute instance in temporal representation of an entity if the attribute name is not a valid name - ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +${status_code}= 400 + +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_02_01_modify attribute instance in temporal representation of an entity if the entity id is not valid + invalidId speed ${valid_instanceId} +016_02_02_modify attribute instance in temporal representation of an entity if the entity id is not present + ${EMPTY} speed ${valid_instanceId} +016_02_03_modify attribute instance in temporal representation of an entity if the instance id is not valid + ${temporal_entity_representation_id} speed invalidId +016_02_04_modify attribute instance in temporal representation of an entity if the instance id is not present + ${temporal_entity_representation_id} speed ${EMPTY} +016_02_05_modify attribute instance in temporal representation of an entity if the attribute name is not a valid name + ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} 016_02_06_modify attribute instance in temporal representation of an entity if the attribute name is not present - ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + *** Keywords *** Modify Attribute Instance Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right [Tags] tea-partial-update 5_6_14 - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 168d4040..9c805e2d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -1,44 +1,60 @@ *** Settings *** -Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the entityId/attributeId/instanceId is not right -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity -Test Template Modify Attribute Instance Temporal Entity - -*** Variable *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${filename}= vehicle-temporal-representation-sample.jsonld -${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld -${status_code}= 404 - -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID -016_03_01_modify attribute instance in temporal representation of an entity if the entity with given id is not found - ${unknown_temporal_entity_id} speed ${valid_instanceId} +Documentation Check that you cannot modify an attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Id +Suite Teardown Delete Temporal Entity +Test Template Modify Attribute Instance Temporal Entity + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-temporal-representation-sample.jsonld +${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld +${status_code}= 404 -016_03_02_modify attribute instance in temporal representation of an entity if the target attribute is not found - ${temporal_entity_representation_id} speed2 ${valid_instanceId} +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +016_03_01_modify attribute instance in temporal representation of an entity if the entity with given id is not found + ${unknown_temporal_entity_id} speed ${valid_instanceId} +016_03_02_modify attribute instance in temporal representation of an entity if the target attribute is not found + ${temporal_entity_representation_id} speed2 ${valid_instanceId} 016_03_03_modify attribute instance in temporal representation of an entity if the target attribute instance is not found - ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + ${temporal_entity_representation_id} speed urn:ngsi-ld:01234567890123456789 + *** Keywords *** Modify Attribute Instance Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} - [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the entity/attribute/instance id is not found + [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not found [Tags] tea-partial-update 5_6_14 - ${response}= Modify Attribute Instance From Temporal Entity ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + ${response}= Modify Attribute Instance From Temporal Entity + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response['status']} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${temporal_entity_representation_id} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type + ... ${temporal_entity_representation_id} + ... ${filename} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} - ${response}= Get Temporal Representation Of Entity ${temporal_entity_representation_id} ${CONTENT_TYPE_LD_JSON} sysAttrs ${ngsild_test_suite_context} + ${response}= Get Temporal Representation Of Entity + ... ${temporal_entity_representation_id} + ... ${CONTENT_TYPE_LD_JSON} + ... sysAttrs + ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 3670536a..24f69dd4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -1,13 +1,16 @@ *** Settings *** -Documentation Check that you can create a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_expectation_file_path}= subscriptions/expectations/subscription-028-01-expectation.jsonld -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_expectation_file_path}= subscriptions/expectations/subscription-028-01-expectation.jsonld *** Test Cases *** Create Subscription @@ -16,6 +19,9 @@ Create Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} Check Created Resource Set To ${expected_subscription} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index a4a848a2..6fdab2c6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Create Subscription With Invalid Request +Documentation Check that you cannot create a subscription with an invalid request + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Create Subscription With Invalid Request -*** Test Cases *** FILENAME EXPECTED_STATUS -028_02_01_InvalidJson - subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +*** Test Cases *** FILENAME EXPECTED_STATUS +028_02_01_InvalidJson + subscription-invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 028_02_02_EmptyJson - subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + subscription-empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} + *** Keywords *** Create Subscription With Invalid Request - [Arguments] ${filename} ${expected_status} [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 + [Arguments] ${filename} ${expected_status} Create Subscription From File ${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${expected_status} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${expected_status} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index 92b40f77..b2d0a297 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -1,26 +1,35 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an invalid/empty id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Subscription With Invalid/Empty Id +Documentation Check that you cannot create a subscription with an invalid/empty id + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Create Subscription With Invalid/Empty Id + *** Variables *** -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + *** Test Cases *** ID 028_03_01_InvalidId - invalidId + invalidId +028_03_02_EmptyId ${EMPTY} -028_03_02_EmptyId ${EMPTY} *** Keywords *** Create Subscription With Invalid/Empty Id - [Arguments] ${subscription_id} [Documentation] Check that you cannot create a subscription with an invalid/empty id [Tags] sub-create 5_8_1 - ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + [Arguments] ${subscription_id} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index d6ab2b2d..6683c91b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -1,21 +1,29 @@ *** Settings *** -Documentation Check that you cannot create a subscription with an existing id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a subscription with an existing id -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - ${response}= Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 38ac89bb..4c86e30a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Delete Subscription With Non present Or Invalid Id +Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Delete Subscription With Non present Or Invalid Id + *** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-delete 5_8_5 +NotPresentId [Tags] sub-delete 5_8_5 + ${EMPTY} +InvalidId [Tags] sub-delete 5_8_5 + InvalidUri -InvalidId InvalidUri - [Tags] sub-delete 5_8_5 *** Keywords *** Delete Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Delete Subscription ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index b46d3c8e..930dbf02 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -1,13 +1,17 @@ *** Settings *** -Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + + +*** Test Cases *** Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-delete 5_8_5 Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 4b7f1243..f6ded38a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can delete a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can delete a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + + +*** Test Cases *** Delete Subscription [Documentation] Check that you can delete a subscription [Tags] sub-delete 5_8_5 @@ -19,6 +23,7 @@ Delete Subscription Retrieve Subscription ${subscription_id} Check SUT Not Containing Resource + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index dc79f31e..c366b8b6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -1,24 +1,50 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +Documentation Check that a notification is only sent if and only if the status is active + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is only sent if status is active + [Documentation] Check that a notification is only sent if and only if the status is active + [Tags] sub-notification 5_11_7 046_01 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -35,28 +61,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} - - -*** Test Cases *** -Check that a notification is only sent if status is active - [Documentation] Check that a notification is only sent if and only if the status is active - [Tags] sub-notification 5_11_7 046_01 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index df35844b..0a9bc524 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -1,23 +1,54 @@ *** Settings *** -Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes." -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld +Documentation If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** +Check that a notification is sent on the timeInterval + [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. + [Tags] sub-notification 5_11_7 046_02 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + ${notification}= Wait for notification timeout=${15} + Output ${notification} + + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -26,7 +57,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -40,26 +71,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - - -*** Test Case *** -Check that a notification is sent on the timeInterval - [Documentation] If a Subscription defines a timeInterval member, a Notification shall be sent periodically, when the time interval (in seconds) specified in such value field is reached, regardless of Attribute changes. - [Tags] sub-notification 5_11_7 046_02 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - ${notification}= Wait for notification timeout=${15} - Output ${notification} - - ${notification}= Wait for notification timeout=${15} - Output ${notification} - - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index cb761040..bef47b8a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -1,23 +1,50 @@ *** Settings *** -Documentation A notification with all subscribed Entities will be included if query or geoquery are not defined. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld +Documentation A notification with all subscribed Entities will be included if query or geoquery are not defined. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-timeInterval-sample.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld + + +*** Test Cases *** +Check that a notification is sent with all entities + [Documentation] A notification with all subscribed Entities will be included if query or geoquery are not defined. + [Tags] sub-notification 5_11_7 046_03 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -26,7 +53,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -40,24 +67,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -Check that a notification is sent with all entities - [Documentation] A notification with all subscribed Entities will be included if query or geoquery are not defined. - [Tags] sub-notification 5_11_7 046_03 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='4.0' or '${notification}[data][0][airQualityLevel][value]'=='4' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index a027eb05..bd71d44b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -1,25 +1,51 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** +Check that a notification is sent with all entities + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 046_04 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] + Should be Equal Eiffel Tower ${notification}[data][0][name][value] -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -28,7 +54,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -42,26 +68,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -Check that a notification is sent with all entities - [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 046_04 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] - Should be Equal Eiffel Tower ${notification}[data][0][name][value] - - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index a2e79d68..83d3bcdb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -1,25 +1,52 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** +Check that a notification is sent with all entities + [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions + [Tags] sub-notification 5_11_7 046_05 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification ${5} + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Dictionary Should Contain Key ${notification} data + Should Not Be Empty ${notification}[data] Notification data should not be empty + Should be Equal ${entity_id} ${notification}[data][0][id] + Should be True + ... '${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5' + Should be Equal Eiffel Tower ${notification}[data][0][name][value] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -28,7 +55,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} @@ -42,22 +69,3 @@ After Test Delete Initial Subscriptions Delete Initial Entity Stop Local Server - -*** Test Case *** -Check that a notification is sent with all entities - [Documentation] The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and4.10) the query and geoquery conditions - [Tags] sub-notification 5_11_7 046_05 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification ${5} - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Dictionary Should Contain Key ${notification} data - Should Not Be Empty ${notification}[data] Notification data should not be empty - Should be Equal ${entity_id} ${notification}[data][0][id] - Should be True '${notification}[data][0][airQualityLevel][value]'=='5.0' or '${notification}[data][0][airQualityLevel][value]'=='5' - Should be Equal Eiffel Tower ${notification}[data][0][name][value] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index ed4ca9b7..d47618f9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -1,24 +1,46 @@ *** Settings *** -Documentation If a Subscription does not define a timeInterval term, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Server And Subscriptions -Suite Teardown Delete Server And Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-location-attribute.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +Documentation If a Subscription does not define a timeInterval member, the notification shall be sent whenever there is a change in the watched Attributes. The notification message shall include all the subscribed Entities that changed and that match (as mandated by clauses 4.9 and 4.10) the query and geoquery conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Server And Subscriptions +Suite Teardown Delete Server And Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active-query.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${building_filename}= building-location-attribute.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent with all matching entities + [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. + [Tags] sub-notification 5_11_7 046_06 + ${entity_building}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + + Output ${notification} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + *** Keywords *** Setup Server And Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} @@ -29,20 +51,3 @@ Delete Server And Subscriptions Delete Subscription ${subscription_id} Delete Entity by Id Returning Response ${entity_id} Stop Local Server - -*** Test Case *** -Check that a notification is sent with all matching entities - [Documentation] only the subscribed Entities matching the query and watched attributes shall be included. - [Tags] sub-notification 5_11_7 046_06 - ${entity_building}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - Output ${notification} - Should be Equal ${subscription_id} ${notification}[subscriptionId] - Should be Equal ${entity_id} ${notification}[data][0][id] - - - - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index 7409fd3a..a6c1e607 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -1,108 +1,110 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active - -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${subscription_payload_file_path_watchedAttributes}= subscriptions/subscription-building-entities-active-watchedAttributes.jsonld -${subscription_payload_file_path_default_context}= subscriptions/subscription-building-entities-active-default-context.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +Documentation Check that a notification is only sent if and only if the status is active -*** Keywords *** -Setup Initial Subscriptions - [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Delete Initial Subscriptions - Delete Subscription ${subscription_id} +Suite Setup Before Test +Suite Teardown After Test -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} -Delete Initial Entity - Delete Entity by Id ${entity_id} - -Delete Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-active.jsonld +${subscription_payload_file_path_watchedAttributes} subscriptions/subscription-building-entities-active-watchedAttributes.jsonld +${subscription_payload_file_path_default_context} subscriptions/subscription-building-entities-active-default-context.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${date_format} %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ -After Test - Stop Local Server *** Test Cases *** Check notification structure - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. Valid notification with attributes as stated above [Tags] sub-notification 5_8_6 046_07_01 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + + ${notification}= Wait for notification + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check correct attributes are included - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. The Entity Attributes included (Properties or Relationships) shall be those specified by the notification.attributes member in the Subscription data type (clause 5.2.12). [Tags] sub-notification 5_8_6 046_07_02 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions ${subscription_payload_file_path_watchedAttributes} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + + ${notification}= Wait for notification + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] airQualityLevel - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check URI expansion is observed - [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). + [Documentation] The structure of the notification message shall be as mandated by clause 5.3. URI expansion shall be observed (clause 5.5.7). [Tags] sub-notification 5_8_6 046_07_03 Add Initial Entity - Sleep 1s - Setup Initial Subscriptions ${subscription_payload_file_path_default_context} + Sleep 1s + Setup Initial Subscriptions ${subscription_payload_file_path_default_context} Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification} Wait for notification + + ${notification}= Wait for notification Output ${notification} - Should Be Equal ${notification}[type] Notification - Should Be Equal ${notification}[subscriptionId] ${subscription_id} + Should Be Equal ${notification}[type] Notification + Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} ${is_date_with_millis}= Is Date ${notification}[notifiedAt] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} Dictionary Should Contain Key ${notification}[data][0] https://ngsi-ld-test-suite/context#airQualityLevel - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data +*** Keywords *** +Setup Initial Subscriptions + [Arguments] ${subscription_payload_path}=${subscription_payload_file_path} + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_path} + ... ${subscription_id} + ... ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} + +Delete Fixture Data + Delete Initial Subscriptions + Delete Initial Entity + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 365dc57f..0c52a261 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -1,63 +1,37 @@ *** Settings *** -Documentation Check that a notification is only sent if and only if the status is active -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld +Documentation Check that a notification is only sent if and only if the status is active -*** Keywords *** -Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Delete Initial Subscriptions - Delete Subscription ${subscription_id} +Suite Setup Before Test +Suite Teardown After Test -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} -Delete Initial Entity - Delete Entity by Id ${entity_id} +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld -Delete Fixture Data - Delete Initial Subscriptions - Delete Initial Entity - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} -After Test - Stop Local Server - - -*** Test Case *** +*** Test Cases *** Check that a notification is sent with all attributes - [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included. All attributes are included [Tags] sub-notification 5_8_6 046_08_01 - + Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions - + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - + ${notification}= Wait for notification ${5} - Output ${notification} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -67,36 +41,67 @@ Check that a notification is sent with all attributes Dictionary Should Contain Key ${notification}[data][0] almostFull Dictionary Should Contain Key ${notification}[data][0] airQualityLevel Dictionary Should Contain Key ${notification}[data][0] subCategory - [Teardown] Delete Fixture Data + [Teardown] Delete Fixture Data Check that a notification is sent with all attributes in simplified format - [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided + [Documentation] The structure of the notification message shall be as mandated by clause 5.3.1. The absence of the notification.attributes member of a Subscription means that all Entity Attributes shall be included If the notification.format member value is "keyValues" then a simplified representation of the entities (as mandated by clause 4.5.3) shall be provided [Tags] sub-notification 5_8_6 046_08_02 - + Add Initial Entity ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Update Value To Json ${subscription_payload} $..notification['format'] keyValues + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} + ${subscription_payload}= Update Value To JSON + ... ${subscription_payload} + ... $..notification['format'] + ... keyValues ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} + Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty - Should Be Equal ${entity_id} ${notification}[data][0][id] - Should be Equal Eiffel Tower ${notification}[data][0][name] - [Teardown] Delete Fixture Data + Should Be Equal ${entity_id} ${notification}[data][0][id] + Should be Equal Eiffel Tower ${notification}[data][0][name] + [Teardown] Delete Fixture Data - +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} +Delete Initial Entity + Delete Entity by Id ${entity_id} +Delete Fixture Data + Delete Initial Subscriptions + Delete Initial Entity +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} +After Test + Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 52c9357c..94f38d3f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -1,27 +1,45 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent to the endpoint + [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.1 + [Tags] sub-notification 5_11_7 046_09 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + ${notification}= Wait for notification timeout=${10} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -38,24 +56,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} - -*** Test Cases *** -Check that a notification is sent to the endpoint - [Documentation] A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.1 - [Tags] sub-notification 5_11_7 046_09 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - ${notification}= Wait for notification timeout=${10} - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 04828132..8b91cbdb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -1,28 +1,56 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-default.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${expected_header_links}= <${ngsild_test_suite_context}>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-default.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify +${expected_header_links} <${ngsild_test_suite_context}>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" + + +*** Test Cases *** +Check that a notification is JSON + [Documentation] The Notification content shall be JSON by default + [Tags] sub-notification 5_11_7 046_10 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait For Request timeout=${10} + Reply By 200 + + ${notification_headers}= Get Request Headers + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Contain Item ${notification_headers_dict} Link ${expected_header_links} + + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification}= Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Not Contain Key ${notification}[data][0] @context + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -39,33 +67,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} - -*** Test Cases *** -Check that a notification is JSON - [Documentation] The Notification content shall be JSON by default - [Tags] sub-notification 5_11_7 046_10 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait For Request timeout=${10} - Reply By 200 - - ${notification_headers} = Get Request Headers - ${notification_headers_dict}= Convert To Dictionary ${notification_headers} - Dictionary Should Contain Item ${notification_headers_dict} Link ${expected_header_links} - - ${notification_payload}= Get Request Body - # json.loads parses the payload as json. It fails if the payload is malformed - ${notification} Evaluate json.loads('''${notification_payload}''') json - Dictionary Should Not Contain Key ${notification}[data][0] @context - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index f17154bc..3867b044 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -1,29 +1,55 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +${date_format}= %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ + + +*** Test Cases *** +Check that timesSent is increased by one + [Documentation] The notification.timesSent member shall be incremented by one. + [Tags] sub-notification 5_11_7 046_11 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait for notification timeout=${10} + + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} + + Dictionary Should Contain Key ${response}[body][notification] timesSent + Should Be Equal ${1} ${response}[body][notification][timesSent] + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -40,29 +66,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} - -*** Test Cases *** -Check that timesSent is increased by one - [Documentation] The notification.timesSent member shall be incremented by one. - [Tags] sub-notification 5_11_7 046_11 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait for notification timeout=${10} - - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - - Dictionary Should Contain Key ${response}[body][notification] timesSent - Should Be Equal ${1} ${response}[body][notification][timesSent] - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index d32c1f9e..44160ead 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -1,70 +1,47 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld +${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify -*** Keywords *** -Setup Initial Subscriptions - ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} - ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} - Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${subscription_id} - -Delete Initial Subscriptions - Delete Subscription ${subscription_id} - -Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} - -After Test - Delete Initial Subscriptions - Delete Initial Entity - Stop Local Server - -Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity ${entity_building_filepath} ${entity_id} - Set Suite Variable ${entity_id} - -Delete Initial Entity - Delete Entity by Id ${entity_id} *** Test Cases *** Check that lastNotification is updated - [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. + [Documentation] The status, lastNotification and lastSuccess members shall be updated with expected value and dates. This test will check these formats. [Tags] sub-notification 5_11_7 046_12 Add Initial Entity - Sleep 1s + Sleep 1s Setup Initial Subscriptions Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Wait for notification timeout=${10} - - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} + + ${notification_info}= Get Value From JSON ${response} $.body.notification + Output ${notification_info} Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal ok ${notification_info}[0][status] + Should Be Equal ok ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastNotification ${is_date}= Is Date ${notification_info}[0][lastNotification] ${date_format} @@ -76,3 +53,33 @@ Check that lastNotification is updated ${is_date_with_millis}= Is Date ${notification_info}[0][lastSuccess] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} + ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} + Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} + +Before Test + NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + +After Test + Delete Initial Subscriptions + Delete Initial Entity + Stop Local Server + +Add Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity ${entity_building_filepath} ${entity_id} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index aa250ef3..d3e13671 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -1,54 +1,62 @@ *** Settings *** -Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource -Suite Setup Before Test -Suite Teardown After Test - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld - -*** Test Case *** +Documentation If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Suite Setup Before Test +Suite Teardown After Test + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-building-entities-active.jsonld +${building_id_prefix}= urn:ngsi-ld:Building: +${entity_building_filepath}= building-simple-attributes-sample.jsonld +${fragment_filename}= airQualityLevel-fragment.jsonld + + +*** Test Cases *** Check that lastFailure and status are updated if a notification could not be sent - [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed + [Documentation] If the response to the notification request is different than 200 OK then implementations shall: Update notification.lastFailure with a timestamp representing the current date and time, update notification.status to "failed" [Tags] sub-notification 5_11_7 046_13 @{expected_notification_data_entities}= Create List Building Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Sleep 10s + Sleep 10s - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response} $.body.notification + Output ${notification_info} Dictionary Should Contain Key ${notification_info}[0] status - Should Be Equal failed ${notification_info}[0][status] + Should Be Equal failed ${notification_info}[0][status] Dictionary Should Contain Key ${notification_info}[0] lastFailure ${is_date}= Is Date ${notification_info}[0][lastFailure] ${date_format} ${is_date_with_millis}= Is Date ${notification_info}[0][lastFailure] ${date_format_with_millis} Should Be True ${is_date} or ${is_date_with_millis} + *** Keywords *** Setup Initial Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} Delete Initial Subscription - Delete Subscription ${subscription_id} + Delete Subscription ${subscription_id} Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index 4b6b5cff..b4601190 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -1,27 +1,55 @@ *** Settings *** -Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Documentation A Notification shall be sent (as mandated by each concrete binding and including any optional endpoint.info defined by clause 5.2.22) to the endpoint specified by the endpoint.uri member of the notification structure defined by clause 5.2.14 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource +Suite Setup Before Test +Suite Teardown After Test -Suite Setup Before Test -Suite Teardown After Test -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-building-entities-accept-jsonld.jsonld -${building_id_prefix}= urn:ngsi-ld:Building: -${entity_building_filepath}= building-simple-attributes-sample.jsonld -${fragment_filename}= airQualityLevel-fragment.jsonld -${notification_server_send_url}= http://${send_notification_server_host}:${send_notification_server_port}/notify +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-building-entities-accept-jsonld.jsonld +${building_id_prefix} urn:ngsi-ld:Building: +${entity_building_filepath} building-simple-attributes-sample.jsonld +${fragment_filename} airQualityLevel-fragment.jsonld +${notification_server_send_url} http://${send_notification_server_host}:${send_notification_server_port}/notify + + +*** Test Cases *** +Check that a notification is sent as JSON-LD + [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' + [Tags] sub-notification 5_11_7 046_14 + + Add Initial Entity + Sleep 1s + Setup Initial Subscriptions + + Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + + Wait For Request timeout=${10} + Reply By 200 + + ${notification_headers}= Get Request Headers + ${notification_headers_dict}= Convert To Dictionary ${notification_headers} + Dictionary Should Not Contain Key ${notification_headers_dict} Link + + ${notification_payload}= Get Request Body + # json.loads parses the payload as json. It fails if the payload is malformed + ${notification}= Evaluate json.loads('''${notification_payload}''') json + Dictionary Should Contain Key ${notification}[data][0] @context + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} ${notification_server_send_url} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} ${subscription_payload}= Set Entity Id In Subscription ${subscription_payload} ${entity_id} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} @@ -38,34 +66,9 @@ After Test Stop Local Server Add Initial Entity - ${entity_id}= Generate Random Entity Id ${building_id_prefix} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_building_filepath} ${entity_id} Set Suite Variable ${entity_id} Delete Initial Entity Delete Entity by Id ${entity_id} - -*** Test Cases *** -Check that a notification is sent as JSON-LD - [Documentation] The Notification content shall be JSON-LD when we set endpoint.accept to 'application/ld+json' - [Tags] sub-notification 5_11_7 046_14 - - Add Initial Entity - Sleep 1s - Setup Initial Subscriptions - - Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - - Wait For Request timeout=${10} - Reply By 200 - - ${notification_headers} = Get Request Headers - ${notification_headers_dict}= Convert To Dictionary ${notification_headers} - Dictionary Should Not Contain Key ${notification_headers_dict} Link - - ${notification_payload}= Get Request Body - # json.loads parses the payload as json. It fails if the payload is malformed - ${notification} Evaluate json.loads('''${notification_payload}''') json - Dictionary Should Contain Key ${notification}[data][0] @context - - diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index afd183c1..124aac46 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -1,35 +1,54 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json - -*** Test Case *** +Documentation Check that you can query a list of subscriptions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-031-01-expectation.json + + +*** Test Cases *** Query Subscriptions [Documentation] Check that you can query a list of subscriptions [Tags] sub-query 5_8_4 Query Subscriptions context=${ngsild_test_suite_context} - @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} ${third_subscription_id} + @{subscription_ids}= Create List + ... ${first_subscription_id} + ... ${second_subscription_id} + ... ${third_subscription_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + Check Response Body Containing List Containing Subscription elements + ... ${expectation_file_path} + ... ${subscription_ids} + *** Keywords *** Setup Initial Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${first_subscription_id} + ... ${first_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${second_subscription_id} + ... ${second_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${third_subscription_id} + ... ${third_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} Set Suite Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index ab108f6b..3cd655f2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -1,36 +1,43 @@ *** Settings *** -Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld - -*** Test Cases *** LIMIT OFFSET EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${1} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] sub-query 5_8_4 +Documentation Check that you can query a list of subscriptions: Pagination logic shall be in place + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Query Subscriptions With Limit And Page Parameters + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= subscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld -Query Last Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] sub-query 5_8_4 +*** Test Cases *** LIMIT OFFSET EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] sub-query 5_8_4 + ${1} ${1} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription + [Tags] sub-query 5_8_4 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${0} ${3} ${EMPTY} ${EMPTY} - [Tags] sub-query 5_8_4 + [Tags] sub-query 5_8_4 + ${15} ${0} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place - Query Subscriptions context=${ngsild_test_suite_context} limit=${limit} offset=${offset} accept=${CONTENT_TYPE_LD_JSON} + [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} + Query Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + ... offset=${offset} + ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +46,18 @@ Setup Initial Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${first_subscription_id} ${first_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${second_subscription_id} ${second_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} - Create Subscription ${third_subscription_id} ${third_subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${first_subscription_id} + ... ${first_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${second_subscription_id} + ... ${second_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Create Subscription + ... ${third_subscription_id} + ... ${third_subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} Set Suite Variable ${third_subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 29d83423..5527f34a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -1,18 +1,24 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription if the subscription Id is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Retrieve Subscription With Non present Or Invalid Id +Documentation Check that you cannot retrieve a subscription if the subscription Id is not a valid URI, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Retrieve Subscription With Non present Or Invalid Id + *** Test Cases *** id -InvalidId InvalidUri - [Tags] sub-retrieve 5_8_3 +InvalidId [Tags] sub-retrieve 5_8_3 + InvalidUri + *** Keywords *** Retrieve Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Retrieve Subscription ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 3eef3269..07f3e914 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -1,13 +1,17 @@ *** Settings *** -Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource +Documentation Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + + +*** Test Cases *** Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-retrieve 5_8_3 Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 65925913..95f09088 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${expectation_file_path}= subscriptions/expectations/subscriptions-030-03-expectation.json + + +*** Test Cases *** Retrieve Subscription [Documentation] Check that you can retrieve a subscription [Tags] sub-retrieve 5_8_3 @@ -19,6 +23,7 @@ Retrieve Subscription Check Response Status Code Set To 200 Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 7fa6d396..b3e29e80 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Subscription With Non present Or Invalid Id +Documentation Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised -*** Test Cases *** id -NotPresentId ${EMPTY} - [Tags] sub-update 5_8_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Subscription With Non present Or Invalid Id + + +*** Variables *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json -InvalidId InvalidUri - [Tags] sub-update 5_8_2 -*** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +*** Test Cases *** id +NotPresentId [Tags] sub-update 5_8_2 + ${EMPTY} +InvalidId [Tags] sub-update 5_8_2 + InvalidUri + *** Keywords *** Update Subscription With Non present Or Invalid Id - [Arguments] ${id} [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Arguments] ${id} Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 738478a0..6f036a32 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -1,17 +1,25 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised -*** Variable *** -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] sub-update 5_8_2 - Update Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Update Subscription + ... urn:ngsi-ld:Subscription:unknowSubscription + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 844a3d6b..de3acfcb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-invalid-update-sample.json + + +*** Test Cases *** Update Subscription With Invalid Fragment [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index dfcec456..86093c7c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-null-properties-update-sample.json + + +*** Test Cases *** Update Subscription With Null Mandatory Properties [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 6d292ebe..c9c78770 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -1,28 +1,41 @@ *** Settings *** -Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json -${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld +Documentation Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-vehicle-entities-sample.json +${expected_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-sample.jsonld ${expected_expanded_subscription_payload_file_path}= subscriptions/expectations/subscription-vehicle-expanded-types-sample.jsonld -*** Test Case *** + +*** Test Cases *** Update Subscription With Term to Uri Expansion [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Body Containing Subscription element ${expected_subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expected_subscription_payload_file_path} + ... ${subscription_id} Retrieve Subscription ${subscription_id} - Check Response Body Containing Subscription element ${expected_expanded_subscription_payload_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expected_expanded_subscription_payload_file_path} + ... ${subscription_id} + *** Keywords *** Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 57b56ab2..0208b267 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -1,28 +1,40 @@ *** Settings *** -Documentation Check that you can update a subcription: The implementation shall modify the target Subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subcription: The implementation shall modify the target Subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Subscription [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} Check Response Status Code Set To 204 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Subscription ${subscription_id} accept=${CONTENT_TYPE_LD_JSON} context=${ngsild_test_suite_context} + Retrieve Subscription + ... ${subscription_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} ${ignored_attributes}= Create List ${status_regex_expr} Check Updated Resource Set To ${subscription} ${ignored_attributes} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index babf73b2..af036480 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -1,24 +1,29 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Activate Paused Subscription With isActive Member -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Activate Paused Subscription With isActive Member + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH -ActiveTrue subscriptions/fragments/subscription-isActive-true-update-sample.json - [Tags] sub-update 5_8_2 +ActiveTrue [Tags] sub-update 5_8_2 + subscriptions/fragments/subscription-isActive-true-update-sample.json -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive Member - [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" + [Arguments] ${subscription_update_fragment_file_path} Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index aa0b67ee..fa850b10 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -1,25 +1,30 @@ *** Settings *** -Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Activate Paused Subscription With isActive And ExpiresAt Members -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Documentation Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions +Test Template Activate Paused Subscription With isActive And ExpiresAt Members + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld + *** Test Cases *** SUBSCRIPTION_UPDATE_FRAGMENT_FILE_PATH ActiveTrueExpiresAt - subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json - [Tags] sub-update 5_8_2 + [Tags] sub-update 5_8_2 + subscriptions/fragments/subscription-isActive-expiresAt-update-sample.json -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-inactive-sample.jsonld *** Keywords *** Activate Paused Subscription With isActive And ExpiresAt Members - [Arguments] ${subscription_update_fragment_file_path} [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" + [Arguments] ${subscription_update_fragment_file_path} Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 51ef9d3f..20d49129 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-false-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-isActive-false-update-sample.json + + +*** Test Cases *** Update Subscription Status To Paused [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" [Tags] sub-update 5_8_2 @@ -20,6 +24,7 @@ Update Subscription Status To Paused Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 050ff8c7..1d09768a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-future-update-sample.json - -*** Test Case *** +Documentation Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix} urn:ngsi-ld:Subscription: +${subscription_payload_file_path} subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path} subscriptions/fragments/subscription-expiresAt-future-update-sample.json + + +*** Test Cases *** Activate Expired Subscription [Documentation] Check that you can update a subscription: If only expiresAt is included and refers to a DateTime in the future, then status shall be updated to "active", if and only if the previous value of status was "expired" [Tags] sub-update 5_8_2 # Update subscription to expire in 5 seconds - ${now} = Get Current Date time_zone=UTC - ${in_5_seconds} = Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ - ${update_template_fragment}= Load Json From File ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json - ${update_fragment}= Update Value To Json ${update_template_fragment} $..expiresAt ${in_5_seconds} + ${now}= Get Current Date time_zone=UTC + ${in_5_seconds}= Add Time To Date ${now} 5s result_format=%Y-%m-%dT%H:%M:%SZ + ${update_template_fragment}= Load JSON From File + ... ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json + ${update_fragment}= Update Value To JSON ${update_template_fragment} $..expiresAt ${in_5_seconds} Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} - Sleep 10s + Sleep 10s Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 204 Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 40044f5b..5540ede2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json - -*** Test Case *** +Documentation Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-expiresAt-update-sample.json + + +*** Test Cases *** Update Subscription With ExpiresAt In The Past [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised [Tags] sub-update 5_8_2 Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index d844d583..69c9629e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -1,24 +1,30 @@ *** Settings *** -Documentation Check that you can create a context source registration with specific ID and expiration date -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a context source registration with specific ID and expiration date -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration-sample.jsonld + + +*** Test Cases *** Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index f3adc17d..d996cff6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -1,24 +1,30 @@ *** Settings *** -Documentation Check that you can create a context source registration that never expires -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a context source registration that never expires -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index ae60a499..11abfe09 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -1,23 +1,29 @@ *** Settings *** -Documentation Check that when creating a context source registration without specifying an ID -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can create a context source registration without specifying an ID -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Without A Sprecified ID - [Documentation] Check that when creating a context source registration without specifying an ID + [Documentation] Check that you can create a context source registration without specifying an ID [Tags] csr-create - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${request} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response['status']} ${registration_id}= Check Response Headers ID Not Empty ${response} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 19e2d2e1..92f24839 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -1,31 +1,37 @@ *** Settings *** -Documentation Check that you cannot create a context source with invalid content -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source with invalid content + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld *** Test Cases *** 033_02_01_Create a context source registration with invalid JSON file Create a context source registration with invalid JSON file 033_02_02_Create a context source registration with a different data structure than CsourRegistration data type - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld + Create Context Source With Invalid Content + ... csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld 033_02_03_Create a context source registration with a date in the past - Create Context Source With Invalid Content csourceRegistrations/context-source-registration-past-expiration-sample.jsonld + Create Context Source With Invalid Content + ... csourceRegistrations/context-source-registration-past-expiration-sample.jsonld + *** Keywords *** Create Context Source With Invalid Content - [Arguments] ${filename} [Documentation] Check that you cannot create a context source with invalid content [Tags] csr-create + [Arguments] ${filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 400 ${response['status']} Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} @@ -35,7 +41,9 @@ Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${response}= Create Context Source Registration Using Session ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Context Source Registration Using Session + ... ${registration_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 0508f6a6..8f0667b5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -1,20 +1,23 @@ *** Settings *** -Documentation Check that you cannot create a context source registration that already exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source registration that already exists + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= csourceRegistrations/context-source-registration-simple-sample.jsonld *** Test Cases *** Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index bc129106..bc2c7303 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -1,24 +1,32 @@ *** Settings *** -Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} ${ngsild_test_suite_context} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + Check JSON Value In Response Body + ... ['information']['entities'][0]['type'] + ... https://ngsi-ld-test-suite/context#Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index 1a73a52a..bf8c0eaa 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -1,21 +1,26 @@ *** Settings *** -Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index badb665c..78a6639b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -1,21 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_JSON} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index c4ce1256..dcbb5536 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -1,24 +1,31 @@ *** Settings *** -Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] https://ngsi-ld-test-suite/context#Building + Check JSON Value In Response Body + ... ['information']['entities'][0]['type'] + ... https://ngsi-ld-test-suite/context#Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index 6562b0ab..6a305cd1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -1,21 +1,28 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.json + + +*** Test Cases *** Create one context source registration not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index a789f920..90b94a8e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -1,21 +1,29 @@ *** Settings *** -Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= csourceRegistrations/context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Create one context source registration with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} ${CONTENT_TYPE_LD_JSON} ${ngsild_test_suite_context} + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${request} ${response}= Create Context Source Registration With Return + ... ${updated_payload} + ... ${CONTENT_TYPE_LD_JSON} + ... ${ngsild_test_suite_context} Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 59679a2a..b16395d0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -1,20 +1,23 @@ *** Settings *** -Documentation Check that you can delete a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you can delete a context source registration by id -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Delete a context source registration by id [Documentation] Check that you can delete a context source registration by id [Tags] csr-delete ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index eec164b4..c6a0411b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -1,29 +1,33 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Delete Context Source +Documentation Check that you cannot delete a context source registration under some conditions -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld -*** Test Case *** INVALID_REGISTRATION_ID -035_02_01_Delete a Context Source Registration if the Id is not present - ${EMPTY} +*** Test Cases *** INVALID_REGISTRATION_ID +035_02_01_Delete a Context Source Registration if the Id is not present + ${EMPTY} 035_02_02_Delete a Context Source Registration if the Id is not a valid URI - invalidURI + invalidURI + *** Keywords *** Delete Context Source - [Arguments] ${invalid_registration_id} [Documentation] Check that you cannot delete a context source registration under some conditions [Tags] csr-delete + [Arguments] ${invalid_registration_id} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index 699983e8..a6ef7d32 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete a context source registration by id if the id is not known to the system -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${registration_payload_file_path}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Delete a context source registration by id [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system [Tags] csr-delete diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index e209fd5e..09b5854a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -1,39 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of entity types - type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of entity types + [Tags] csr-query 5_10_2 + type Building csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} With list of attribute names - attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + attrs name csourceRegistrations/expectations/context-source-registrations-037-01-expectation.json ${second_context_source_registration_id} + *** Keywords *** Query Context Source Registration - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations if at least one of list of Entity Types or list of Attribute names is present - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] + ... ${query_param_name} + ... ${query_param_value} + ... ${expectation_file_path} + ... @{expected_context_source_registration_ids} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} Set Suite Variable ${first_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index c1891a09..86577045 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Query Context Source Registrations Without Entity Types and Attribute Names - [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type + [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index 477257c2..9b0e6584 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -1,29 +1,34 @@ *** Settings *** -Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Invalid Query Param +Documentation Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE -Invalid URI id invalidUri - [Tags] csr-query 5_10_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -Invalid Query q invalidQuery - [Tags] csr-query 5_10_2 +Test Template Query Context Source Registration With Invalid Query Param -Invalid GeoQuery georel within - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE +Invalid URI [Tags] csr-query 5_10_2 + id invalidUri +Invalid Query [Tags] csr-query 5_10_2 + q invalidQuery +Invalid GeoQuery [Tags] csr-query 5_10_2 + georel within Invalid Temporal Query - timerel before - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + timerel before + *** Keywords *** Query Context Source Registration With Invalid Query Param - [Arguments] ${query_param_name} ${query_param_value} [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] ${query_param_name} ${query_param_value} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index cb677f78..b6be3201 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -1,29 +1,38 @@ *** Settings *** -Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-04-expectation.json + + +*** Test Cases *** Query Context Source Registrations Without Context [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context [Tags] csr-query 5_10_2 Query Context Source Registrations id=${context_source_registration_id} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index 8eb4542a..a272c716 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -1,32 +1,40 @@ *** Settings *** -Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo +Documentation Check that you can query context source registrations matching EntityInfo of RegistrationInfo -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH -Registration With EntityInfo Matching The Query - csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json - [Tags] csr-query 5_10_2 +*** Test Cases *** REGISTRATION_FILE_PATH EXPECTATION_FILE_PATH +Registration With EntityInfo Matching The Query + [Tags] csr-query 5_10_2 + csourceRegistrations/context-source-registration-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-01-expectation.json Registration Without EntityInfo - csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + csourceRegistrations/context-source-registration-with-only-properties-information-sample.jsonld csourceRegistrations/expectations/context-source-registrations-037-05-02-expectation.json + *** Keywords *** Query Context Source Registration Matching EntityInfo of RegistrationInfo - [Arguments] ${registration_file_path} ${expectation_file_path} [Documentation] Check that you can query context source registrations matching EntityInfo of RegistrationInfo + [Arguments] ${registration_file_path} ${expectation_file_path} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${registration_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${registration_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 162af3ea..0820e838 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -1,38 +1,45 @@ *** Settings *** -Documentation Check that you can query context source registrations matching property and relationships names of RegistrationInfo -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld - -*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH -Query With Matching Properties And Relationships - name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations matching property and relationship names of RegistrationInfo + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld + +*** Test Cases *** ATTRS_VALUE EXPECTATION_FILE_PATH +Query With Matching Properties And Relationships + [Tags] csr-query 5_10_2 + name,locatedAt csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json Query Without Properties And Relationships - ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${EMPTY} csourceRegistrations/expectations/context-source-registrations-037-06-expectation.json + *** Keywords *** Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo + [Documentation] Check that you can query context source registrations matching property and relationship names of RegistrationInfo [Arguments] ${attrs_value} ${expectation_file_path} - [Documentation] Check that you can query context source registrations matching property and relationships names of RegistrationInfo Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} -*** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index f6114f13..9a11fd2c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -1,36 +1,50 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Geoquery -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json - -*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH -Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} - [Tags] csr-query 5_10_2 - -Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Query Context Source Registration Matching Geoquery + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-07-expectation.json + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE_PATH +Near Point [Tags] csr-query 5_10_2 + near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} +Within Polygon [Tags] csr-query 5_10_2 + within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} + *** Keywords *** Query Context Source Registration Matching Geoquery + [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} - [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty identified in the geoquery - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... geoproperty=${geoproperty} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index af0bebcb..2300feb7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -1,29 +1,38 @@ *** Settings *** -Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-08-expectation.json + + +*** Test Cases *** Query Context Source Registration Without Temporal Query [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered [Tags] csr-query 5_10_2 Query Context Source Registrations context=${ngsild_test_suite_context} type=Building @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index fa24e095..29718acb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -1,44 +1,55 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Matching Temporal Query - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld -${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json -${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json - -*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH -Observation Interval With observedAt - ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +Documentation Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval -Observation Interval Without timeproperty - ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Query Context Source Registration Matching Temporal Query + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_observation_interval_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${context_source_registration_management_interval_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +${observation_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-01-expectation.json +${management_interval_expectation_file_path}= csourceRegistrations/expectations/context-source-registrations-037-09-02-expectation.json -Mqnagement Interval With createdAt - ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 +*** Test Cases *** PAYLOAD_FILE_PATH TIMEPROPERTY EXPECTATION_FILE_PATH +Observation Interval With observedAt + [Tags] csr-query 5_10_2 + ${context_source_registration_observation_interval_payload_file_path} observedAt ${observation_interval_expectation_file_path} +Observation Interval Without timeproperty + [Tags] csr-query 5_10_2 + ${context_source_registration_observation_interval_payload_file_path} ${EMPTY} ${observation_interval_expectation_file_path} +Mqnagement Interval With createdAt + [Tags] csr-query 5_10_2 + ${context_source_registration_management_interval_payload_file_path} createdAt ${management_interval_expectation_file_path} Mqnagement Interval With modifiedAt - ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${context_source_registration_management_interval_payload_file_path} modifiedAt ${management_interval_expectation_file_path} + *** Keywords *** Query Context Source Registration Matching Temporal Query - [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} [Documentation] Check that you can query context source registrations. If present, the temporal query is matched against the observationInterval or the managementInterval + [Arguments] ${payload_file_path} ${timeproperty} ${expectation_file_path} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building timeproperty=${timeproperty} timerel=before timeAt=2021-08-01T22:00:00Z + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... timeproperty=${timeproperty} + ... timerel=before + ... timeAt=2021-08-01T22:00:00Z @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index 746a3596..b35280c7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -1,46 +1,63 @@ *** Settings *** -Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Query Params -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration With Query Params + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS -With list of Entity Ids - id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 +*** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS +With list of Entity Ids + [Tags] csr-query 5_10_2 + id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01-expectation.json ${first_context_source_registration_id} ${third_context_source_registration_id} With NGSI-LD Query - q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 - + [Tags] csr-query 5_10_2 + q location.type=="GeoProperty" csourceRegistrations/expectations/context-source-registrations-037-10-02-expectation.json ${third_context_source_registration_id} With Context Source Filter - csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + csf endpoint=="http://my.csource.org:1026" csourceRegistrations/expectations/context-source-registrations-037-10-03-expectation.json ${first_context_source_registration_id} ${second_context_source_registration_id} ${third_context_source_registration_id} + *** Keywords *** Query Context Source Registration With Query Params - [Arguments] ${query_param_name} ${query_param_value} ${expectation_file_path} @{expected_context_source_registration_ids} [Documentation] Check that you can query context source registrations. If present, the conditions specified by the context source query match the respective Context Source Properties - Query Context Source Registrations context=${ngsild_test_suite_context} ${query_param_name}=${query_param_value} + [Arguments] + ... ${query_param_name} + ... ${query_param_value} + ... ${expectation_file_path} + ... @{expected_context_source_registration_ids} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... ${query_param_name}=${query_param_value} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Context Source Registrations elements ${expectation_file_path} ${expected_context_source_registration_ids} + Check Response Body Containing List Containing Context Source Registrations elements + ... ${expectation_file_path} + ... ${expected_context_source_registration_ids} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample + ... ${third_context_source_registration_payload_file_path} + ... ${third_context_source_registration_id} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} Create Context Source Registration ${third_context_source_registration_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index d4c124e9..536e6f29 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -1,36 +1,43 @@ *** Settings *** -Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +Documentation Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations +Test Template Query Context Source Registration With Limit And Page Parameters + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csr-query 5_10_2 +*** Test Cases *** LIMIT PAGE EXPECTED_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] csr-query 5_10_2 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" Query Last Subscription - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csr-query 5_10_2 - + [Tags] csr-query 5_10_2 + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csr-query 5_10_2 + [Tags] csr-query 5_10_2 + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Context Source Registration With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building limit=${limit} page=${page} + [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} + Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... limit=${limit} + ... page=${page} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +46,15 @@ Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${third_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} - ${third_context_source_registration_payload}= Load Test Sample ${third_context_source_registration_payload_file_path} ${third_context_source_registration_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} + ${third_context_source_registration_payload}= Load Test Sample + ... ${third_context_source_registration_payload_file_path} + ... ${third_context_source_registration_id} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} Create Context Source Registration ${third_context_source_registration_payload} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 07350f65..3794117d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -1,22 +1,27 @@ *** Settings *** -Documentation Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id +Documentation Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Retrieve Context Source Registration With A Not Present Or Invalid Id + *** Test Cases *** ID -Not Present Id ${EMPTY} - [Tags] csr-retrieve 5_10_1 +Not Present Id [Tags] csr-retrieve 5_10_1 + ${EMPTY} +Invalid Id [Tags] csr-retrieve 5_10_1 + invalidUri -Invalid Id invalidUri - [Tags] csr-retrieve 5_10_1 *** Keywords *** Retrieve Context Source Registration With A Not Present Or Invalid Id + [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI [Arguments] ${id} - [Documentation] Check that you cannot a retrieve Context Source Registration, if the context source registration id is not present or it is not a valid URI Retrieve Context Source Registration ${id} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index 4122014e..a2d3a3dc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Unknown Context Source Registration [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 2e950e84..0d3f3d52 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -1,28 +1,37 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json - -*** Test Case *** +Documentation Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + + +*** Test Cases *** Retrieve Context Source Registration With Default Core Context [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expectation_file_path} + ... ${context_source_registration_id} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 54a67562..7e0772f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -1,28 +1,37 @@ *** Settings *** -Documentation Check that you can retrieve a Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json - -*** Test Case *** +Documentation Check that you can retrieve a Context Source Registration + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path}= csourceRegistrations/expectations/context-source-registration.json + + +*** Test Cases *** Retrieve Context Source Registration [Documentation] Check that you can retrieve a Context Source Registration [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expectation_file_path} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expectation_file_path} + ... ${context_source_registration_id} + *** Keywords *** Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 26d24cfc..867c92fc 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -1,38 +1,46 @@ *** Settings *** -Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration -Test Template Check JSON-LD resolution when retrieving a context source registration - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json -${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json - -*** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext - ${EMPTY} ${expectation_file_path_expanded} - [Tags] csr-retrieve 6_3_5 +Documentation Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration +Suite Teardown Delete Created Context Source Registration +Test Template Check JSON-LD resolution when retrieving a context source registration + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${expectation_file_path_compacted}= csourceRegistrations/expectations/context-source-registration.json +${expectation_file_path_expanded}= csourceRegistrations/expectations/context-source-registration-expanded-format.json + +*** Test Cases *** CONTEXT EXPECTED_PAYLOAD +EmptyJsonLdContext + [Tags] csr-retrieve 6_3_5 + ${EMPTY} ${expectation_file_path_expanded} CreationTimeJsonLdContext - ${ngsild_test_suite_context} ${expectation_file_path_compacted} - [Tags] csr-retrieve 6_3_5 + [Tags] csr-retrieve 6_3_5 + ${ngsild_test_suite_context} ${expectation_file_path_compacted} + *** Keywords *** Check JSON-LD resolution when retrieving a context source registration - [Arguments] ${context} ${expected_payload} [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present + [Arguments] ${context} ${expected_payload} Retrieve Context Source Registration ${context_source_registration_id} context=${context} Check Response Status Code Set To 200 - Check Response Body Containing Context Source Registration element ${expected_payload} ${context_source_registration_id} + Check Response Body Containing Context Source Registration element + ... ${expected_payload} + ... ${context_source_registration_id} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 03f9b0da..c0db5c40 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -1,35 +1,45 @@ *** Settings *** -Documentation Check that you can update a context source registration by id -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Context Source +Documentation Check that you can update a context source registration by id -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Update Context Source + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: -*** Test Case *** FILENAME UPDATE_FILENAME -034_01_01_Update a context source registration by id - context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld +*** Test Cases *** FILENAME UPDATE_FILENAME +034_01_01_Update a context source registration by id + context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02_Update a context source registration to never expire - context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld + context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld + *** Keywords *** Update Context Source - [Arguments] ${filename} ${update_filename} [Documentation] Check that you can update a context source registration by id [Tags] csr-update + [Arguments] ${filename} ${update_filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${registration_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response['status']} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename} - ${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} + ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${registration_update_fragment} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration + ... ${registration_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${registration_payload} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index d0979d82..bd157e83 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you cannot update a context source registration under some conditions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities - -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld -${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld - -*** Test Case *** +Documentation Check that you cannot update a context source registration under some conditions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities + + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld +${registration_payload_file_path}= context-source-registration-invalid-sample.jsonld + + +*** Test Cases *** 034_02_01_Update a context source registration by id if the Id is not present Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld @@ -18,7 +22,9 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld 034_02_03_Update a context source registration if the request body is not of the same data type - Update Context Source ${valid_registration_id} fragments/context-source-registration-different-type-sample.jsonld + Update Context Source + ... ${valid_registration_id} + ... fragments/context-source-registration-different-type-sample.jsonld 034_02_04_Update a context source registration if you attempt to remove a mandatory property Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld @@ -26,18 +32,22 @@ ${registration_payload_file_path}= context-source-registration-invalid-sample 034_02_05_Update a context source registration if the request body is invalid Update a context source registration if the request body is invalid + *** Keywords *** Update Context Source - [Arguments] ${registration_id} ${fragment_filename} [Documentation] Check that you cannot update a context source registration under some conditions [Tags] csr-update - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${valid_registration_id} + [Arguments] ${registration_id} ${fragment_filename} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${valid_registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} + ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${fragment_with_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${valid_registration_id} @@ -46,11 +56,14 @@ Update a context source registration if the request body is invalid [Documentation] Check that you cannot update a context source registration if the request body is invalid [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${response}= Update Context Source Registration Using Session ${registration_id} ${registration_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Update Context Source Registration Using Session + ... ${registration_id} + ... ${registration_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${response} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 7226e5bb..f9f7a674 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -1,21 +1,27 @@ *** Settings *** -Documentation Check that you cannot update a context source registration by id if the id is not known to the system -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration by id if the id is not known to the system -*** Variable *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${filename}= context-source-registration-simple-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= context-source-registration-simple-sample.jsonld + + +*** Test Cases *** Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} - ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} - ${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON} + ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} + ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} + ${response}= Update Context Source Registration With Return + ... ${registration_id} + ... ${fragment_with_id} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index d742a5f0..3fb74d28 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a minimal context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a minimal context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription [Documentation] Check that you can create a minimal context source registration subscription [Tags] csrsub-create 5_11_2 @@ -18,10 +22,14 @@ Create Context Source Registration Subscription Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions # TODO: Refactor Generate Random Entity Id to Generate Random Test Sample Id diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 71bf9923..210f79f9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -1,15 +1,19 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/HttpUtils.resource -Suite Teardown Delete Created Context Source Registration Subscriptions +Documentation Check that you can create a context source registration subscription without providing an id and it will be automatically generated -*** Variable *** -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/HttpUtils.resource -*** Test Case *** +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without An Id [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated [Tags] csrsub-create 5_11_2 @@ -19,10 +23,14 @@ Create Context Source Registration Subscription Without An Id Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} Set Suite Variable ${subscription_id} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + *** Keywords *** Delete Created Context Source Registration Subscriptions Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index 0b2665b7..b6eab9b2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription without providing isActive member and will be active by default + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without isActive Member [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default [Tags] csrsub-create 5_11_2 @@ -21,6 +25,7 @@ Create Context Source Registration Subscription Without isActive Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index a01812e0..dbcfbc4c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-inactive-sample.jsonld + + +*** Test Cases *** Create Inactive Context Source Registration Subscription [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" [Tags] csrsub-create 5_11_2 @@ -21,6 +25,7 @@ Create Inactive Context Source Registration Subscription Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 4285348a..1c62b9ba 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -1,23 +1,27 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to "expired" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expiresAt-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription With expiresAt Member - [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to expired + [Documentation] Check that you can create a context source registration subscription with an expiresAt member and when it is due the status of the subscription changes to "expired" [Tags] csrsub-create 5_11_2 ${subscription_payload_sample}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} - ${subscription_payload}= Update Value To Json ${subscription_payload_sample} $..expiresAt ${expiresAt} + ${subscription_payload}= Update Value To JSON ${subscription_payload_sample} $..expiresAt ${expiresAt} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} @@ -25,6 +29,7 @@ Create Context Source Registration Subscription With expiresAt Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status expired + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index c261b10f..9b4e70a6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -1,16 +1,20 @@ *** Settings *** -Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Generate Random Ids For Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Generate Random Ids For Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Context Source Registration Subscription Without expiresAt Member [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual [Tags] csrsub-create 5_11_2 @@ -23,6 +27,7 @@ Create Context Source Registration Subscription Without expiresAt Member Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active + *** Keywords *** Generate Random Ids For Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 54ee1c56..544a9785 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -1,25 +1,32 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Create Existing Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 409 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index 3a02989b..d9d8adee 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -1,36 +1,40 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Create Invalid Context Source Registration Subscription +Documentation Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Cases *** FILEPATH -WithoutNotification - csourceSubscriptions/subscription-without-notification-sample.jsonld - [Tags] csrsub-create 5_11_2 +Test Template Create Invalid Context Source Registration Subscription -InvalidType csourceSubscriptions/subscription-invalid-type-sample.jsonld - [Tags] csrsub-create 5_11_2 -InvalidQuery csourceSubscriptions/subscription-invalid-query-sample.jsonld - [Tags] csrsub-create 5_11_2 +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= ${EMPTY} + +*** Test Cases *** FILEPATH +WithoutNotification + [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-without-notification-sample.jsonld +InvalidType [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-invalid-type-sample.jsonld +InvalidQuery [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-invalid-query-sample.jsonld EmptyWatchedAttributes - csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld - [Tags] csrsub-create 5_11_2 + [Tags] csrsub-create 5_11_2 + csourceSubscriptions/subscription-empty-watchedAttributes-sample.jsonld + *** Keywords *** Create Invalid Context Source Registration Subscription - [Arguments] ${filepath} [Documentation] Check that you cannot create a context source registration subscription If the data types, cardinalities and restrictions expressed by clause 5.2.12 are not met + [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 0984a56d..918cfcbd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -1,14 +1,17 @@ *** Settings *** -Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-expired-sample.jsonld + + +*** Test Cases *** Create Expired Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription with an expiration timestamp representing a moment before the current date and time [Tags] csrsub-create 5_11_2 @@ -16,5 +19,7 @@ Create Expired Context Source Registration Subscription ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 1530113e..e28f93e1 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -1,15 +1,19 @@ *** Settings *** -Documentation Check that you can delete a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions +Documentation Check that you can delete a context source registration subscription -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** +Suite Setup Setup Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Delete Context Source Registration Subscription [Documentation] Check that you can delete a context source registration subscription [Tags] csrsub-delete 5_11_6 @@ -18,6 +22,7 @@ Delete Context Source Registration Subscription Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index be7c7c39..e5b30eae 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot delete a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete a context source registration subscription with an invalid URI -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Delete Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index 20f9e3f0..ff640433 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot delete an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot delete an unknown context source registration subscription -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Delete Unknown Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete an unknown context source registration subscription [Tags] csrsub-delete 5_11_6 Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index a5074ed1..fc647951 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -1,35 +1,44 @@ *** Settings *** -Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld - -*** Test Case *** +Documentation Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-timeInterval-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification Periodically And Initially On Subscription [Documentation] Check that if the created context source registration subscription defines a timeInterval member, a cSourceNotification will be sent periodically, initially on subscription and when the time interval is reached [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Wait for notification # Wait for 15 seconds to check if another notification was sent Wait for notification timeout=${15} + *** Keywords *** Setup Initial Context Source Registrations Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index 8501a50c..e806af3e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -1,38 +1,53 @@ *** Settings *** -Documentation Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json - -*** Test Case *** +Documentation Check that if the created context source registration subscription does not define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + + +*** Test Cases *** Receive cSourceNotification Initially On Subscription And Whenever There Is A Change Of A Matching Context Source Registration - [Documentation] Check that if the created context source registration subscription doesn't define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration + [Documentation] Check that if the created context source registration subscription does not define a timeInterval member, a cSourceNotification, with the appropriate trigger reason in the "triggerReason" member, will be sent initially on subscription and whenever there is a change of a matching Context Source Registration [Tags] csrsub-notification 5_11_7 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Set Suite Variable ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... updated + *** Keywords *** Setup Initial Context Source Registrations Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 920193e0..03b3d264 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -1,35 +1,48 @@ *** Settings *** -Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-building-and-bus-entities-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification With Relevant Information [Documentation] Check that instead of providing the original context source registration, implementations should return context source registration information relevant for the subscription, in particular only matching RegistrationInfo elements [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} @{expected_notification_data_entities}= Create List Building - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching ${expected_notification_data_entities} + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + ... ${expected_notification_data_entities} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index 3c2a98e0..0256572c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation The structure of the csource notification message shall be as mandated by clause 5.3.2 + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification With Compliant Structure [Documentation] The structure of the csource notification message shall be as mandated by clause 5.3.2 [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index da8d40eb..f2647ddd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json - -*** Test Case *** +Documentation Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-ok.json + + +*** Test Cases *** If A cSourceNotification Is Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is sent successfully to the "endpoint" member, the "notification.timesSent" member shall be incremented by one and the "notification.lastSuccess" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "ok" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for notification @@ -27,11 +33,14 @@ If A cSourceNotification Is Successfully Sent The Notification Member Shall Be U @{expected_notification_additional_members}= Create List lastNotification lastSuccess Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index e5b04b3a..839a6d0b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -1,25 +1,31 @@ *** Settings *** -Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld -${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json - -*** Test Case *** +Documentation Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-unreachable-endpoint-sample.jsonld +${notification_expectation_file_path}= notifications/expectations/1-timesSent-failed.json + + +*** Test Cases *** If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Be Updated [Documentation] Check that if a cSourceNotification is not sent successfully, the "notification.timesSent" member shall be incremented by one and the notification.lastFailure" and "notification.lastNotification" members shall be updated with the current timestamp and the status of the context source registration subscription shall be updated to "failed" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for no notification @@ -27,6 +33,7 @@ If A cSourceNotification Is Not Successfully Sent The Notification Member Shall @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index 84499db9..dbf64473 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -1,45 +1,52 @@ *** Settings *** -Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Documentation Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Template Do Not Receive cSourceNotification If Subscription Status Is Not Active + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + *** Test Cases *** FILEPATH PausedSubscription - csourceSubscriptions/fragments/subscription-isActive-update-sample.json - [Tags] csrsub-notification 5_11_7 - + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-isActive-update-sample.json ExpiredSubscription - csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json - [Tags] csrsub-notification 5_11_7 + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-expiresAt-update-sample.json + *** Keywords *** Do Not Receive cSourceNotification If Subscription Status Is Not Active + [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired [Arguments] ${filepath} - [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active not paused nor expired ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} Wait for no notification -*** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index a895d1e2..0621ea7e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json - -*** Test Case *** +Documentation Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-sample.json + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations Providing Latest Information [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} updated + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... updated + *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration ${context_source_registration_payload} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index c0c2df16..8cbac3c7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -1,35 +1,47 @@ *** Settings *** -Documentation Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json - -*** Test Case *** +Documentation Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${update_fragment_file_path}= csourceRegistrations/fragments/context-source-registration-update-information-sample.json + + +*** Test Cases *** Receive cSourceNotification For No Longer Matching Context Source Registrations Providing Latest Information - [Documentation] Check if a context source registration subscription defines an entities member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities + [Documentation] Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} noLongerMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... noLongerMatching + *** Keywords *** Setup Initial Context Source Registrations And Subscriptions Start Local Server ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration ${context_source_registration_payload} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 02c52d3b..0e040ee8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-observationInterval-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-temporalQ-observedAt-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Observation Interval [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty observedAt, the temporal query is matched against the observationInterval of matching context source registrations [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index e529cd25..92b1867b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -1,39 +1,48 @@ *** Settings *** -Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval -Suite Setup Start Local Server -Suite Teardown Delete Created Context Source Registrations - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld +Documentation Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Start Local Server +Suite Teardown Delete Created Context Source Registrations +Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-managementInterval-sample.jsonld + *** Test Cases *** FILEPATH -CreatedAt csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 +CreatedAt [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/subscription-temporalQ-createdAt-sample.jsonld +ModifiedAt [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld -ModifiedAt csourceSubscriptions/subscription-temporalQ-modifiedAt-sample.jsonld - [Tags] csrsub-notification 5_11_7 *** Keywords *** Receive cSourceNotification For Matching Context Source Registrations On Management Interval - [Arguments] ${filepath} [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations + [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching # Moved here since each test case creates a subscription [Teardown] Delete Context Source Registration Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index c2fded9c..fd6c74f1 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" and "attributes" + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Watched Attributes - [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described entities and attributes + [Documentation] Check if a context source registrations subscription defines entities member and watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" and "attributes" [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index e7d7e2a2..16272e2b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Any watchedAttribute [Documentation] Check if a context source registrations subscription does not define watchedAttributes member, a CsourceNotification will be triggered from context source registrations with information member matching all attributes of the described entities [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index 7e4aeedf..dd53acce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Location [Documentation] Check if a context source registrations subscription defines a geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index a25bbe76..a20cef11 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -1,34 +1,46 @@ *** Settings *** -Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld - -*** Test Case *** +Documentation Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-without-geoproperty-sample.jsonld + + +*** Test Cases *** Receive cSourceNotification For Matching Context Source Registrations On Location As Default [Documentation] Check if a context source registrations subscription does not define a geoproperty in the geoQ member, a CsourceNotification will be triggered from matching context source registrations with a matching location member [Tags] csrsub-notification 5_11_7 ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_payload_file_path} ${context_source_registration_id} + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_payload_file_path} + ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Wait for notification and validate it ${subscription_id} ${expected_context_source_registration_ids} newlyMatching + Wait for notification and validate it + ... ${subscription_id} + ... ${expected_context_source_registration_ids} + ... newlyMatching + *** Keywords *** Setup Initial Context Source Registration Subscriptions Start Local Server ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index 68aec84d..2677278d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -1,37 +1,40 @@ *** Settings *** -Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/NotificationUtils.resource -Test Template Receive cSourceNotification For Newly Matching Context Source Registrations -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions - -*** Variable *** -${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld +Documentation Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Initial Context Source Registrations And Subscriptions +Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Template Receive cSourceNotification For Newly Matching Context Source Registrations + + +*** Variables *** +${context_source_registration_id_prefix}= urn:ngsi-ld:ContextSourceRegistration: +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-vehicle-entities-sample.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-bus-entities-sample.jsonld -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS -MatchFirstContextSourceRegistration - csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 +*** Test Cases *** FILEPATH NOTIFICATION_CSR_IDS +MatchFirstContextSourceRegistration + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-vehicle-entities-sample.json ${first_context_source_registration_id} MatchSecondContextSourceRegistration - csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 - + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-bus-entities-sample.json ${second_context_source_registration_id} MatchBothContextSourceRegistrations - csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} - [Tags] csrsub-notification 5_11_7 + [Tags] csrsub-notification 5_11_7 + csourceSubscriptions/fragments/subscription-vehicle-and-bus-entities-sample.json ${first_context_source_registration_id} ${second_context_source_registration_id} + *** Keywords *** Receive cSourceNotification For Newly Matching Context Source Registrations - [Arguments] ${filepath} @{notification_csr_ids} [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations + [Arguments] ${filepath} @{notification_csr_ids} ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching @@ -41,9 +44,15 @@ Setup Initial Context Source Registrations And Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${second_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} - ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${subscription_payload_file_path} ${subscription_id} - ${first_context_source_registration_payload}= Load Test Sample ${first_context_source_registration_payload_file_path} ${first_context_source_registration_id} - ${second_context_source_registration_payload}= Load Test Sample ${second_context_source_registration_payload_file_path} ${second_context_source_registration_id} + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ${first_context_source_registration_payload}= Load Test Sample + ... ${first_context_source_registration_payload_file_path} + ... ${first_context_source_registration_id} + ${second_context_source_registration_payload}= Load Test Sample + ... ${second_context_source_registration_payload_file_path} + ... ${second_context_source_registration_id} Create Context Source Registration Subscription ${subscription_payload} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 714a83e9..2bc98649 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -1,32 +1,43 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json - -*** Test Case *** +Documentation Check that you can query context source registration subscriptions + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json + + +*** Test Cases *** Query Context Source Registration Subscriptions [Documentation] Check that you can query context source registration subscriptions [Tags] csrsub-query 5_11_5 Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} Check Response Status Code Set To 200 - Check Response Body Containing List Containing Subscription elements ${expectation_file_path} ${subscription_ids} + Check Response Body Containing List Containing Subscription elements + ... ${expectation_file_path} + ... ${subscription_ids} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample + ... ${second_subscription_payload_file_path} + ... ${second_subscription_id} Create Context Source Registration Subscription ${first_subscription_payload} Create Context Source Registration Subscription ${second_subscription_payload} Set Suite Variable ${first_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index b4a5dbfb..f2bf0a32 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -1,36 +1,39 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Limit Parameter -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json - -*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER -Query One Subscription - ${1} ${1} - [Tags] csrsub-query 5_11_5 +Documentation Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions +Test Template Query Context Source Registration Subscriptions With Limit Parameter + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-035-01-expectation.json -Query Two Subscription - ${2} ${2} - [Tags] csrsub-query 5_11_5 +*** Test Cases *** LIMIT EXPECTED_SUBSCRIPTION_NUMBER +Query One Subscription + [Tags] csrsub-query 5_11_5 + ${1} ${1} +Query Two Subscription + [Tags] csrsub-query 5_11_5 + ${2} ${2} Query All Subscriptions - ${15} ${3} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${15} ${3} + *** Keywords *** Query Context Source Registration Subscriptions With Limit Parameter - [Arguments] ${limit} ${expectation_subscription_number} [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved + [Arguments] ${limit} ${expectation_subscription_number} Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} @@ -39,9 +42,15 @@ Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample + ... ${second_subscription_payload_file_path} + ... ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample + ... ${third_subscription_payload_file_path} + ... ${third_subscription_id} Create Context Source Registration Subscription ${first_subscription_payload} Create Context Source Registration Subscription ${second_subscription_payload} Create Context Source Registration Subscription ${third_subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index e799c423..be5675b3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -1,36 +1,42 @@ *** Settings *** -Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld -${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld - -*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK -Query Second Subscription - ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" - [Tags] csrsub-query 5_11_5 +Documentation Check that you can query context source registration subscriptions with providing page and limit parameters for pagination + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Created Context Source Registration Subscriptions +Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${first_subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${second_subscription_payload_file_path}= csourceSubscriptions/subscription-watchedAttributes-sample.jsonld +${third_subscription_payload_file_path}= csourceSubscriptions/subscription-geoQ-sample.jsonld -Query Last Subscription - ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} - [Tags] csrsub-query 5_11_5 +*** Test Cases *** LIMIT PAGE EXPECTED_SUBSCRIPTION_NUMBER PREV_LINK NEXT_LINK +Query Second Subscription + [Tags] csrsub-query 5_11_5 + ${1} ${2} ${1} ;rel="prev";type="application/ld+json" ;rel="next";type="application/ld+json" +Query Last Subscription + [Tags] csrsub-query 5_11_5 + ${2} ${2} ${1} ;rel="prev";type="application/ld+json" ${EMPTY} Query All Subscriptions - ${15} ${1} ${3} ${EMPTY} ${EMPTY} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${15} ${1} ${3} ${EMPTY} ${EMPTY} + *** Keywords *** Query Context Source Registration Subscriptions With Limit And Page Parameters - [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} page=${page} + [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} + Query Context Source Registration Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + ... page=${page} Check Response Status Code Set To 200 Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} @@ -39,9 +45,15 @@ Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${second_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${third_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - ${first_subscription_payload}= Load Test Sample ${first_subscription_payload_file_path} ${first_subscription_id} - ${second_subscription_payload}= Load Test Sample ${second_subscription_payload_file_path} ${second_subscription_id} - ${third_subscription_payload}= Load Test Sample ${third_subscription_payload_file_path} ${third_subscription_id} + ${first_subscription_payload}= Load Test Sample + ... ${first_subscription_payload_file_path} + ... ${first_subscription_id} + ${second_subscription_payload}= Load Test Sample + ... ${second_subscription_payload_file_path} + ... ${second_subscription_id} + ${third_subscription_payload}= Load Test Sample + ... ${third_subscription_payload_file_path} + ... ${third_subscription_id} Create Context Source Registration Subscription ${first_subscription_payload} Create Context Source Registration Subscription ${second_subscription_payload} Create Context Source Registration Subscription ${third_subscription_payload} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index 8aaba995..f4a172f6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -1,26 +1,30 @@ *** Settings *** -Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters +Documentation Check that you cannot query context source registration subscriptions with invalid page and limit parameters -*** Test Cases *** LIMIT PAGE -Invalid Limit ${-5} ${2} - [Tags] csrsub-query 5_11_5 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -Invalid Page ${2} ${-3} - [Tags] csrsub-query 5_11_5 +Test Template Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters + +*** Test Cases *** LIMIT PAGE +Invalid Limit [Tags] csrsub-query 5_11_5 + ${-5} ${2} +Invalid Page [Tags] csrsub-query 5_11_5 + ${2} ${-3} Invalid Limit And Page - ${0} ${0} - [Tags] csrsub-query 5_11_5 + [Tags] csrsub-query 5_11_5 + ${0} ${0} + *** Keywords *** Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters - [Arguments] ${limit} ${page} [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters + [Arguments] ${limit} ${page} Query Context Source Registration Subscriptions limit=${limit} page=${page} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 0537a5bb..ba1d842b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can retrieve a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscription -Suite Teardown Delete Created Context Source Registration Subscription - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json - -*** Test Case *** +Documentation Check that you can retrieve a context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscription +Suite Teardown Delete Created Context Source Registration Subscription + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${expectation_file_path}= csourceSubscriptions/expectations/subscriptions-040-01-expectation.json + + +*** Test Cases *** Retrieve Context Source Registration Subscription [Documentation] Check that you can retrieve a context source registration subscription [Tags] csrsub-retrieve 5_11_4 @@ -19,6 +23,7 @@ Retrieve Context Source Registration Subscription Check Response Status Code Set To 200 Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + *** Keywords *** Setup Initial Context Source Registration Subscription ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index 758c6eb5..8e4a6855 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Context Source Registration Subscription With An Invalid Id [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription invalidUri Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index d55be566..fb7d52ce 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -1,14 +1,18 @@ *** Settings *** -Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised -*** Test Case *** +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + + +*** Test Cases *** Retrieve Unknown Context Source Registration Subscription [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised [Tags] csrsub-retrieve 5_11_4 Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 0af8a549..9035fcaa 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -1,17 +1,21 @@ *** Settings *** -Documentation Check that you can update a context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json - -*** Test Case *** +Documentation Check that you can update a context source registration subscription + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription [Documentation] Check that you can update a context source registration subscription [Tags] csrsub-update 5_11_3 @@ -19,9 +23,13 @@ Update Context Source Registration Subscription Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Check Response Status Code Set To 204 ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resource Set To ${subscription} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 2875f366..32ba76ba 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -1,18 +1,23 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid URI -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update a context source registration subscription with an invalid URI -*** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot update a context source registration subscription with an invalid URI [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index f8c67b83..024b5593 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -1,18 +1,25 @@ *** Settings *** -Documentation Check that you cannot update an unknown context source registration subscription -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource +Documentation Check that you cannot update an unknown context source registration subscription -*** Variable *** -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource -*** Test Case *** + +*** Variables *** +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-sample.json + + +*** Test Cases *** Update Unknown Context Source Registration Subscription [Documentation] Check that you cannot update an unknown context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription ${subscription_update_fragment} + Update Context Source Registration Subscription + ... urn:ngsi-ld:Subscription:unknowSubscription + ... ${subscription_update_fragment} Check Response Status Code Set To 404 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 25e3cffc..cc767440 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -1,32 +1,38 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Test Template Update Context Source Registration Subscription With Invalid Fragment -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +Documentation Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 -*** Test Cases *** FILEPATH -InvalidType csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json - [Tags] csrsub-update 5_11_3 +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Template Update Context Source Registration Subscription With Invalid Fragment + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld + +*** Test Cases *** FILEPATH +InvalidType [Tags] csrsub-update 5_11_3 + csourceSubscriptions/fragments/subscription-update-invalid-type-sample.json InvalidNotification - csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json - [Tags] csrsub-update 5_11_3 + [Tags] csrsub-update 5_11_3 + csourceSubscriptions/fragments/subscription-update-invalid-notification-sample.json + *** Keywords *** Update Context Source Registration Subscription With Invalid Fragment + [Documentation] Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 [Arguments] ${filepath} - [Documentation] Check that you cannot update a context source registration subscription with a fragment that doesn't meet the data types and restrictions expressed by clause 5.2.12 ${subscription_update_fragment}= Load Test Sample ${filepath} Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} Check Response Status Code Set To 400 - Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index 19696f85..7d184f53 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -1,25 +1,34 @@ *** Settings *** -Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) -Resource ${EXECDIR}/resources/ApiUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions - -*** Variable *** -${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld -${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json - -*** Test Case *** +Documentation Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) + +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Context Source Registration Subscriptions +Suite Teardown Delete Initial Context Source Registration Subscriptions + + +*** Variables *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= csourceSubscriptions/subscription-sample.jsonld +${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/subscription-update-invalid-json-sample.json + + +*** Test Cases *** Update Context Source Registration Subscription With Invalid JSON Fragment [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) [Tags] csrsub-update 5_11_3 - Update Context Source Registration Subscription From File ${subscription_id} ${subscription_update_fragment_file_path} + Update Context Source Registration Subscription From File + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_INVALID_REQUEST} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response} + ... ${ERROR_TYPE_INVALID_REQUEST} Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..4e4f899e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[tool.robotidy] +diff = true +configure = [ + "SplitTooLongLine: split_on_every_arg = True" +] + diff --git a/requirements.txt b/requirements.txt index 516a6e77..b20e1673 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +# python3.10 project robotframework==6.0.2 RESTinstance==1.3.0 robotframework-jsonschemalibrary==1.0 @@ -6,4 +7,4 @@ robotframework-requests==0.9.4 deepdiff==6.3.0 robotframework-httpctrl==0.3.1 robotframework-metrics==3.3.1 - +robotframework-tidy==4.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fe594ea9..ef33eadb 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -1,906 +1,1467 @@ *** Settings *** -Variables ./variables.py +Variables ./variables.py +Library REST ${url} +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library JSONLibrary -Library REST ${url} -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library JSONLibrary *** Variables *** -${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create -${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert -${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update -${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete -&{BATCH_OPERATION_ENDPOINT_MAPPING} create=${BATCH_CREATE_ENDPOINT_PATH} upsert=${BATCH_UPSERT_ENDPOINT_PATH} update=${BATCH_UPDATE_ENDPOINT_PATH} delete=${BATCH_DELETE_ENDPOINT_PATH} -${ENTITIES_ENDPOINT_PATH} entities/ -${ENTITIES_TYPES_ENDPOINT_PATH} types -${ATTRIBUTES_ENDPOINT_PATH} attributes -${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query -${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities -${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations -${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations -${SUBSCRIPTION_ENDPOINT_PATH} subscriptions/ +${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create +${BATCH_UPSERT_ENDPOINT_PATH} entityOperations/upsert +${BATCH_UPDATE_ENDPOINT_PATH} entityOperations/update +${BATCH_DELETE_ENDPOINT_PATH} entityOperations/delete +&{BATCH_OPERATION_ENDPOINT_MAPPING} +... create=${BATCH_CREATE_ENDPOINT_PATH} +... upsert=${BATCH_UPSERT_ENDPOINT_PATH} +... update=${BATCH_UPDATE_ENDPOINT_PATH} +... delete=${BATCH_DELETE_ENDPOINT_PATH} +${ENTITIES_ENDPOINT_PATH} entities/ +${ENTITIES_TYPES_ENDPOINT_PATH} types +${ATTRIBUTES_ENDPOINT_PATH} attributes +${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} entityOperations/query +${TEMPORAL_ENTITIES_ENDPOINT_PATH} temporal/entities +${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH} temporal/entityOperations +${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} csourceRegistrations +${SUBSCRIPTION_ENDPOINT_PATH} subscriptions/ ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} csourceSubscriptions -${CONTENT_TYPE_JSON} application/json -${CONTENT_TYPE_LD_JSON} application/ld+json -${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json +${CONTENT_TYPE_JSON} application/json +${CONTENT_TYPE_LD_JSON} application/ld+json +${CONTENT_TYPE_MERGE_PATCH_JSON} application/merge-patch+json -${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData -${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest -${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound -${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists -${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable +${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound +${ERROR_TYPE_ALREADY_EXISTS} https://uri.etsi.org/ngsi-ld/errors/AlreadyExists +${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable + +${response} ${EMPTY} -${response} *** Keywords *** Delete Entity by Id Returning Response - [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response - [return] ${response} + [Arguments] ${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} + Output request + Output response + RETURN ${response} Delete Entity by Id - [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + [Arguments] ${id} + ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} + Output request + Output response Query Entity - [Arguments] ${id} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${accept_length} = Get Length ${accept} - ${options_length} = Get Length ${options} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} - ${request}= Output request - Output response - Set Test Variable ${response} - [return] ${request} ${response} + [Arguments] + ... ${id} + ... ${accept}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${context}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${options}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${accept_length}= Get Length ${accept} + ${options_length}= Get Length ${options} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF ${accept_length}>0 + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} + ${request}= Output request + Output response + Set Test Variable ${response} + RETURN ${request} ${response} Query Entities - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${georel}=${EMPTY} ${coordinates}=${EMPTY} ${geometry}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${accept_length} = Get Length ${accept} - ${options_length} = Get Length ${options} - ${entity_ids_length} = Get Length ${entity_ids} - ${entity_types_length} = Get Length ${entity_types} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If ${accept_length}>0 Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + [Arguments] + ... ${entity_ids}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${accept}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${context}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${options}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geometry}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${accept_length}= Get Length ${accept} + ${options_length}= Get Length ${options} + ${entity_ids_length}= Get Length ${entity_ids} + ${entity_types_length}= Get Length ${entity_types} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF ${accept_length}>0 + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Query Entities Via POST - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} ${attrs}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${geoproperty}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - ${entity_ids_length} = Get Length ${entity_ids} - ${entity_types_length} = Get Length ${entity_types} - ${attrs_length} = Get Length ${attrs} - Set To Dictionary ${headers} Content-Type ${content_type} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} + [Arguments] + ... ${entity_ids}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${attrs}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${geoproperty}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${entity_ids_length}= Get Length ${entity_ids} + ${entity_types_length}= Get Length ${entity_types} + ${attrs_length}= Get Length ${attrs} + Set To Dictionary ${headers} Content-Type ${content_type} + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END ${response}= REST.POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} - Output request - Output response - [return] ${response} + Output request + Output response + RETURN ${response} Retrieve Entity by Id - [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} - Output request - Output response + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} + Output request + Output response Set Test Variable ${response} Create Entity Selecting Content Type - [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='${EMPTY}' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - ${request}= Output request - Output response - [return] ${request} ${response} + [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='${EMPTY}' + Set To Dictionary ${headers} Accept=${accept} + END + IF '${context}'!='${EMPTY}' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + ${request}= Output request + Output response + RETURN ${request} ${response} Append Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= REST.POST + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Entity Attributes With Parameters - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= REST.POST + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} + [Arguments] ${id} ${filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ params=options=${options} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... params=options=${options} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Update Entity Attributes Using Session - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} + [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session OneRequest ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} Update Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= REST.PATCH + ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Entity Attributes - [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON} - Run Keyword If '${context}'!='${EMPTY}' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - @{params}= Create List - Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} - Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} - ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON} + IF '${context}'!='${EMPTY}' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + @{params}= Create List + IF '${datasetId}'!='' + Append To List ${params} datasetId=${datasetId} + END + IF '${deleteAll}'!='' + Append To List ${params} deleteAll=${deleteAll} + END + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= REST.DELETE + ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} + ... headers=${headers} + Output request + Output response + RETURN ${response} Partial Update Entity Attributes - [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${entityId} + ... ${attributeId} + ... ${fragment_filename} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= REST.PATCH + ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Types - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} - Output request - Output response + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${details} Set To Dictionary ${params} details=${details} + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Entity Type - [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Attributes - [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${details} Set To Dictionary ${params} details=${details} + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Attribute - [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} + [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Create Context Source Registration With Return - [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${context} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} - ${request}= Output request - Output response - [return] ${request} ${response} + [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept=${context} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} + ${request}= Output request + Output response + RETURN ${request} ${response} Create Context Source Registration Using Session - [Arguments] ${filename} ${content_type} + [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + RETURN ${response} Update Context Source Registration With Return - [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} body=${fragment} headers=${headers} - ${request}= Output request - Output response - [return] ${response} + [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... body=${fragment} + ... headers=${headers} + ${request}= Output request + Output response + RETURN ${response} Update Context Source Registration Using Session - [Arguments] ${registration_id} ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session OneRequest ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} data=${file_content} headers=${headers} expected_status=any - Output request - Output response - [return] ${response} + [Arguments] ${registration_id} ${filename} ${content_type} + ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= PATCH On Session + ... OneRequest + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output request + Output response + RETURN ${response} Delete Context Source Registration With Return - [Arguments] ${registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - Output request - Output response - [return] ${response} + [Arguments] ${registration_id} + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + Output request + Output response + RETURN ${response} Create Entity - [Arguments] ${filename} ${entity_id} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - Output request - Output response + [Arguments] ${filename} ${entity_id} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} + Output request + Output response Create Or Update Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ body=${temporal_entity_representation} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} + ${temporal_entity_representation_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To JSON + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ + ... body=${temporal_entity_representation} + ... headers=${headers} + Output request + Output response + RETURN ${response} Create Temporal Representation Of Entity Selecting Content Type Using Session - [Arguments] ${filename} ${content_type} + [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} + RETURN ${response} Append Attribute To Temporal Entity - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Append Attribute To Temporal Entity Using Session - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} + [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session OneRequest ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs data=${file_content} headers=${headers} expected_status=any - Output ${response.json()} - Set Test Variable ${response} - [return] ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= POST On Session + ... OneRequest + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response.json()} + Set Test Variable ${response} + RETURN ${response} Modify Attribute Instance From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${fragment_filename} ${content_type} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${fragment_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} body=${fragment_payload} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${temporal_entity_id} + ... ${attributeId} + ... ${instanceId} + ... ${fragment_filename} + ... ${content_type} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + ${response}= REST.PATCH + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... body=${fragment_payload} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Attribute From Temporal Entity - [Arguments] ${entityId} ${attributeId} ${content_type} ${datasetId} ${deleteAll} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - @{params}= Create List - Run Keyword If '${datasetId}'!='' Append To List ${params} datasetId=${datasetId} - Run Keyword If '${deleteAll}'!='' Append To List ${params} deleteAll=${deleteAll} - ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${entityId} + ... ${attributeId} + ... ${content_type} + ... ${datasetId} + ... ${deleteAll} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + @{params}= Create List + IF '${datasetId}'!='' + Append To List ${params} datasetId=${datasetId} + END + IF '${deleteAll}'!='' + Append To List ${params} deleteAll=${deleteAll} + END + ${params_as_string}= Catenate SEPARATOR=& @{params} + ${response}= REST.DELETE + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} + ... headers=${headers} + Output request + Output response + RETURN ${response} Delete Temporal Representation Of Entity With Returning Response - [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_representation_id} + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response + RETURN ${response} Delete Several Temporal Representations Of Entities - [Arguments] @{temporal_entity_representation_ids} + [Arguments] @{temporal_entity_representation_ids} FOR ${temporal_entity_representation_id} IN @{temporal_entity_representation_ids} - Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} + Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} END Get Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${accept}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary - &{params}= Create Dictionary - ${options_length} = Get Length ${options} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} - Output request - Output response - [return] ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${accept}=${EMPTY} + ... ${options}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary + &{params}= Create Dictionary + ${options_length}= Get Length ${options} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + ${response}= REST.GET + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... headers=${headers} + ... query=${params} + Output request + Output response + RETURN ${response} Delete Attribute Instance From Temporal Entity - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${content_type} ${context}=${EMPTY} + &{headers}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.DELETE + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... headers=${headers} + Output request + Output response + RETURN ${response} Update Temporal Representation Of Entity Selecting Content Type - [Arguments] ${temporal_entity_representation_id} ${attrId} ${instanceId} ${fragment_filename} ${content_type} - ${temporal_entity_fragment}= Load Json From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.PATCH ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} body=${temporal_entity_fragment} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${attrId} + ... ${instanceId} + ... ${fragment_filename} + ... ${content_type} + ${temporal_entity_fragment}= Load JSON From File + ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.PATCH + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} + ... body=${temporal_entity_fragment} + ... headers=${headers} + Output request + Output response + RETURN ${response} Batch Create Entities - [Arguments] @{entities_to_be_created} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Content-Type ${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... @{entities_to_be_created} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${context}=${EMPTY} + ... ${accept}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Upsert Entities - [Arguments] @{entities_to_be_upserted} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_upserted} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... body=@{entities_to_be_upserted} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Update Entities - [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... body=@{entities_to_be_updated} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Delete Entities - [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} - Output request - Output response - Run Keyword If not ${teardown} Set Test Variable ${response} + [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${BATCH_DELETE_ENDPOINT_PATH} + ... body=@{entities_ids_to_be_deleted} + ... headers=${headers} + Output request + Output response + IF not ${teardown} Set Test Variable ${response} Request Entity From File - [Arguments] ${filename} + [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session OneRequest ${ENTITIES_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session OneRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... OneRequest + ... ${ENTITIES_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Batch Request Entities From File - [Arguments] ${batchOperation} ${filename} + [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} - Create Session BatchRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session BatchRequest ${endpoint_url} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} + Create Session BatchRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... BatchRequest + ... ${endpoint_url} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Create Temporal Representation Of Entity - [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${TEMPORAL_ENTITIES_ENDPOINT_PATH} body=${temporal_entity_representation} headers=${headers} - Output request - Output response + [Arguments] ${filename} ${temporal_entity_representation_id} + ${temporal_entity_representation_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${filename} + ${temporal_entity_representation}= Update Value To JSON + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... body=${temporal_entity_representation} + ... headers=${headers} + Output request + Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${attrs_length} = Get Length ${attrs} - ${options_length} = Get Length ${options} - &{headers}= Create Dictionary - &{params}= Create Dictionary - - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${endTimeAt}'!='' Set To Dictionary ${params} endTimeAt=${endTimeAt} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... ${temporal_entity_representation_id} + ... ${attrs}=${EMPTY} + ... ${options}=${EMPTY} + ... ${context}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${endTimeAt}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${attrs_length}= Get Length ${attrs} + ${options_length}= Get Length ${options} + &{headers}= Create Dictionary + &{params}= Create Dictionary + + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF ${options_length}>0 + Set To Dictionary ${params} options=${options} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${endTimeAt}'!='' + Set To Dictionary ${params} endTimeAt=${endTimeAt} + END + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + + ${response}= REST.GET + ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... headers=${headers} + ... query=${params} + Output request + Output response + Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${entity_types_length} = Get Length ${entity_types} - ${entity_ids_length} = Get Length ${entity_ids} - ${attrs_length} = Get Length ${attrs} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${entity_ids}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${ngsild_query}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${entity_types_length}= Get Length ${entity_types} + ${entity_ids_length}= Get Length ${entity_ids} + ${attrs_length}= Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${ngsild_query}'!='' + Set To Dictionary ${params} q=${ngsild_query} + END + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} Query Temporal Representation Of Entities Via Post - [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} - ${headers}= Create Dictionary - Set To Dictionary ${headers} Content-Type ${content_type} - Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${query_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/${query_file_name} - ${response}= REST.POST ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query body=${query_payload} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} + ${headers}= Create Dictionary + Set To Dictionary ${headers} Content-Type ${content_type} + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + ${query_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${query_file_name} + ${response}= REST.POST + ... ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query + ... body=${query_payload} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Delete Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} + [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response Create Context Source Registration - [Arguments] ${context_source_registration_payload} + [Arguments] ${context_source_registration_payload} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${context_source_registration_payload} headers=${headers} - ${request}= Output request - Output response + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... body=${context_source_registration_payload} + ... headers=${headers} + ${request}= Output request + Output response - Set Suite Variable ${request} - Set Suite Variable ${response} + Set Suite Variable ${request} + Set Suite Variable ${response} Update Context Source Registration - [Arguments] ${context_source_registration_id} ${update_fragment} + [Arguments] ${context_source_registration_id} ${update_fragment} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} body=${update_fragment} - Output request - Output response + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... body=${update_fragment} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registrations - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} - Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} - Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - - Set Test Variable ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${id}=${EMPTY} + ... ${type}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${q}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timeproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${page}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${id}'!='' Set To Dictionary ${params} id=${id} + IF '${type}'!='' Set To Dictionary ${params} type=${type} + IF '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + IF '${q}'!='' Set To Dictionary ${params} q=${q} + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${timeproperty}'!='' + Set To Dictionary ${params} timeproperty=${timeproperty} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + + Set Test Variable ${response} Delete Context Source Registration - [Arguments] ${context_source_registration_id} + [Arguments] ${context_source_registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output request - Output response + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + Output request + Output response - Set Suite Variable ${response} + Set Suite Variable ${response} Retrieve Context Source Registration - [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} headers=${headers} - Output request - Output response + [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Create Context Source Registration Subscription - [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - ${request}= Output request - Output response + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... body=${subscription_payload} + ... headers=${headers} + ${request}= Output request + Output response - Set Suite Variable ${request} - Set Suite Variable ${response} + Set Suite Variable ${request} + Set Suite Variable ${response} Update Context Source Registration Subscription - [Arguments] ${subscription_id} ${subscription_update_fragment} + [Arguments] ${subscription_id} ${subscription_update_fragment} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} - Output request - Output response + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... body=${subscription_update_fragment} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Context Source Registration Subscription - [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} - - &{headers}= Create Dictionary - Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} headers=${headers} - Output request - Output response + [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} + + &{headers}= Create Dictionary + Set To Dictionary ${headers} Accept ${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... headers=${headers} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registration Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= REST.GET + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... headers=${headers} + ... query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Delete Context Source Registration Subscription - [Arguments] ${subscription_id} + [Arguments] ${subscription_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output request - Output response + ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + Output request + Output response - Set Suite Variable ${response} + Set Suite Variable ${response} Update Context Source Registration Subscription From File - [Arguments] ${subscription_id} ${file_path} + [Arguments] ${subscription_id} ${file_path} ${file_content}= Get File ${EXECDIR}/data/${file_path} - Create Session CsrsUpdateRequest ${url} - ${response}= PATCH On Session CsrsUpdateRequest ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} data=${file_content} expected_status=any - Set Test Variable ${response} + Create Session CsrsUpdateRequest ${url} + ${response}= PATCH On Session + ... CsrsUpdateRequest + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... data=${file_content} + ... expected_status=any + Set Test Variable ${response} Create Subscription - [Arguments] ${subscription_id} ${filename_path} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${filename_path} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] + ... ${subscription_id} + ... ${filename_path} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${filename_path} + ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} + Output request + Output response + RETURN ${response} Create Subscription From Subscription Payload - [Arguments] ${subscription_payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - Output request - Output response - + [Arguments] + ... ${subscription_payload} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} + Output request + Output response Create Subscription From File - [Arguments] ${filename} + [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} - Create Session SubscriptionCreateRequest ${url} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session SubscriptionCreateRequest ${SUBSCRIPTION_ENDPOINT_PATH} data=${file_content} headers=${headers} expected_status=any - Set Test Variable ${response} + Create Session SubscriptionCreateRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST On Session + ... SubscriptionCreateRequest + ... ${SUBSCRIPTION_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Set Test Variable ${response} Update Subscription - [Arguments] ${subscription_id} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${subscription_update_fragment}= Load Json From File ${EXECDIR}/data/${fragment_filename} - ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + [Arguments] + ... ${subscription_id} + ... ${fragment_filename} + ... ${content_type} + ... ${accept}=${EMPTY} + ... ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${subscription_update_fragment}= Load JSON From File ${EXECDIR}/data/${fragment_filename} + ${response}= REST.PATCH + ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... body=${subscription_update_fragment} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Update Subscription With Payload - [Arguments] ${subscription_id} ${payload} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - ${response}= REST.PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${payload} headers=${headers} - Output request - Output response - Set Test Variable ${response} - [return] ${response} + [Arguments] ${subscription_id} ${payload} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + ${response}= REST.PATCH + ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... body=${payload} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} + RETURN ${response} Delete Subscription - [Arguments] ${subscription_id} - ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - Output request - Output response - Set Suite Variable ${response} - [return] ${response} + [Arguments] ${subscription_id} + ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + Output request + Output response + Set Suite Variable ${response} + RETURN ${response} Query Subscriptions - [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${offset}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${offset}'!='' Set To Dictionary ${params} offset=${offset} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${offset}=${EMPTY} ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response - Set Test Variable ${response} + Set Test Variable ${response} Retrieve Subscription - [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} + [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} - ${request}= Output request - Output response - Set Test Variable ${response} - [return] ${request} ${response} + ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} + ${request}= Output request + Output response + Set Test Variable ${response} + RETURN ${request} ${response} Update Context Source Registration Subscription By Selecting Content Type - [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.PATCH ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} body=${subscription_update_fragment} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} + &{headers}= Create Dictionary Content-Type=${content_type} + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.PATCH + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... body=${subscription_update_fragment} + ... headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Types With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Entity Type With Return - [Arguments] ${type} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${type} ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Attributes With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} + Output request + Output response + RETURN ${response} Retrieve Attribute With Return - [Arguments] ${attribute_name} ${accept}=${EMPTY} - &{headers}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - [return] ${response} + [Arguments] ${attribute_name} ${accept}=${EMPTY} + &{headers}= Create Dictionary + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} + Output request + Output response + RETURN ${response} Create Context Source Registration Subscription With Return - [Arguments] ${subscription_payload} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - ${request}= Output request - Output ${response} - [return] ${request} ${response} + [Arguments] ${subscription_payload} ${content_type} + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... body=${subscription_payload} + ... headers=${headers} + ${request}= Output request + Output ${response} + RETURN ${request} ${response} Batch Upsert Entities By Selecting Content Type - [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... body=@{entities_to_be_upserted} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Update Entities By Selecting Content Type - [Arguments] @{entities_to_be_updated} ${content_type}=${CONTENT_TYPE_LD_JSON} ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} - Output request - Output response - Set Test Variable ${response} + [Arguments] + ... @{entities_to_be_updated} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... body=@{entities_to_be_updated} + ... headers=${headers} + Output request + Output response + Set Test Variable ${response} Batch Delete Entities By Selecting Content Type - [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST ${BATCH_DELETE_ENDPOINT_PATH} body=@{entities_ids_to_be_deleted} headers=${headers} - Output request - Output response - Run Keyword If not ${teardown} Set Test Variable ${response} - Set Test Variable ${response} + [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False + &{headers}= Create Dictionary Content-Type=${content_type} + ${response}= REST.POST + ... ${BATCH_DELETE_ENDPOINT_PATH} + ... body=@{entities_ids_to_be_deleted} + ... headers=${headers} + Output request + Output response + IF not ${teardown} Set Test Variable ${response} + Set Test Variable ${response} Query Context Source Registrations With Return - [Arguments] ${context}=${EMPTY} ${id}=${EMPTY} ${type}=${EMPTY} ${attrs}=${EMPTY} ${q}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timeproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} - - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} - Run Keyword If '${id}'!='' Set To Dictionary ${params} id=${id} - Run Keyword If '${type}'!='' Set To Dictionary ${params} type=${type} - Run Keyword If '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${q}'!='' Set To Dictionary ${params} q=${q} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${timeproperty}'!='' Set To Dictionary ${params} timeproperty=${timeproperty} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - Run Keyword If '${page}'!='' Set To Dictionary ${params} page=${page} - - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - - [return] ${request} ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${id}=${EMPTY} + ... ${type}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${q}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timeproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${page}=${EMPTY} + ... ${accept}=${EMPTY} + + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF '${accept}'!='' + Set To Dictionary ${headers} Accept ${accept} + END + IF '${id}'!='' Set To Dictionary ${params} id=${id} + IF '${type}'!='' Set To Dictionary ${params} type=${type} + IF '${attrs}'!='' Set To Dictionary ${params} attrs=${attrs} + IF '${q}'!='' Set To Dictionary ${params} q=${q} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${timeproperty}'!='' + Set To Dictionary ${params} timeproperty=${timeproperty} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + IF '${page}'!='' Set To Dictionary ${params} page=${page} + + ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + RETURN ${request} ${response} Query Temporal Representation Of Entities With Return - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${csf}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${limit}=${EMPTY} ${lastN}=${EMPTY} ${accept}=${EMPTY} - ${entity_types_length} = Get Length ${entity_types} - ${entity_ids_length} = Get Length ${entity_ids} - ${attrs_length} = Get Length ${attrs} - &{headers}= Create Dictionary - &{params}= Create Dictionary - Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" - Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} - Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} - Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} - Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} - Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} - Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} - Run Keyword If '${csf}'!='' Set To Dictionary ${params} csf=${csf} - Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} - Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} - Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} - Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} - Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} - - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - [return] ${request} ${response} + [Arguments] + ... ${context}=${EMPTY} + ... ${entity_types}=${EMPTY} + ... ${entity_ids}=${EMPTY} + ... ${entity_id_pattern}=${EMPTY} + ... ${ngsild_query}=${EMPTY} + ... ${csf}=${EMPTY} + ... ${georel}=${EMPTY} + ... ${geometry}=${EMPTY} + ... ${coordinates}=${EMPTY} + ... ${geoproperty}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${attrs}=${EMPTY} + ... ${limit}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${accept}=${EMPTY} + ${entity_types_length}= Get Length ${entity_types} + ${entity_ids_length}= Get Length ${entity_ids} + ${attrs_length}= Get Length ${attrs} + &{headers}= Create Dictionary + &{params}= Create Dictionary + IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} + IF '${context}'!='' + Set To Dictionary + ... ${headers} + ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + END + IF ${entity_types_length}>0 + Set To Dictionary ${params} type=${entity_types} + END + IF ${entity_ids_length}>0 + Set To Dictionary ${params} id=${entity_ids} + END + IF '${timerel}'!='' + Set To Dictionary ${params} timerel=${timerel} + END + IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + IF '${entity_id_pattern}'!='' + Set To Dictionary ${params} idPattern=${entity_id_pattern} + END + IF '${ngsild_query}'!='' + Set To Dictionary ${params} q=${ngsild_query} + END + IF '${csf}'!='' Set To Dictionary ${params} csf=${csf} + IF '${georel}'!='' Set To Dictionary ${params} georel=${georel} + IF '${geometry}'!='' + Set To Dictionary ${params} geometry=${geometry} + END + IF '${coordinates}'!='' + Set To Dictionary ${params} coordinates=${coordinates} + END + IF '${geoproperty}'!='' + Set To Dictionary ${params} geoproperty=${geoproperty} + END + IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} + + ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + ${request}= Output request + Output response + RETURN ${request} ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5f60fae0..13fe117f 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,351 +1,453 @@ *** Settings *** Library ${EXECDIR}/libraries/assertionUtils.py -Library RequestsLibrary -Library Collections -Library JSONLibrary -Library REST -Library String - -*** Variable *** -${id_regex_expr}= root\\['id'\\] -${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] -${notification_timestamps_regex_expr}= root\\['last.*'\\] -${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] -${context_regex_expr}= root\\['@context'\\] -${status_regex_expr}= root\\['status'\\] +Library RequestsLibrary +Library Collections +Library JSONLibrary +Library REST +Library String + + +*** Variables *** +${id_regex_expr}= root\\['id'\\] +${instance_id_regex_expr}= root\\[.*\\]\\['instanceId'\\] +${notification_timestamps_regex_expr}= root\\['last.*'\\] +${notification_endpoint_uri_regex_expr}= root\\['endpoint'\\]\\['uri'\\] +${context_regex_expr}= root\\['@context'\\] +${status_regex_expr}= root\\['status'\\] + *** Keywords *** Check Response Status Code - [Arguments] ${expected_status_code} ${response_status_code} - ${response_status_code}= convert to string ${response_status_code} - Should Be Equal ${expected_status_code} ${response_status_code} + [Arguments] ${expected_status_code} ${response_status_code} + ${response_status_code}= convert to string ${response_status_code} + Should Be Equal ${expected_status_code} ${response_status_code} Check Response Status Code Set To - [Arguments] ${expected_status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${expected_status} + [Arguments] ${expected_status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${expected_status} Check RL Response Status Code Set To - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} Check Response Body Containing Array Of URIs set to - [Arguments] @{expected_entities_ids} - Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True + [Arguments] @{expected_entities_ids} + Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True Check Response Body Content - [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} - Output ${response_body} - Output ${entity_payload} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_payload} ${response_body} ${all_ignored_paths} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} + Output ${response_body} + Output ${entity_payload} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_payload} + ... ${response_body} + ... ${all_ignored_paths} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Headers Containing Content-Type set to - [Arguments] ${response} ${expected_content_type_content} - Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + [Arguments] ${response} ${expected_content_type_content} + Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} Check Response Headers Link Not Empty - [Arguments] ${response} - Should Not Be Empty ${response['headers']['Link']} + [Arguments] ${response} + Should Not Be Empty ${response['headers']['Link']} # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers + Check Response Headers Containing URI set to - [Arguments] ${expected_path} ${expected_entity_id} ${response} + [Arguments] ${expected_path} ${expected_entity_id} ${response} - Run Keyword If 'Location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['Location']} ignore_order=True - Run Keyword If 'location' in ${response['headers']} Should Be Equal ${expected_path}${expected_entity_id} ${response['headers']['location']} ignore_order=True + IF 'Location' in ${response['headers']} + Should Be Equal + ... ${expected_path}${expected_entity_id} + ... ${response['headers']['Location']} + ... ignore_order=True + END + IF 'location' in ${response['headers']} + Should Be Equal + ... ${expected_path}${expected_entity_id} + ... ${response['headers']['location']} + ... ignore_order=True + END # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers ID Not Empty - [Arguments] ${response} + [Arguments] ${response} - ${location_header}= Set Variable If 'Location' in ${response['headers']} ${response['headers']['Location']} ${response['headers']['location']} - ${id}= Fetch From Right ${location_header} / - Should Not Be Empty ${id} - [return] ${id} + ${location_header}= Set Variable If + ... 'Location' in ${response['headers']} + ... ${response['headers']['Location']} + ... ${response['headers']['location']} + ${id}= Fetch From Right ${location_header} / + Should Not Be Empty ${id} + RETURN ${id} Check Response Body Containing an Attribute set to - [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} - Should Not Be Empty ${response['body']['${expected_attribute_name}']} - Run Keyword If '${expected_attribute_value}'!='' Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} + Should Not Be Empty ${response['body']['${expected_attribute_name}']} + IF '${expected_attribute_value}'!='' + Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + END Check Response Body Details Containing Information Error - [Arguments] ${expected_error_message} - Should be Equal ${expected_error_message} ${response['body']['details']} + [Arguments] ${expected_error_message} + Should be Equal ${expected_error_message} ${response['body']['details']} Check Response Body Containing Batch Operation Result - [Arguments] ${expected_batch_operation_result} - @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success - @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors - @{response_errors}= Get From Dictionary ${response['body']} errors + [Arguments] ${expected_batch_operation_result} + @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success + @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors + @{response_errors}= Get From Dictionary ${response['body']} errors - ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} - ${response_errors_length}= Get Length ${response_errors} + ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} + ${response_errors_length}= Get Length ${response_errors} - Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True - Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} + Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True + Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} FOR ${response_error} IN @{response_errors} - List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} - Should Not Be Empty ${response_error['error']} + List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} + Should Not Be Empty ${response_error['error']} END Check Response Body Containing Entity element - [Arguments] ${expectation_filename} ${entity_id} ${response_body} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${entity_id} ${response_body} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Entity Elements - [Arguments] ${expectation_filename} ${entities_ids} ${response_body} + [Arguments] ${expectation_filename} ${entities_ids} ${response_body} FOR ${entity_id} IN @{entities_ids} - ${entity}= Get Value From Json ${response_body} $[?(@.id=='${entity_id}')] + ${entity}= Get Value From JSON ${response_body} $[?(@.id=='${entity_id}')] Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${entity}[0] END Check Response Body Containing List Containing Entity Elements With Different Types - [Arguments] ${filename} ${entities_representation_ids} ${response_body} - ${entities_representation_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${filename} + [Arguments] ${filename} ${entities_representation_ids} ${response_body} + ${entities_representation_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${filename} ${index}= Set Variable 0 FOR ${entity_representation_id} IN @{entities_representation_ids} - ${entities_representation_payload}= Update Value To Json ${entities_representation_payload} $.[${index}]..id ${entity_representation_id} + ${entities_representation_payload}= Update Value To JSON + ... ${entities_representation_payload} + ... $.[${index}]..id + ... ${entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entities_representation_payload} ${response_body} ${instance_id_regex_expr} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entities_representation_payload} + ... ${response_body} + ... ${instance_id_regex_expr} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element - [Arguments] ${filename} ${temporal_entity_representation_id} - ${temporal_entity_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} - ${temporal_entity_representation}= Update Value To Json ${temporal_entity_representation_payload} $..id ${temporal_entity_representation_id} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entity_representation} ${response['body']} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${filename} ${temporal_entity_representation_id} + ${temporal_entity_representation_payload}= Load JSON From File + ... ${EXECDIR}/data/temporalEntities/expectations/${filename} + ${temporal_entity_representation}= Update Value To JSON + ... ${temporal_entity_representation_payload} + ... $..id + ... ${temporal_entity_representation_id} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${temporal_entity_representation} + ... ${response['body']} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements - [Arguments] ${filename} ${temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} + [Arguments] ${filename} ${temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Load JSON From File + ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${index}= Set Variable 0 FOR ${temporal_entity_representation_id} IN @{temporal_entities_representation_ids} - ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} + ${temporal_entities_representation_payload}= Update Value To JSON + ... ${temporal_entities_representation_payload} + ... $.[${index}]..id + ... ${temporal_entity_representation_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${temporal_entities_representation_payload} ${response['body']} ${instance_id_regex_expr} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${temporal_entities_representation_payload} + ... ${response['body']} + ... ${instance_id_regex_expr} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element - [Arguments] ${expectation_filename} ${subscription_id} - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${subscription}= Update Value To Json ${subscription_payload} $..id ${subscription_id} - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${subscription_id} + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Subscription elements - [Arguments] ${expectation_file_path} ${subscription_ids} - ${subscription_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + [Arguments] ${expectation_file_path} ${subscription_ids} + ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${subscription_id} IN @{subscription_ids} - ${subscription_payload}= Update Value To Json ${subscription_payload} $.[${index}]..id ${subscription_id} + ${subscription_payload}= Update Value To JSON + ... ${subscription_payload} + ... $.[${index}]..id + ... ${subscription_id} ${index}= Evaluate ${index} + 1 END - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} # Since response body can be a json object if it contains one element # A check on the response body type is needed + Check Response Body Containing Number Of Entities - [Arguments] ${expected_entity_type} ${expected_length} + [Arguments] ${expected_entity_type} ${expected_length} - ${response_body_length}= Get Length ${response['body']} - ${is_list}= Run Keyword Evaluate type(${response['body']})==list + ${response_body_length}= Get Length ${response['body']} + ${is_list}= Run Keyword Evaluate type(${response['body']})==list - Run Keyword If ${is_list} Should Be Equal ${response_body_length} ${expected_length} - Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} + IF ${is_list} + Should Be Equal ${response_body_length} ${expected_length} + END + Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} FOR ${index} IN RANGE ${expected_length} - Run Keyword If ${is_list} Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + IF ${is_list} + Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + END END - Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} + Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} Check Response Body Containing Context Source Registration element - [Arguments] ${expectation_filename} ${context_source_registration_id} - ${context_source_registration_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..id ${context_source_registration_id} - ${ignored_keys}= Create List ${context_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${context_source_registration} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${context_source_registration_id} + ${context_source_registration_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${context_source_registration}= Update Value To JSON + ... ${context_source_registration_payload} + ... $..id + ... ${context_source_registration_id} + ${ignored_keys}= Create List ${context_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${context_source_registration} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeList element - [Arguments] ${expectation_filename} - ${entity_type_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_list_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} + ${entity_type_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_list_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityType element - [Arguments] ${expectation_filename} - ${entity_type_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + [Arguments] ${expectation_filename} + ${entity_type_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeInfo element - [Arguments] ${expectation_filename} - ${entity_type_info_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + [Arguments] ${expectation_filename} + ${entity_type_info_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${entity_type_info_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_type_info_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing AttributeList element - [Arguments] ${expectation_filename} - ${attribute_list_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} - ${ignored_keys}= Create List ${id_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_list_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} + ${attribute_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + ${ignored_keys}= Create List ${id_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${attribute_list_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Attribute element - [Arguments] ${expectation_filename} - ${attribute_payload}= Load Json From File ${EXECDIR}/data/${expectation_filename} + [Arguments] ${expectation_filename} + ${attribute_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List - ${comparison_result}= Compare Dictionaries Ignoring Keys ${attribute_payload} ${response['body']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${attribute_payload} + ... ${response['body']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Context Source Registrations elements - [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Load Json From File ${EXECDIR}/data/${expectation_file_path} + [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} + ${expected_context_source_registrations_payload}= Load JSON From File + ... ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${expected_context_source_registration_id} IN @{expected_context_source_registrations_ids} - ${expected_context_source_registrations_payload}= Update Value To Json ${expected_context_source_registrations_payload} $.[${index}]..id ${expected_context_source_registration_id} + ${expected_context_source_registrations_payload}= Update Value To JSON + ... ${expected_context_source_registrations_payload} + ... $.[${index}]..id + ... ${expected_context_source_registration_id} ${index}= Evaluate ${index} + 1 END - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_context_source_registrations_payload} ${response['body']} ${EMPTY} group_by=id - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_context_source_registrations_payload} + ... ${response['body']} + ... ${EMPTY} + ... group_by=id + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request - [Arguments] ${response} ${type} - Should Be Equal ${response['type']} ${type} + [Arguments] ${response} ${type} + Should Be Equal ${response['type']} ${type} Check Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - Should Be Equal ${response['body']['type']} ${type} + [Arguments] ${response} ${type} + Should Be Equal ${response['body']['type']} ${type} Check Response Body Title When Using Session Request - [Arguments] ${response} - Should Not Be Empty ${response['title']} + [Arguments] ${response} + Should Not Be Empty ${response['title']} Check Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - Should Not Be Empty ${response['body']['title']} + [Arguments] ${response} + Should Not Be Empty ${response['body']['title']} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - ${json_response_body}= Set Variable ${response.json()} + [Arguments] ${response} ${type} + ${json_response_body}= Set Variable ${response.json()} - Should Be Equal ${json_response_body['type']} ${type} + Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - ${json_response_body}= Set Variable ${response.json()} - Should Not Be Empty ${json_response_body['title']} + [Arguments] ${response} + ${json_response_body}= Set Variable ${response.json()} + Should Not Be Empty ${json_response_body['title']} Assert response status code - [Arguments] ${code} - Should Be Equal ${response}[status] ${code} + [Arguments] ${code} + Should Be Equal ${response}[status] ${code} Check HTTP Response Status Code Is [Arguments] ${expected_status} ${status}= Convert To Integer ${expected_status} - Console Should Be Equal ${response['status']} ${status} Log Status code validated -Check HTTP Response Body Json Schema Is - [Arguments] ${input} - Should Contain ${response['headers']['Content-Type']} application/json - ${schema} = Catenate SEPARATOR= ${input} .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - Check JSON Value In Response Body - [Arguments] ${json_path_expr} ${value_to_check} - Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} + [Arguments] ${json_path_expr} ${value_to_check} + Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} Check NotificationParams - [Arguments] ${filename} ${expected_additional_members} + [Arguments] ${filename} ${expected_additional_members} - ${expected_notification}= Load Json From File ${EXECDIR}/data/${filename} - ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_notification} ${response['body']['notification']} ${ignored_keys} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${expected_notification}= Load JSON From File ${EXECDIR}/data/${filename} + ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_notification} + ... ${response['body']['notification']} + ... ${ignored_keys} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} - Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} + Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} END Check Pagination Prev And Next Headers - [Arguments] ${prev_link} ${next_link} - ${expected_links}= Create List ${prev_link} ${next_link} - Run Keyword If '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal ${response['headers']['Link'].replace(" ", "").split(',')} ${expected_links} ignore_order=True - Run Keyword If '${prev_link}'!='' and '${next_link}'=='' Should Be Equal ${response['headers']['Link']} ${prev_link} - Run Keyword If '${prev_link}'=='' and '${next_link}'!='' Should Be Equal ${response['headers']['Link']} ${next_link} + [Arguments] ${prev_link} ${next_link} + ${expected_links}= Create List ${prev_link} ${next_link} + IF '${prev_link}'!='' and '${next_link}'!='' + Lists Should Be Equal + ... ${response['headers']['Link'].replace(" ", "").split(',')} + ... ${expected_links} + ... ignore_order=True + END + IF '${prev_link}'!='' and '${next_link}'=='' + Should Be Equal ${response['headers']['Link']} ${prev_link} + END + IF '${prev_link}'=='' and '${next_link}'!='' + Should Be Equal ${response['headers']['Link']} ${next_link} + END Check Response Body Containing One Subscription element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load Json From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} - ${subscription}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${subscription} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${response_body} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} + ${subscription}= Update Value To JSON ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${subscription} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing One Registration element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${registration}= Update Value To Json ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${registration} ${response_body} ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + [Arguments] ${expectation_filename} ${response_body} + ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} + ${registration}= Update Value To JSON ${payload} $..id ${response_body['id']} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${registration} + ... ${response_body} + ... ${instance_id_regex_expr} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Resource Set To - [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} + [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} - ${comparison_result}= Compare Dictionaries Ignoring Keys ${expected_resource} ${response['body']} ${ignored_keys} ${group_by} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${expected_resource} + ... ${response['body']} + ... ${ignored_keys} + ... ${group_by} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Created Resource Set To - [Arguments] ${created_resource} ${ignored_keys}=${None} + [Arguments] ${created_resource} ${ignored_keys}=${None} - Check Resource Set To ${created_resource} ${ignored_keys} + Check Resource Set To ${created_resource} ${ignored_keys} Check Subscription Failed - [Arguments] ${subscription} + [Arguments] ${subscription} Should Be True ${sub} - Check Resource Set To ${created_resource} ${ignored_keys} + Check Resource Set To ${created_resource} ${ignored_keys} Check Created Resources Set To - [Arguments] ${expected_resources} ${ignored_keys}=${None} + [Arguments] ${expected_resources} ${ignored_keys}=${None} - Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id + Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id Check Updated Resource Set To - [Arguments] ${updated_resource} ${ignored_keys}=${None} + [Arguments] ${updated_resource} ${ignored_keys}=${None} - Check Resource Set To ${updated_resource} ${ignored_keys} + Check Resource Set To ${updated_resource} ${ignored_keys} Check Updated Resources Set To - [Arguments] ${updated_resources} ${ignored_keys}=${None} + [Arguments] ${updated_resources} ${ignored_keys}=${None} - Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id + Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id Check SUT Not Containing Resource - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} 404 + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} 404 Check SUT Not Containing Resources - Should Be Empty ${response['body']} - + Should Be Empty ${response['body']} diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index ea8c64a8..7a16edde 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -1,9 +1,9 @@ *** Settings *** -Variables ./variables.py +Variables ./variables.py +Library String -Library String *** Keywords *** Fetch Id From Response Location Header - ${id}= Fetch From Right ${response['headers']['Location']} / - [return] ${id} + ${id}= Fetch From Right ${response['headers']['Location']} / + RETURN ${id} diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 0617a816..52cd6969 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -1,79 +1,90 @@ *** Settings *** -Library String -Library DateTime -Library JSONLibrary -Variables ${EXECDIR}/resources/variables.py +Library String +Library DateTime +Library JSONLibrary +Variables ${EXECDIR}/resources/variables.py -*** Variable *** -${date_format}= %Y-%m-%dT%H:%M:%SZ + +*** Variables *** +${date_format}= %Y-%m-%dT%H:%M:%SZ ${notification_server_url}= http://${notification_server_host}:${notification_server_port}/notify -${context_source_url}= http://${context_source_host}:${context_source_port} +${context_source_url}= http://${context_source_host}:${context_source_port} + *** Keywords *** Load Entity - [Arguments] ${entity_file_name} ${entity_id} - - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${entity_file_name} - ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + [Arguments] ${entity_file_name} ${entity_id} - [return] ${entity} + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${entity_file_name} + ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} + RETURN ${entity} Load Test Sample - [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} + [Arguments] ${test_sample_file_path} ${test_sample_id}=${EMPTY} - ${test_sample_payload}= Load Json From File ${EXECDIR}/data/${test_sample_file_path} - ${test_sample}= Update Value To Json ${test_sample_payload} $..id ${test_sample_id} + ${test_sample_payload}= Load JSON From File ${EXECDIR}/data/${test_sample_file_path} + ${test_sample}= Update Value To JSON ${test_sample_payload} $..id ${test_sample_id} - Run Keyword If '${test_sample_id}'=='' Delete Object From Json ${test_sample} $..id - - [return] ${test_sample} + IF '${test_sample_id}'=='' + Delete Object From JSON ${test_sample} $..id + END + RETURN ${test_sample} Load Subscription Sample With Reachable Endpoint - [Arguments] ${subscription_file_path} ${subscription_id}=${EMPTY} ${notification_endpoint_uri}=${notification_server_url} - - ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} - ${subscription}= Update Value To Json ${subscription_payload} $..notification['endpoint']['uri'] ${notification_endpoint_uri} - - [return] ${subscription} + [Arguments] + ... ${subscription_file_path} + ... ${subscription_id}=${EMPTY} + ... ${notification_endpoint_uri}=${notification_server_url} + + ${subscription_payload}= Load Test Sample ${subscription_file_path} ${subscription_id} + ${subscription}= Update Value To JSON + ... ${subscription_payload} + ... $..notification['endpoint']['uri'] + ... ${notification_endpoint_uri} + RETURN ${subscription} Set Entity Id In Subscription [Arguments] ${subscription_payload} ${entity_id} - ${dict}= Create Dictionary id=${entity_id} - ${subscription}= Add Object To Json ${subscription_payload} $..entities[0] ${dict} - [Return] ${subscription} + ${dict}= Create Dictionary id=${entity_id} + ${subscription}= Add Object To JSON ${subscription_payload} $..entities[0] ${dict} + RETURN ${subscription} Load Context Source Registration Sample With Reachable Context Source - [Arguments] ${context_source_registration_file_path} ${context_source_registration_id}=${EMPTY} ${context_source_endpoint_uri}=${context_source_url} - - ${context_source_registration_payload}= Load Test Sample ${context_source_registration_file_path} ${context_source_registration_id} - ${context_source_registration}= Update Value To Json ${context_source_registration_payload} $..endpoint ${context_source_endpoint_uri} - - [return] ${context_source_registration} + [Arguments] + ... ${context_source_registration_file_path} + ... ${context_source_registration_id}=${EMPTY} + ... ${context_source_endpoint_uri}=${context_source_url} + + ${context_source_registration_payload}= Load Test Sample + ... ${context_source_registration_file_path} + ... ${context_source_registration_id} + ${context_source_registration}= Update Value To JSON + ... ${context_source_registration_payload} + ... $..endpoint + ... ${context_source_endpoint_uri} + RETURN ${context_source_registration} Remove Entity Type [Arguments] ${entity} - ${invalid_entity}= Delete Object From Json ${entity} $..type - - [return] ${invalid_entity} + ${invalid_entity}= Delete Object From JSON ${entity} $..type + RETURN ${invalid_entity} Generate Random Entity Id [Arguments] ${id_prefix} - ${random_id}= Generate Random String 16 [NUMBERS] + ${random_id}= Generate Random String 16 [NUMBERS] ${entity_id}= Catenate ${id_prefix}${random_id} - - [return] ${entity_id} + RETURN ${entity_id} Create Batch Operation Result - [Arguments] ${success} ${errors} - - &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} + [Arguments] ${success} ${errors} - [return] &{batch_operation_result} + &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} + RETURN &{batch_operation_result} Upsert Element In Entity - [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ + [Arguments] ${initial_entity} ${fragment} ${jsonPath}=$ - ${updated_entity}= Add Object To Json ${initial_entity} ${jsonPath} ${fragment} - [return] ${updated_entity} + ${updated_entity}= Add Object To JSON ${initial_entity} ${jsonPath} ${fragment} + RETURN ${updated_entity} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 8290f67d..2a88bd8e 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -1,31 +1,33 @@ *** Settings *** -Documentation Mock http server for subscriber -Library HttpCtrl.Server -Variables ${EXECDIR}/resources/variables.py +Documentation Mock http server for subscriber + +Library HttpCtrl.Server +Variables ${EXECDIR}/resources/variables.py + *** Keywords *** Start Context Source Mock Server - #Initialize HTTP Client And Server - Start Server ${context_source_host} ${context_source_port} + # Initialize HTTP Client And Server + Start Server ${context_source_host} ${context_source_port} Wait for redirected request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 Wait for redirected failed request - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 400 + Reply By 400 Stop Context Source Mock Server - #Terminate HTTP Server + # Terminate HTTP Server Stop Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index 43af2820..ac978eba 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -1,86 +1,103 @@ *** Settings *** -Documentation Check Notification Behaviour -Library BuiltIn -Library Collections -Library HttpCtrl.Server -Library ${EXECDIR}/libraries/assertionUtils.py -Library ${EXECDIR}/libraries/dateTimeUtils.py -Variables ${EXECDIR}/resources/variables.py - -*** Variable *** -${notification_type}= ContextSource Notfication -${date_format}= %Y-%m-%dT%H:%M:%SZ -${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ +Documentation Check Notification Behaviour + +Library BuiltIn +Library Collections +Library HttpCtrl.Server +Library ${EXECDIR}/libraries/assertionUtils.py +Library ${EXECDIR}/libraries/dateTimeUtils.py +Variables ${EXECDIR}/resources/variables.py + + +*** Variables *** +${notification_type} ContextSource Notfication +${date_format} %Y-%m-%dT%H:%M:%SZ +${date_format_with_millis} %Y-%m-%dT%H:%M:%S.%fZ + *** Keywords *** -Start Local Server - [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} - #Initialize HTTP Client And Server - Start Server ${host} ${port} +Start Local Server + [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} + # Initialize HTTP Client And Server + Start Server ${host} ${port} Wait for notification - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json - [Return] ${notification} + ${notification_payload}= Get Request Body + ${notification}= Evaluate json.loads('''${notification_payload}''') json + RETURN ${notification} Wait for notification and validate it - [Arguments] ${expected_subscription_id} ${expected_context_source_registration_ids} ${expected_trigger_reason} ${expected_notification_data_entities}=${EMPTY} ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] + ... ${expected_subscription_id} + ... ${expected_context_source_registration_ids} + ... ${expected_trigger_reason} + ... ${expected_notification_data_entities}=${EMPTY} + ... ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For Request ${timeout} - Reply By 200 + Reply By 200 - ${notification_payload}= Get Request Body - ${notification} Evaluate json.loads('''${notification_payload}''') json + ${notification_payload}= Get Request Body + ${notification}= Evaluate json.loads('''${notification_payload}''') json ${notification_data_length}= Get length ${notification}[data] ${expected_notification_data_entities_length}= Get length ${expected_notification_data_entities} ${expected_notification_data_length}= Get length ${expected_context_source_registration_ids} - log ${notification} - Should Be Equal ${notification}[type] ${notification_type} - Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} + log ${notification} + Should Be Equal ${notification}[type] ${notification_type} + Should Be Equal ${notification}[subscriptionId] ${expected_subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} - Should Be True ${is_date} + Should Be True ${is_date} ${index}= Set Variable 0 FOR ${expected_context_source_registration_id} IN @{expected_context_source_registration_ids} - List Should Contain Value ${expected_context_source_registration_ids} ${notification}[data][${index}][@id] + List Should Contain Value + ... ${expected_context_source_registration_ids} + ... ${notification}[data][${index}][@id] ${index}= Evaluate ${index} + 1 END - Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' - Should Be Equal ${notification}[triggerReason] ${expected_trigger_reason} + Should Be Equal '${notification_data_length}' '${expected_notification_data_length}' + Should Be Equal ${notification}[triggerReason] ${expected_trigger_reason} # TODO Currently we check entities information of the first CSR returned in the notification, find a way to check them all - Run Keyword If ${expected_notification_data_entities_length}>0 Check Notification Data Entities ${notification}[data][0][information] ${expected_notification_data_entities} + IF ${expected_notification_data_entities_length}>0 + Check Notification Data Entities + ... ${notification}[data][0][information] + ... ${expected_notification_data_entities} + END Wait for no notification - [Arguments] ${timeout}=${5} - #HTTP server receives it and checks incoming request for correctness - #.. "Wait For Request" - #.... This call is blocked until HTTP request arrives or timeout. - #.... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request + [Arguments] ${timeout}=${5} + # HTTP server receives it and checks incoming request for correctness + # .. "Wait For Request" + # .... This call is blocked until HTTP request arrives or timeout. + # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request Wait For No Request ${timeout} Check Notification Data Entities - [Arguments] ${notification_data_information} ${expected_notification_data_entities} + [Arguments] ${notification_data_information} ${expected_notification_data_entities} - ${notification_data_entities}= Create List + ${notification_data_entities}= Create List ${index}= Set Variable 0 FOR ${registration_information} IN @{notification_data_information} - Append To List ${notification_data_entities} ${registration_information}[entities][0][type][0] + Append To List ${notification_data_entities} ${registration_information}[entities][0][type][0] END - Lists Should Be Equal ${expected_notification_data_entities} ${notification_data_entities} ignore_order=True + Lists Should Be Equal + ... ${expected_notification_data_entities} + ... ${notification_data_entities} + ... ignore_order=True Stop Local Server - #Terminate HTTP Server + # Terminate HTTP Server Stop Server -- GitLab From 102e979ff032b4b6be137bc7c92423a80da598a3 Mon Sep 17 00:00:00 2001 From: poujol Date: Thu, 1 Jun 2023 08:33:29 +0000 Subject: [PATCH 297/442] chore: clean up used libraries --- README.md | 11 +- TP/NGSI-LD/CommonBehaviours/043.robot | 33 +- TP/NGSI-LD/CommonBehaviours/044_01.robot | 10 +- TP/NGSI-LD/CommonBehaviours/044_02.robot | 44 +- TP/NGSI-LD/CommonBehaviours/044_03.robot | 22 +- TP/NGSI-LD/CommonBehaviours/044_04.robot | 24 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 14 +- .../027_01_01.robot | 9 +- .../027_01_02.robot | 4 +- .../RetrieveAvailableAttributes/025_01.robot | 4 +- .../024_01_01.robot | 9 +- .../024_01_02.robot | 4 +- .../RetrieveAvailableEntityTypes/022_01.robot | 4 +- .../026_01.robot | 4 +- .../023_01.robot | 4 +- .../Entity/QueryEntities/019_01_01.robot | 16 +- .../Entity/QueryEntities/019_01_02.robot | 16 +- .../Entity/QueryEntities/019_01_03.robot | 12 +- .../Entity/QueryEntities/019_01_04.robot | 12 +- .../Entity/QueryEntities/019_01_05.robot | 12 +- .../Entity/QueryEntities/019_02_01.robot | 18 +- .../Entity/QueryEntities/019_02_02.robot | 18 +- .../Entity/QueryEntities/019_02_03.robot | 14 +- .../Entity/QueryEntities/019_02_04.robot | 14 +- .../Entity/QueryEntities/019_02_05.robot | 14 +- .../Entity/QueryEntities/019_03_01.robot | 14 +- .../Entity/QueryEntities/019_03_02.robot | 14 +- .../Entity/QueryEntities/019_03_03.robot | 14 +- .../Entity/QueryEntities/019_03_04.robot | 14 +- .../Entity/QueryEntities/019_03_05.robot | 14 +- .../Entity/QueryEntities/019_04.robot | 16 +- .../Entity/QueryEntities/019_05.robot | 16 +- .../Entity/QueryEntities/019_06.robot | 14 +- .../Entity/RetrieveEntity/018_01_01.robot | 10 +- .../Entity/RetrieveEntity/018_01_02.robot | 10 +- .../Entity/RetrieveEntity/018_01_03.robot | 10 +- .../Entity/RetrieveEntity/018_02.robot | 8 +- .../Entity/RetrieveEntity/018_03_01.robot | 8 +- .../Entity/RetrieveEntity/018_03_02.robot | 12 +- .../Entity/RetrieveEntity/018_04.robot | 10 +- .../Entity/RetrieveEntity/018_05.robot | 10 +- .../Entity/RetrieveEntity/018_06.robot | 6 +- .../021_01.robot | 4 +- .../021_02.robot | 4 +- .../021_03.robot | 4 +- .../021_04.robot | 4 +- .../021_05.robot | 4 +- .../021_06.robot | 4 +- .../021_07.robot | 4 +- .../021_08.robot | 4 +- .../021_09.robot | 4 +- .../021_10.robot | 5 +- .../021_11.robot | 4 +- .../021_12.robot | 9 +- .../021_13.robot | 6 +- .../020_01.robot | 4 +- .../020_02.robot | 4 +- .../020_03.robot | 4 +- .../020_04.robot | 4 +- .../020_05.robot | 4 +- .../020_06.robot | 8 +- .../020_07.robot | 8 +- .../020_08.robot | 9 +- .../020_09.robot | 8 +- .../020_10.robot | 4 +- .../CreateBatchOfEntities/003_01.robot | 8 +- .../CreateBatchOfEntities/003_02.robot | 9 +- .../CreateBatchOfEntities/003_03.robot | 8 +- .../CreateBatchOfEntities/003_04.robot | 10 +- .../CreateBatchOfEntities/003_05.robot | 10 +- .../CreateBatchOfEntities/003_06.robot | 8 +- .../CreateBatchOfEntities/003_07.robot | 10 +- .../CreateBatchOfEntities/003_08.robot | 8 +- .../CreateBatchOfEntities/003_09.robot | 8 +- .../DeleteBatchOfEntities/006_01.robot | 6 +- .../DeleteBatchOfEntities/006_02.robot | 6 +- .../DeleteBatchOfEntities/006_03.robot | 8 +- .../UpdateBatchOfEntities/005_01.robot | 6 +- .../UpdateBatchOfEntities/005_02.robot | 6 +- .../UpdateBatchOfEntities/005_03.robot | 8 +- .../UpdateBatchOfEntities/005_04.robot | 8 +- .../UpsertBatchOfEntities/004_01.robot | 8 +- .../UpsertBatchOfEntities/004_02.robot | 8 +- .../UpsertBatchOfEntities/004_03.robot | 6 +- .../UpsertBatchOfEntities/004_04.robot | 8 +- .../UpsertBatchOfEntities/004_05.robot | 8 +- .../UpsertBatchOfEntities/004_06.robot | 8 +- .../Entities/CreateEntity/001_01.robot | 13 +- .../Entities/CreateEntity/001_02.robot | 8 +- .../Entities/CreateEntity/001_03.robot | 12 +- .../Entities/CreateEntity/001_04.robot | 8 +- .../Entities/CreateEntity/001_05.robot | 11 +- .../Entities/CreateEntity/001_06.robot | 8 +- .../Entities/CreateEntity/001_07.robot | 8 +- .../Entities/CreateEntity/001_08.robot | 8 +- .../Entities/CreateEntity/001_09.robot | 8 +- .../Entities/DeleteEntity/002_01.robot | 8 +- .../Entities/DeleteEntity/002_02.robot | 6 +- .../Entities/DeleteEntity/002_03.robot | 6 +- .../AppendEntityAttributes/010_01.robot | 24 +- .../AppendEntityAttributes/010_02.robot | 19 +- .../AppendEntityAttributes/010_03.robot | 7 +- .../DeleteEntityAttribute/013_01.robot | 11 +- .../DeleteEntityAttribute/013_02.robot | 6 +- .../DeleteEntityAttribute/013_03.robot | 6 +- .../PartialAttributeUpdate/012_01.robot | 11 +- .../PartialAttributeUpdate/012_02.robot | 10 +- .../PartialAttributeUpdate/012_03.robot | 10 +- .../UpdateEntityAttributes/011_01.robot | 13 +- .../UpdateEntityAttributes/011_02.robot | 19 +- .../UpdateEntityAttributes/011_03.robot | 8 +- .../007_01.robot | 6 +- .../007_02.robot | 6 +- .../009_01.robot | 6 +- .../009_02.robot | 6 +- .../009_03.robot | 6 +- .../008_01.robot | 6 +- .../AppendAttributes/014_01.robot | 6 +- .../AppendAttributes/014_02.robot | 10 +- .../AppendAttributes/014_03.robot | 4 +- .../DeleteAttribute/015_01.robot | 6 +- .../DeleteAttribute/015_02.robot | 8 +- .../DeleteAttribute/015_03.robot | 8 +- .../DeleteAttributeInstance/017_01.robot | 10 +- .../DeleteAttributeInstance/017_02.robot | 6 +- .../DeleteAttributeInstance/017_03.robot | 6 +- .../ModifyAttributeInstance/016_01.robot | 12 +- .../ModifyAttributeInstance/016_02.robot | 6 +- .../ModifyAttributeInstance/016_03.robot | 6 +- .../CreateSubscription/028_01.robot | 7 +- .../CreateSubscription/028_02.robot | 8 +- .../CreateSubscription/028_03.robot | 6 +- .../CreateSubscription/028_04.robot | 11 +- .../DeleteSubscription/032_01.robot | 8 +- .../DeleteSubscription/032_02.robot | 8 +- .../DeleteSubscription/032_03.robot | 6 +- .../Subscription/Notification/046_01.robot | 3 +- .../Subscription/Notification/046_02.robot | 4 +- .../Subscription/Notification/046_03.robot | 3 +- .../Subscription/Notification/046_04.robot | 3 +- .../Subscription/Notification/046_05.robot | 3 +- .../Subscription/Notification/046_06.robot | 4 +- .../Subscription/Notification/046_07.robot | 3 +- .../Subscription/Notification/046_08.robot | 4 +- .../Subscription/Notification/046_09.robot | 2 +- .../Subscription/Notification/046_10.robot | 2 +- .../Subscription/Notification/046_11.robot | 8 +- .../Subscription/Notification/046_12.robot | 7 +- .../Subscription/Notification/046_13.robot | 5 +- .../Subscription/Notification/046_14.robot | 2 +- .../QuerySubscriptions/031_01.robot | 4 +- .../QuerySubscriptions/031_02.robot | 4 +- .../RetrieveSubscription/030_01.robot | 8 +- .../RetrieveSubscription/030_02.robot | 8 +- .../RetrieveSubscription/030_03.robot | 4 +- .../UpdateSubscription/029_01.robot | 8 +- .../UpdateSubscription/029_02.robot | 8 +- .../UpdateSubscription/029_03.robot | 12 +- .../UpdateSubscription/029_04.robot | 12 +- .../UpdateSubscription/029_05.robot | 8 +- .../UpdateSubscription/029_06.robot | 6 +- .../UpdateSubscription/029_07.robot | 9 +- .../UpdateSubscription/029_08.robot | 9 +- .../UpdateSubscription/029_09.robot | 9 +- .../UpdateSubscription/029_10.robot | 14 +- .../UpdateSubscription/029_11.robot | 12 +- .../033_01_01.robot | 7 +- .../033_01_02.robot | 8 +- .../033_01_03.robot | 8 +- .../033_02.robot | 11 +- .../033_03.robot | 10 +- .../033_04.robot | 8 +- .../033_05.robot | 8 +- .../033_06.robot | 8 +- .../033_07.robot | 8 +- .../033_08.robot | 8 +- .../033_09.robot | 8 +- .../035_01.robot | 8 +- .../035_02.robot | 8 +- .../035_03.robot | 4 +- .../037_01.robot | 4 +- .../037_02.robot | 8 +- .../037_03.robot | 8 +- .../037_04.robot | 4 +- .../037_05.robot | 9 +- .../037_06.robot | 7 +- .../037_07.robot | 4 +- .../037_08.robot | 4 +- .../037_09.robot | 6 +- .../037_10.robot | 4 +- .../037_11.robot | 4 +- .../036_01.robot | 8 +- .../036_02.robot | 8 +- .../036_03.robot | 4 +- .../036_04.robot | 6 +- .../036_05.robot | 4 +- .../034_01.robot | 8 +- .../034_02.robot | 17 +- .../034_03.robot | 4 +- .../038_01.robot | 8 +- .../038_02.robot | 8 +- .../038_03.robot | 8 +- .../038_04.robot | 8 +- .../038_05.robot | 8 +- .../038_06.robot | 8 +- .../038_07.robot | 9 +- .../038_08.robot | 8 +- .../038_09.robot | 8 +- .../042_01.robot | 8 +- .../042_02.robot | 8 +- .../042_03.robot | 8 +- .../NotificationBehaviour/047_01.robot | 2 +- .../NotificationBehaviour/047_02.robot | 4 +- .../NotificationBehaviour/047_03.robot | 2 +- .../NotificationBehaviour/047_04.robot | 2 +- .../NotificationBehaviour/047_05.robot | 4 +- .../NotificationBehaviour/047_06.robot | 4 +- .../NotificationBehaviour/047_07.robot | 6 +- .../NotificationBehaviour/047_08.robot | 2 +- .../NotificationBehaviour/047_09.robot | 2 +- .../NotificationBehaviour/047_10.robot | 2 +- .../NotificationBehaviour/047_11.robot | 4 +- .../NotificationBehaviour/047_12.robot | 2 +- .../NotificationBehaviour/047_13.robot | 2 +- .../NotificationBehaviour/047_14.robot | 2 +- .../NotificationBehaviour/047_15.robot | 2 +- .../NotificationBehaviour/047_16.robot | 4 +- .../041_01.robot | 4 +- .../041_02.robot | 6 +- .../041_03.robot | 4 +- .../041_04.robot | 8 +- .../040_01.robot | 6 +- .../040_02.robot | 8 +- .../040_03.robot | 8 +- .../039_01.robot | 8 +- .../039_02.robot | 8 +- .../039_03.robot | 8 +- .../039_04.robot | 12 +- .../039_05.robot | 9 +- libraries/logUtils.py | 48 ++ requirements.txt | 3 - resources/ApiUtils.resource | 760 ++++++++---------- resources/AssertionUtils.resource | 150 ++-- resources/HttpUtils.resource | 2 +- resources/MockServerUtils.resource | 9 - 245 files changed, 1405 insertions(+), 1482 deletions(-) create mode 100644 libraries/logUtils.py diff --git a/README.md b/README.md index 5c314cd0..b4925e6f 100644 --- a/README.md +++ b/README.md @@ -107,14 +107,6 @@ Launch the tests with the following command: For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh). -## Generate metrics from the tests results - -Optionally, you can generate metrics from the results of tests: - -```$ robotmetrics --inputpath -k True -s True``` - -A sample report can be seen at https://robotmetrics.netlify.app/# - ## Generate a documentation for the support keywords ```$ python3 -m robot.libdoc resources/ApiUtils.resource api_docs/ApiUtils.html``` @@ -126,11 +118,10 @@ A sample report can be seen at https://robotmetrics.netlify.app/# # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) -* [RESTinstance](https://github.com/asyrjasalo/RESTinstance) -* [JSON Schema Library](https://github.com/jstaffans/robotframework-jsonschemalibrary) * [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary) * [Requests Library](https://github.com/MarketSquare/robotframework-requests) * [Deep Diff](https://github.com/seperman/deepdiff) +* [HttpCtrl Library](https://github.com/annoviko/robotframework-httpctrl) * [Robotidy Library ](https://github.com/MarketSquare/robotframework-tidy) # Useful links diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 3643488a..62b9ef0a 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -23,15 +23,15 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription @@ -39,11 +39,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities @@ -54,11 +54,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create @@ -69,12 +69,12 @@ ${registration_filename}= csourceRegistrations/context-source-registration ${first_entity}= Load Entity ${building_filename} ${first_entity_id} ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To ${expected_status_code} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration @@ -83,7 +83,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code ${expected_status_code} ${response.status_code} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 32b3ecf9..279678cd 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -21,18 +21,18 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${vehicle_fragment} ... ${CONTENT_TYPE_MERGE_PATCH_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} 044_01_02_endpoint /subscriptions/{subscriptionId} @@ -40,11 +40,11 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp [Tags] sub-update 6_3_4 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Subscription ... ${subscription_id} ... ${subscription_fragment} ... ${CONTENT_TYPE_MERGE_PATCH_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 475f6508..f8e87f4b 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -25,15 +25,15 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) [Tags] e-query 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Entity by Id Returning Response ${id} 044_02_02_endpoint /subscriptions/{subscriptionId} @@ -41,11 +41,11 @@ ${content_type}= application/json [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=*/* + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Subscription ${id} 044_02_03_endpoint /csourceRegistrations/ @@ -54,16 +54,16 @@ ${content_type}= application/json ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Context Source Registrations With Return ... id=${registration_id} ... type=${registration_type} ... context=${ngsild_test_suite_context} ... accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} 044_02_04_endpoint /temporal/entities @@ -74,15 +74,15 @@ ${content_type}= application/json ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Temporal Representation Of Entities With Return + Check Response Status Code 201 ${response.status_code} + ${response}= Query Temporal Representation Of Entities With Return ... entity_types=${teatype} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... context=${ngsild_test_suite_context} ... accept=*/* - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Set Test Variable ${response} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index f0b61393..306335d6 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -26,17 +26,17 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${vehicle_attribute} ... ${vehicle_fragment} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_03_02_endpoint patch /subscriptions/{subscriptionId} @@ -44,20 +44,20 @@ ${content_type}= application/xml [Tags] sub-update 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${id} 044_03_03_endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) [Tags] e-create 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} 044_03_04_endpoint post /subscriptions/ @@ -65,7 +65,7 @@ ${content_type}= application/xml [Tags] sub-create 6_3_4 ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create @@ -76,9 +76,9 @@ ${content_type}= application/xml ${first_entity}= Load Entity ${building_filename} ${first_entity_id} ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${content_type} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${content_type} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 415 + Check Response Status Code 415 ${response.status_code} [Teardown] Batch Delete Entities @{expected_entities_ids} 044_03_06_endpoint post /temporal/entities/ @@ -89,5 +89,5 @@ ${content_type}= application/xml ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 1f8b1b7e..b0670b2a 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -20,13 +20,13 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) [Tags] e-query 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_04_02_endpoint get /subscriptions/{subscriptionId} @@ -34,30 +34,30 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) [Tags] csr-query 6_3_4 - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) [Tags] csrsub-query Query Context Source Registration Subscriptions accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} 044_04_05_endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index 20f32c37..c7bd6dcc 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -19,24 +19,24 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} 044_05_02 Query temporal entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} 044_05_03 Query context source registration [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations) [Tags] csr-query 6_3_4 - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index cf01a312..889a5c5e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -18,12 +18,13 @@ ${filename}= building-simple-attributes-sample.json Retrieve Detailed Representation Of Available Attribute Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute [Tags] ed-attr 5_7_10 - Retrieve Attribute attribute_name=airQualityLevel - Check Response Status Code Set To 404 + ${response}= Retrieve Attribute attribute_name=airQualityLevel + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index c2fb7083..1a2f0f77 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -19,8 +19,8 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json Retrieve Detailed Representation Of Available Attribute [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Tags] ed-attr 5_7_10 - Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Attribute element ${expectation_file} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 17bb74b3..c611457b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -27,8 +27,8 @@ WithJsonLdContext [Tags] ed-attrs 5_7_8 Retrieve Available Attributes [Documentation] Check that you can retrieve a list of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - Retrieve Attributes ${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Attributes ${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing AttributeList element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index 2ba0b2bf..f45a563b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -18,12 +18,13 @@ ${filename}= building-simple-attributes-sample.json Retrieve Detailed Representation Of Available Entity Type Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type [Tags] ed-type 5_7_7 - Retrieve Entity Type type=Building - Check Response Status Code Set To 404 + ${response}= Retrieve Entity Type type=Building + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index 761260d9..33d7f30e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -19,8 +19,8 @@ ${expectation_file}= types/expectations/entity-type-info-024-01-expectati Retrieve Detailed Representation Of Available Entity Type [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type [Tags] ed-type 5_7_7 - Retrieve Entity Type type=Building context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Type type=Building context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTypeInfo element ${expectation_file} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 22b2d42a..0089b75b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -29,8 +29,8 @@ WithJsonLdContext [Tags] ed-types 5_7_5 Retrieve Available Entity Types [Documentation] Check that you can retrieve a list of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - Retrieve Entity Types ${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Types ${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTypeList element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index 77ac8a2d..ff3c6511 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -27,8 +27,8 @@ WithJsonLdContext [Tags] ed-attrs-details 5_7_9 Retrieve Details Of Available Attributes [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - Retrieve Attributes context=${context} details=${TRUE} - Check Response Status Code Set To 200 + ${response}= Retrieve Attributes context=${context} details=${TRUE} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Attribute element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index 3f76ca0e..b725e55a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -29,8 +29,8 @@ WithJsonLdContext [Tags] ed-types-details 5_7_6 Retrieve Details Of Available Entity Types [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - Retrieve Entity Types context=${context} details=${TRUE} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Types context=${context} details=${TRUE} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityType element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index 6a44b0d9..d09a2f72 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -18,34 +18,34 @@ Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index a33dd671..5656a2ff 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -24,31 +24,31 @@ Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} Check Response Body Containing List Containing Entity Elements With Different Types ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index e4dece98..fbd38643 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -19,27 +19,27 @@ Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 1cdc121f..064080b4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -21,28 +21,28 @@ Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename2} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 754d15c2..84abf539 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -19,17 +19,17 @@ Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -37,11 +37,11 @@ Query several entities based on a list of properties ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} ... accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index f27065ef..dbb050fb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -18,34 +18,34 @@ Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index 854ba8a4..edf911ad 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -24,31 +24,31 @@ Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entity_types_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 32450318..6643c88e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -19,27 +19,27 @@ Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index bc09646d..90fbe9b1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -19,28 +19,28 @@ Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} - ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_retrieved} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index b4d9dfe6..9b5473cf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -19,27 +19,27 @@ Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index 1538368d..23f067ac 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -19,27 +19,27 @@ Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index c6e8d8d2..e324a597 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -20,27 +20,27 @@ Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${invalid_entity_type_one} ... ${invalid_entity_type_two} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 2ab80b97..64d4749a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -18,26 +18,26 @@ Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_id_pattern=${invalid_entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 12ab098d..3e1334d6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -19,24 +19,24 @@ Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 1f1255e1..a3bc3987 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -21,17 +21,17 @@ Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} @@ -40,11 +40,11 @@ Query entitites when the request has a wrong geometryProperty ... geometry=${geometry} ... coordinates=${coordinates} ... context=${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index 9cb3a2af..fdf6a3b9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -19,23 +19,23 @@ Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -43,11 +43,11 @@ Query entities in a simplified representation ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... options=${options_parameter} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index b903862f..65a42cff 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -19,23 +19,23 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -43,11 +43,11 @@ Get an entity by id that can be returned in a geoJSON format ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... accept=${accept_header} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 7d239a29..449cd3a9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -18,23 +18,23 @@ Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entities_ids_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${first_entity_id} @@ -45,7 +45,7 @@ Query entities specifying a maximum number of results ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... limit=${limit} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Number Of Entities ${entity_type} ${2} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index 98120195..aa405bc9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -17,12 +17,12 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld [Documentation] Check that you can get an entity by id [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 88ea67fa..b7fbc456 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -19,19 +19,19 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego [Documentation] Check that you can query some attributes from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} - ${request} ${response}= Query Entity + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index 2b311a5a..a8fa27b2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -18,15 +18,15 @@ ${geometry_property}= location [Documentation] Check that you can query the geometry property from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index 2ba3ed12..b8ab4a7e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -19,9 +19,9 @@ Get Entity With Invalid/Missing Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 56ef5bb5..f73abb0f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -15,9 +15,9 @@ Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 630c6754..1e3d05d1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -17,19 +17,19 @@ Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} - ${request} ${response}= Query Entity + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 1370d9c2..75c6fd20 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -18,15 +18,15 @@ Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... options=${options_parameter} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 5d5eb854..45cfc1e8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -19,12 +19,12 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 40246d08..00915f13 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -30,9 +30,9 @@ CreationTimeJsonLdContext Check JSON-LD Resolution When retrieving an entity [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response.json()} Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 1d280eb4..2501434a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -30,7 +30,7 @@ Query the temporal evolution of entities [Documentation] Check that you can query the temporal evolution of entities [Arguments] ${timerel} ${timeAt} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=${timerel} ... timeAt=${timeAt} @@ -38,7 +38,7 @@ Query the temporal evolution of entities @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index 73695a9d..af1dd099 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -22,7 +22,7 @@ Query the temporal evolution of certain attributes of entities [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -31,7 +31,7 @@ Query the temporal evolution of certain attributes of entities @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index b48e938e..0fbed90c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -21,7 +21,7 @@ Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -30,7 +30,7 @@ Query the temporal evolution of the last N instances of entities attributes @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 8ad92735..30a92bf3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -21,7 +21,7 @@ Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -29,7 +29,7 @@ Query the temporal evolution of entities using a context @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index f6809bec..1d6c2d16 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -22,13 +22,13 @@ Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 67c5a413..59e25190 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -22,14 +22,14 @@ Query the temporal evolution of entities matching the given identifier(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_ids=${entity_ids_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index c6ef14aa..b4075e65 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -21,7 +21,7 @@ Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_id_pattern=urn:ngsi-ld:Vehicle:.* ... timerel=after @@ -30,7 +30,7 @@ Query the temporal evolution of entities matching the given id pattern @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 8ea5288c..4d1efb4d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -21,7 +21,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... ngsild_query=speed>90 ... timerel=after @@ -30,7 +30,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 7d2f24ab..5269eb39 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -29,7 +29,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... georel=${georel} ... geometry=${geometry} @@ -39,7 +39,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index 544dc923..062f404f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -21,14 +21,15 @@ Query the temporal evolution of entities matching the given NGSI-LD context sour [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... csf=endpoint=="${context_source_url}" ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} Wait for redirected request - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 2b30e80d..5e0e25de 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -30,13 +30,13 @@ Query the temporal evolution of entities with a limit to the number of entities [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved [Arguments] ${limit} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus,Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... limit=${limit} ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Vehicle ${limit} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index dfed8f79..d52e17b8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -18,15 +18,16 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json Query the temporal evolution of entities with an invalid request [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request [Tags] te-query 5_7_4 - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 2f865194..54963f57 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -27,11 +27,13 @@ Before [Tags] te-query 5_7_4 Query the temporal evolution of entities using the entityOperations method [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method [Arguments] ${payload_file} ${expectation_file} - Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} + ${response}= Query Temporal Representation Of Entities Via Post + ... ${payload_file} + ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} ... ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 884d2046..95c4e17b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -19,8 +19,8 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati Retrieve the temporal evolution of an entity [Documentation] Check that you can retrieve the temporal evolution of an entity [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - Check Response Status Code Set To 200 + ${response}= Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index bd965bf3..0d3d4f9b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -19,10 +19,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 16ad9623..b4d586e0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -20,11 +20,11 @@ Retrieve the temporal evolution of certain attributes of an entity [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... attrs=${temporal_attributes_to_be_retrieved} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 8e5789b9..d1ecd7b6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -28,13 +28,13 @@ Between [Tags] te-retrieve 5_7_3 Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... timerel=${timerel} ... timeAt=${timeAt} ... endTimeAt=${endTimeAt} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 274a150b..0a07a3ac 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -28,11 +28,11 @@ Retrieve All Instances Retrieve the temporal evolution of the last N instances of entity attributes [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes [Arguments] ${lastN} ${vehicle_expectation_file} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... lastN=${lastN} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 7cfec33b..01262715 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve the temporal evolution of an entity with an invalid id [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity invalidUri - Check Response Status Code Set To 400 + ${response}= Retrieve Temporal Representation Of Entity invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 1d44b0f5..6e6a1d42 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve the temporal evolution of a non-existing entity [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity - Check Response Status Code Set To 404 + ${response}= Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index a56bd842..35b573da 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -19,15 +19,16 @@ Retrieve the temporal evolution of non-existing entity attributes [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... attrs=${temporal_attributes_to_be_retrieved} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index b8b5ce55..c536d78b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -28,16 +28,16 @@ Between [Tags] te-retrieve 5_7_3 Retrieve the temporal evolution of an entity with an invalid request content [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content [Arguments] ${timerel} ${timeAt} ${endTimeAt} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... timerel=${timerel} ... timeAt=${timeAt} ... endTimeAt=${endTimeAt} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 0cea8d05..d982aaa5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -20,11 +20,11 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... options=${options} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index d79401ef..3961c29c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -35,15 +35,15 @@ Batch Create Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} + ${response}= Batch Create Entities @{entities_to_be_created} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities + ${response}= Query Entities ... ${entities_to_be_queried} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Created Resources Set To ${entities_to_be_created} - Batch Delete Entities @{expected_entities_ids} + ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index 9f0e90eb..383d98fd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -23,16 +23,16 @@ Create a batch of two valid entities and one invalid entity ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} - Batch Create Entities @{entities_to_be_created} + ${response}= Batch Create Entities @{entities_to_be_created} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${existing_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} @@ -40,7 +40,8 @@ Create a batch of two valid entities and one invalid entity @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index afbc5db4..980c579e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -18,9 +18,9 @@ EmptyJson [Tags] be-create 5_6_7 Create Batch Entity With Invalid Request Scenarios [Documentation] Check that you cannot create a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File create filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File create filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index f78f2faa..58d817e6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -17,16 +17,16 @@ Create a batch of one entity using a provided Link header with JSON content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this attribute Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index de136701..a16bb2ca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -17,13 +17,13 @@ Create a batch of one entity using the default context with JSON content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index 538c0f8d..390ff2bf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -17,9 +17,9 @@ Create a batch of one entity containing a JSON-LD @context with a JSON content t ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index 9aa8dc7a..00dc0dbc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -17,13 +17,13 @@ Create a batch of one entity using a JSON-LD @context obtained from the request ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index 9926817d..bc106ed5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -17,9 +17,9 @@ Create a batch of one entity not containing a JSON-LD @context with a JSON-LD co ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 400 + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 53810f46..cde6b9e3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -17,12 +17,12 @@ Create a batch of one entity with a Link header and a JSON-LD content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 917b0813..17b0c552 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -17,10 +17,10 @@ Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] be-delete 5_6_10 @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - Check Response Status Code Set To 204 + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Status Code 204 ${response.status_code} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index abe62e7e..c408657c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -18,16 +18,16 @@ Delete a batch of non-existing and existing entities [Tags] be-delete 5_6_10 ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index c36cc59e..77423e96 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -18,9 +18,9 @@ EmptyJson [Tags] be-delete 5_6_10 Batch Delete Entity With Invalid Request Scenarios [Documentation] Check that you cannot delete a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File delete filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File delete filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 9cd6e877..a6150c46 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -35,8 +35,8 @@ Batch Update Entity Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} - Batch Update Entities @{entities_to_be_updated} - Check Response Status Code Set To 204 + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -44,7 +44,7 @@ Batch Update Entity Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 005e8145..d307e90c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -35,8 +35,8 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} - Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite - Check Response Status Code Set To ${expected_status} + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code ${expected_status} ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -44,7 +44,7 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 9cfe8864..51137694 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -27,13 +27,13 @@ Update a batch of non-existing and existing entities ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} - Batch Update Entities @{entities_to_be_updated} + ${response}= Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} ${second_created_entity}= Load Test Sample @@ -44,13 +44,13 @@ Update a batch of non-existing and existing entities ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} - Batch Delete Entities @{expected_successful_entities_ids} + ${response}= Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index e00b0a4e..c450dcab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -18,9 +18,9 @@ InvalidJsonLd [Tags] be-update 5_6_9 Batch Update Entity With Invalid Request Scenarios [Documentation] Check that you cannot update a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File update filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File update filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index 7901378a..a8b6abab 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -33,15 +33,15 @@ Batch Upsert Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} - Batch Delete Entities @{expected_entities_ids} + ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index b41d692c..afcab510 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -38,23 +38,23 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... ${new_entity} ... ${first_existing_entity} ... ${second_existing_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} @{upserted_entities_ids}= Create List ... ${new_entity_id} ... ${first_existing_entity_id} ... ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 882bab4d..de53092e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -33,11 +33,11 @@ Batch Upsert Existing Entities Scenarios ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} - Batch Upsert Entities @{entities_to_be_upserted} - Check Response Status Code Set To 204 + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 204 ${response.status_code} @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 9673baf0..47681f62 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -36,23 +36,23 @@ Batch Upsert Entities With Update Option Scenarios ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} - Batch Upsert Entities @{entities_to_be_upserted} update_option=update + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index b66d407e..678baa02 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -22,20 +22,20 @@ Upsert a batch of two valid entities and one invalid entity ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} ${invalid_entity}= Remove Entity Type ${third_entity} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${third_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} Check Updated Resources Set To ${upserted_entities} - Batch Delete Entities @{expected_successful_entities_ids} + ${response}= Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 1b8c9cc3..75fcacdd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -18,9 +18,9 @@ InvalidJsonLd [Tags] be-upsert 5_6_8 Batch Upsert Entity With Invalid Request Scenarios [Documentation] Check that you cannot upsert a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File upsert filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File upsert filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index a2a680ab..4b83df49 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -29,18 +29,21 @@ Create Entity Scenarios [Tags] e-create 5_6_1 [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${entity_id} ${response.headers} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} IF '${content_type}'=='application/json' - Retrieve Entity by Id ${entity_id} ${content_type} + ${response}= Retrieve Entity by Id ${entity_id} ${content_type} END IF '${content_type}'=='application/ld+json' - Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... ${content_type} + ... context=${ngsild_test_suite_context} END Check Created Resource Set To ${created_entity} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 061bdd72..1971ddbe 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -21,9 +21,9 @@ Create Entity With Invalid Request Scenarios [Documentation] Check that you cannot create an entity with an invalid request [Tags] e-create 5_6_1 [Arguments] ${filename} ${error_type} - Request Entity From File ${filename} - Check RL Response Status Code Set To 400 + ${response}= Request Entity From File ${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${error_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index c5dc1981..c100cba8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -17,18 +17,18 @@ Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Entity Selecting Content Type + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 409 ${response['status']} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index 3c5d816c..bfbca10a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -16,15 +16,15 @@ Create one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index 826c6940..4c44f76b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -16,11 +16,14 @@ Create one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} - Retrieve Entity by Id ${entity_id} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index 5b39952d..333b91ee 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -16,12 +16,12 @@ Create one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index 4e40f111..c2fda435 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -16,11 +16,11 @@ Create one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index 51efb05e..c2834df6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -16,12 +16,12 @@ Create one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index e48f067a..4c4940b6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -16,13 +16,13 @@ Create one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 1a5a555f..235d5953 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -15,12 +15,12 @@ Delete an entity [Documentation] Check that you can delete an entity by id [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... building-simple-attributes-sample.jsonld ... ${entity_id} ... application/ld+json - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code 204 ${response['status']} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index a3b5e073..62beb73d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -21,8 +21,8 @@ Delete Entity Scenarios [Tags] e-delete 5_6_6 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index fc9f8d10..d6b35cba 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -17,8 +17,8 @@ Delete an entity with an id not known to the system [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 345f90e0..5f2d95f2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -45,15 +45,18 @@ Append Attributes Without Params [Tags] ea-append 5_6_3 [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -62,26 +65,29 @@ Append Attributes With Params [Tags] ea-append 5_6_3 [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes With Parameters ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} ... noOverwrite - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} # ignore the reason for the not updated attribute as this detail is up to each context broker implementation IF "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ... ${expectation_response_body} - ... ${response['body']} + ... ${response.json()} ... root\\['notUpdated'\\]\\[0\\]\\['reason'\\] END ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 79a09e95..63d6fb86 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -31,34 +31,33 @@ Append Attributes [Tags] ea-append 5_6_3 [Arguments] ${entity_invalid_id} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Append Entity Attributes Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Append Entity Attributes ... ${entity_id} ... ${invalid_fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - ... ${EMPTY} - Check RL Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index caecdd7d..f363e0a3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -17,11 +17,12 @@ Append entity attributes when the entity id is not known to the system [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 3dd3b1ca..8e90be9d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -30,20 +30,23 @@ Delete Attributes [Tags] ea-delete 5_6_5 [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${datasetId} ... ${deleteAll} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 094b3eaa..5a665fbe 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -29,13 +29,13 @@ Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 [Arguments] ${entity_id} ${attribute_id} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 9d2c56c4..d41856d2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -31,17 +31,17 @@ Delete Attributes [Tags] ea-delete 5_6_5 [Arguments] ${entity_id} ${attribute_id} ${datasetId} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index e8117d22..f62936e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -27,19 +27,22 @@ Update Attributes [Tags] ea-partial-update 5_6_4 [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 2195665d..626ec9ba 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -33,21 +33,21 @@ Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index 5eda275e..cc3175e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -32,21 +32,21 @@ Partial Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${fragment_filename} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index af12e56b..9c1abaf8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -32,18 +32,21 @@ Update Attributes ... ${expectation_response_filename} ... ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} IF "${expectation_response_filename}"!="${EMPTY}" - Check Response Body Content ${expectation_response_filename} ${response['body']} + Check Response Body Content ${expectation_response_filename} ${response.json()} END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index c786688c..ba193571 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -35,17 +35,17 @@ Update Attributes [Tags] ea-update 5_6_2 [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} Update entity attributes with invalid entity fragments @@ -53,17 +53,16 @@ Update entity attributes with invalid entity fragments [Tags] ea-update 5_6_2 [Arguments] ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Update Entity Attributes Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Update Entity Attributes ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - ... ${EMPTY} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 4fed6327..2a355c98 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -16,12 +16,14 @@ Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 409b05be..d78353d6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -29,15 +29,15 @@ Create Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${content_type} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${created_temporal_entity}= Load Test Sample ... temporalEntities/${filename} ... ${temporal_entity_representation_id} IF '${content_type}'=='application/json' - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${response}= Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} END IF '${content_type}'=='application/ld+json' - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} END diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 53d97144..f90979e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -29,10 +29,10 @@ Create Temporal Entity From File [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id [Tags] te-create 5_6_11 [Arguments] ${filename} - Create Temporal Representation Of Entity Selecting Content Type Using Session + ${response}= Create Temporal Representation Of Entity Selecting Content Type ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} @@ -44,5 +44,5 @@ Create Temporal Entity ... ${entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index d03e8368..cd263d54 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -20,11 +20,11 @@ Delete a temporal representation of an entity with simple temporal properties ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Temporal Representation Of Entity With Returning Response ... ${temporal_entity_representation_id} - Check Response Status Code 204 ${response['status']} - Retrieve Temporal Representation Of Entity + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index c9c03003..f5208af7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -25,8 +25,8 @@ Delete Temporal Entity [Tags] te-delete 5_6_16 [Arguments] ${status_code} ${id} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 5f2a3cf7..95f5bf07 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -17,8 +17,8 @@ ${status_code}= 404 [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index c2042366..8e2dd36c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -22,16 +22,16 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${update_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 7331164d..b510e97a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -22,16 +22,16 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 3360b677..93e28938 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -37,12 +37,12 @@ Add an Attribute To a Temporal Entity From File ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Append Attribute To Temporal Entity Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${update_filename} ... ${CONTENT_TYPE_LD_JSON} - Check RL Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -56,7 +56,7 @@ Add Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 2f50f7ca..c1d3a16a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -22,11 +22,11 @@ Add Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Attribute To Temporal Entity ... ${not_found_temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 94a7fd93..88c24a25 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -34,7 +34,7 @@ Delete Attribute From A Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Attribute From Temporal Entity ... ${temporal_entity_representation_id} ... ${attribute_id} @@ -42,11 +42,11 @@ Delete Attribute From A Temporal Entity ... ${datasetId} ... ${deleteAll} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index f6d074b4..def7efd2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -36,11 +36,11 @@ Delete attribute from temporal entity with unknow entity/attribute id ... ${CONTENT_TYPE_JSON} ... ${EMPTY} ... false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -48,7 +48,7 @@ Create Temporal Entity ... ${valid_temporal_entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} Set Suite Variable ${valid_temporal_entity_id} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 918a4a95..7ae8d891 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -31,7 +31,7 @@ Delete Attribute ... ${valid_temporal_entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Attribute From Temporal Entity ... ${entity_id} ... ${attribute_id} @@ -39,11 +39,11 @@ Delete Attribute ... ${EMPTY} ... false ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} Create Id diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index ccfbb73a..ccdb46d9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -23,23 +23,23 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} ${response}= Delete Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} ... ${attributeId} ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 79f7aea0..6909b2a6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -40,7 +40,7 @@ Delete attribute instance ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -49,13 +49,13 @@ Create Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 59d1a523..8629a98d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -35,7 +35,7 @@ Delete Attribute Instance ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id @@ -45,7 +45,7 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity @@ -53,5 +53,5 @@ Create Id ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index 10f330e2..fc7f9636 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -25,13 +25,13 @@ ${attributeId}= speed ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_before_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId_before_update}= Set Variable ${response.json()['speed'][0]['instanceId']} ${response}= Modify Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} @@ -40,16 +40,16 @@ ${attributeId}= speed ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_after_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId_after_update}= Set Variable ${response.json()['speed'][0]['instanceId']} Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index 133be618..0fd7114a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -44,7 +44,7 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -53,13 +53,13 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 9c805e2d..0433ba9d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -38,7 +38,7 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -47,7 +47,7 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity @@ -55,7 +55,7 @@ Create Id ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 24f69dd4..e5e8f6de 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -17,9 +17,12 @@ Create Subscription [Documentation] Check that you can create a subscription [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index 6fdab2c6..ac0eefe6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -19,9 +19,9 @@ Create Subscription With Invalid Request [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 [Arguments] ${filename} ${expected_status} - Create Subscription From File ${filename} - Check RL Response Status Code Set To 400 + ${response}= Create Subscription From File ${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${expected_status} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index b2d0a297..906c79f2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -27,9 +27,9 @@ Create Subscription With Invalid/Empty Id ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index 6683c91b..379e27e8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -16,14 +16,17 @@ Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 409 ${response['status']} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 4c86e30a..eb799b7f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -18,9 +18,9 @@ InvalidId [Tags] sub-delete 5_8_5 Delete Subscription With Non present Or Invalid Id [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Delete Subscription ${id} - Check Response Status Code Set To 400 + ${response}= Delete Subscription ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index 930dbf02..d9f6c5b9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -9,9 +9,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-delete 5_8_5 - Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index f6ded38a..7a12cff9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -18,9 +18,9 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld Delete Subscription [Documentation] Check that you can delete a subscription [Tags] sub-delete 5_8_5 - Delete Subscription ${subscription_id} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Delete Subscription ${subscription_id} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index c366b8b6..371d868d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -32,7 +32,6 @@ Check that a notification is only sent if status is active ${notification}= Wait for notification timeout=${10} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] @@ -53,7 +52,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 0a9bc524..9459cae7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -28,10 +28,8 @@ Check that a notification is sent on the timeInterval Setup Initial Subscriptions ${notification}= Wait for notification timeout=${15} - Output ${notification} ${notification}= Wait for notification timeout=${15} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -65,7 +63,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index bef47b8a..9378e768 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -28,7 +28,6 @@ Check that a notification is sent with all entities Setup Initial Subscriptions ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -61,7 +60,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index bd71d44b..fa8745c9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -30,7 +30,6 @@ Check that a notification is sent with all entities Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -62,7 +61,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 83d3bcdb..15198461 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -30,7 +30,6 @@ Check that a notification is sent with all entities Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -63,7 +62,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index d47618f9..a0072675 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -28,8 +28,6 @@ Check that a notification is sent with all matching entities ... ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification timeout=${10} - - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] @@ -43,7 +41,7 @@ Setup Server And Subscriptions ... ${notification_server_send_url} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index a6c1e607..9bd99774 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -66,7 +66,6 @@ Check URI expansion is observed Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification - Output ${notification} Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -104,7 +103,7 @@ Delete Fixture Data Delete Initial Entity Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 0c52a261..33a1751c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -31,7 +31,6 @@ Check that a notification is sent with all attributes Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -64,7 +63,6 @@ Check that a notification is sent with all attributes in simplified format Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -101,7 +99,7 @@ Delete Fixture Data Delete Initial Entity Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 94f38d3f..588e9d48 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -48,7 +48,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 8b91cbdb..5b74fc30 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -59,7 +59,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 3867b044..d9d7b847 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -34,13 +34,13 @@ Check that timesSent is increased by one Wait for notification timeout=${10} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Dictionary Should Contain Key ${response}[body][notification] timesSent - Should Be Equal ${1} ${response}[body][notification][timesSent] + Dictionary Should Contain Key ${response.json()}[notification] timesSent + Should Be Equal ${1} ${response.json()}[notification][timesSent] *** Keywords *** @@ -58,7 +58,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 44160ead..9a7ecead 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -32,13 +32,12 @@ Check that lastNotification is updated Wait for notification timeout=${10} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From JSON ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status Should Be Equal ok ${notification_info}[0][status] @@ -69,7 +68,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index d3e13671..1cb6c606 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -29,13 +29,12 @@ Check that lastFailure and status are updated if a notification could not be sen Sleep 10s - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status Should Be Equal failed ${notification_info}[0][status] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index b4601190..dcb7ec3d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -58,7 +58,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index 124aac46..757768a1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -21,12 +21,12 @@ ${expectation_file_path}= subscriptions/expectations/subsc Query Subscriptions [Documentation] Check that you can query a list of subscriptions [Tags] sub-query 5_8_4 - Query Subscriptions context=${ngsild_test_suite_context} + ${response}= Query Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ... ${first_subscription_id} ... ${second_subscription_id} ... ${third_subscription_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 3cd655f2..c8c763a1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -33,12 +33,12 @@ Query All Subscriptions Query Subscriptions With Limit And Page Parameters [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} - Query Subscriptions + ${response}= Query Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} ... offset=${offset} ... accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 5527f34a..8159de2e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -16,9 +16,9 @@ InvalidId [Tags] sub-retrieve 5_8_3 Retrieve Subscription With Non present Or Invalid Id [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Retrieve Subscription ${id} - Check Response Status Code Set To 400 + ${response}= Retrieve Subscription ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 07f3e914..438aafe4 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -9,9 +9,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-retrieve 5_8_3 - Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 95f09088..9cfdf7c1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -19,8 +19,8 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions Retrieve Subscription [Documentation] Check that you can retrieve a subscription [Tags] sub-retrieve 5_8_3 - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index b3e29e80..4f2e1a3e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -23,9 +23,9 @@ InvalidId [Tags] sub-update 5_8_2 Update Subscription With Non present Or Invalid Id [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 6f036a32..a4ad298f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -14,12 +14,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... urn:ngsi-ld:Subscription:unknowSubscription ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index de3acfcb..7175df75 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With Invalid Fragment [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index 86093c7c..94a2b507 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With Null Mandatory Properties [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index c9c78770..3c571964 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -21,17 +21,17 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio Update Subscription With Term to Uri Expansion [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... ${subscription_id} ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Body Containing Subscription element ... ${expected_subscription_payload_file_path} ... ${subscription_id} - Retrieve Subscription ${subscription_id} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing Subscription element ... ${expected_expanded_subscription_payload_file_path} ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 0208b267..a3fcfb84 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -19,15 +19,15 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... ${subscription_id} ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 204 + Check Response Status Code 204 ${response.status_code} ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index af036480..9c8ef145 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -24,9 +24,12 @@ ActiveTrue [Tags] sub-update 5_8_2 Activate Paused Subscription With isActive Member [Documentation] Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" [Arguments] ${subscription_update_fragment_file_path} - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index fa850b10..9f07d0e5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -25,9 +25,12 @@ ActiveTrueExpiresAt Activate Paused Subscription With isActive And ExpiresAt Members [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" [Arguments] ${subscription_update_fragment_file_path} - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 20d49129..3b2b8fc6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -19,9 +19,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription Status To Paused [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 1d09768a..a82c2089 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -25,11 +25,17 @@ Activate Expired Subscription ${update_template_fragment}= Load JSON From File ... ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json ${update_fragment}= Update Value To JSON ${update_template_fragment} $..expiresAt ${in_5_seconds} - Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} + ${response}= Update Subscription With Payload + ... ${subscription_id} + ... ${update_fragment} + ... ${CONTENT_TYPE_JSON} Sleep 10s - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 5540ede2..64d5c3d0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With ExpiresAt In The Past [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 69c9629e..a87d5cdb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -18,10 +18,9 @@ Create Context Source Registration With Specific Date Expiration Date ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index d996cff6..29a3e5ef 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -18,10 +18,10 @@ Create Context Source Registration That Never Expires ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 11abfe09..611e8a09 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -16,11 +16,11 @@ Create Context Source Registration Without A Sprecified ID [Documentation] Check that you can create a context source registration without specifying an ID [Tags] csr-create ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${request} ${response}= Create Context Source Registration With Return ${payload} - Check Response Status Code 201 ${response['status']} - ${registration_id}= Check Response Headers ID Not Empty ${response} + ${response}= Create Context Source Registration With Return ${payload} + Check Response Status Code 201 ${response.status_code} + ${registration_id}= Check Response Headers ID Not Empty ${response.headers} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - Retrieve Context Source Registration + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 92f24839..7e0055ca 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -32,19 +32,18 @@ Create Context Source With Invalid Content ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 400 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 400 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${response}= Create Context Source Registration Using Session + ${response}= Create Context Source Registration ... ${registration_payload_file_path} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} + Check Response Status Code ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 8f0667b5..a035d142 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -18,9 +18,9 @@ Create a context source registration that already exists ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 409 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index bc2c7303..d820ecaf 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -18,14 +18,14 @@ Create one context source registration using a provided Link header with JSON co ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index bf8c0eaa..cbb25fc5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -18,12 +18,12 @@ Create one context source registration using the default context with JSON conte ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index 78a6639b..ad381cc9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -18,11 +18,11 @@ Create one context source registration containing a JSON-LD @context with a JSON ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index dcbb5536..98ce13ab 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -18,13 +18,13 @@ Create one context source registration using a JSON-LD @context obtained from th ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index 6a305cd1..92bf6de3 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -18,11 +18,11 @@ Create one context source registration not containing a JSON-LD @context with a ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index 90b94a8e..76b18cfd 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -18,12 +18,12 @@ Create one context source registration with a Link header and a JSON-LD content ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index b16395d0..1572d996 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -18,9 +18,9 @@ Delete a context source registration by id ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index c6a0411b..67753a4d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -28,9 +28,9 @@ Delete Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index a6ef7d32..86205978 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -17,5 +17,5 @@ Delete a context source registration by id [Tags] csr-delete ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 404 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 09b5854a..785cab26 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -33,10 +33,10 @@ Query Context Source Registration ... ${query_param_value} ... ${expectation_file_path} ... @{expected_context_source_registration_ids} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 86577045..2a442f88 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Query Context Source Registrations Without Entity Types and Attribute Names [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index 9b0e6584..a4af8532 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -24,11 +24,11 @@ Invalid Temporal Query Query Context Source Registration With Invalid Query Param [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid [Arguments] ${query_param_name} ${query_param_value} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index b6be3201..25864bcb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -19,9 +19,9 @@ ${expectation_file_path}= csourceRegistrations/exp Query Context Source Registrations Without Context [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context [Tags] csr-query 5_10_2 - Query Context Source Registrations id=${context_source_registration_id} + ${response}= Query Context Source Registrations id=${context_source_registration_id} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index a272c716..b4e1c5d2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -29,11 +29,14 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo ${context_source_registration_payload}= Load Test Sample ... ${registration_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name + ${response}= Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... attrs=name @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 0820e838..7c8a00c3 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -28,9 +28,12 @@ Query Without Properties And Relationships Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo [Documentation] Check that you can query context source registrations matching property and relationship names of RegistrationInfo [Arguments] ${attrs_value} ${expectation_file_path} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} + ${response}= Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... attrs=${attrs_value} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 9a11fd2c..49492e94 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -27,7 +27,7 @@ Within Polygon [Tags] csr-query 5_10_2 Query Context Source Registration Matching Geoquery [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... georel=${georel} @@ -35,7 +35,7 @@ Query Context Source Registration Matching Geoquery ... coordinates=${coordinates} ... geoproperty=${geoproperty} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index 2300feb7..39a33d5a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -19,9 +19,9 @@ ${expectation_file_path}= csourceRegistrations/exp Query Context Source Registration Without Temporal Query [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building + ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} type=Building @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index 29718acb..1173a309 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -39,16 +39,16 @@ Query Context Source Registration Matching Temporal Query ${context_source_registration_payload}= Load Test Sample ... ${payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... timeproperty=${timeproperty} ... timerel=before ... timeAt=2021-08-01T22:00:00Z @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index b35280c7..f8e8711c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -37,10 +37,10 @@ Query Context Source Registration With Query Params ... ${query_param_value} ... ${expectation_file_path} ... @{expected_context_source_registration_ids} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index 536e6f29..e85b7ac9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -33,12 +33,12 @@ Query All Subscriptions Query Context Source Registration With Limit And Page Parameters [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... limit=${limit} ... page=${page} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 3794117d..9d34f7ae 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -19,9 +19,9 @@ Invalid Id [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration With A Not Present Or Invalid Id [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI [Arguments] ${id} - Retrieve Context Source Registration ${id} - Check Response Status Code Set To 400 + ${response}= Retrieve Context Source Registration ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index a2d3a3dc..8f23c64c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Unknown Context Source Registration [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration - Check Response Status Code Set To 404 + ${response}= Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 0d3f3d52..53055cb1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -19,8 +19,8 @@ ${expectation_file_path}= csourceRegistrations/exp Retrieve Context Source Registration With Default Core Context [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration ${context_source_registration_id} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration ${context_source_registration_id} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 7e0772f6..1a1f6757 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -19,8 +19,10 @@ ${expectation_file_path}= csourceRegistrations/exp Retrieve Context Source Registration [Documentation] Check that you can retrieve a Context Source Registration [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration + ... ${context_source_registration_id} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 867c92fc..03d9fed5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -30,8 +30,8 @@ CreationTimeJsonLdContext Check JSON-LD resolution when retrieving a context source registration [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} - Retrieve Context Source Registration ${context_source_registration_id} context=${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration ${context_source_registration_id} context=${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expected_payload} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index c0db5c40..7ddf9977 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -27,16 +27,16 @@ Update Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${registration_update_fragment} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index bd157e83..c96af787 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -40,16 +40,16 @@ Update Context Source [Arguments] ${registration_id} ${fragment_filename} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${valid_registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${valid_registration_id} Update a context source registration if the request body is invalid @@ -58,13 +58,12 @@ Update a context source registration if the request body is invalid ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${response}= Update Context Source Registration Using Session + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Update Context Source Registration ... ${registration_id} ... ${registration_payload_file_path} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} + Check Response Status Code ${response.json()} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index f9f7a674..89d5e80b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -22,6 +22,6 @@ Update a context source registration by id if the id is not known to the system ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 404 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 3fb74d28..9dcaaa19 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -19,10 +19,10 @@ Create Context Source Registration Subscription [Documentation] Check that you can create a minimal context source registration subscription [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve Context Source Registration Subscription + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 210f79f9..7acfe0ef 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -18,12 +18,12 @@ Create Context Source Registration Subscription Without An Id [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} ${subscription_id}= Fetch Id From Response Location Header - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Set Suite Variable ${subscription_id} - Retrieve Context Source Registration Subscription + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index b6eab9b2..131e2dec 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -19,10 +19,10 @@ Create Context Source Registration Subscription Without isActive Member [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index dbcfbc4c..da1e0f8e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -19,10 +19,10 @@ Create Inactive Context Source Registration Subscription [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 1c62b9ba..6b560383 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -22,11 +22,11 @@ Create Context Source Registration Subscription With expiresAt Member ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} ${subscription_payload}= Update Value To JSON ${subscription_payload_sample} $..expiresAt ${expiresAt} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Sleep 15s - Retrieve context source registration subscription ${subscription_id} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status expired diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index 9b4e70a6..c719246c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -19,12 +19,12 @@ Create Context Source Registration Subscription Without expiresAt Member [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough Sleep 10s - Retrieve context source registration subscription ${subscription_id} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 544a9785..e930111c 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -19,12 +19,13 @@ Create Existing Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 409 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index d9d8adee..eb0ea2fb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -32,9 +32,9 @@ Create Invalid Context Source Registration Subscription [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 400 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 918cfcbd..6474108d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -17,9 +17,9 @@ Create Expired Context Source Registration Subscription [Tags] csrsub-create 5_11_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 400 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index e28f93e1..6a605539 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -17,9 +17,11 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Delete Context Source Registration Subscription [Documentation] Check that you can delete a context source registration subscription [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription ${subscription_id} - Check Response Status Code Set To 204 - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + ${response}= Delete Context Source Registration Subscription ${subscription_id} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index e5b30eae..87bb7e26 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Delete Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription invalidUri - Check Response Status Code Set To 400 + ${response}= Delete Context Source Registration Subscription invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index ff640433..5b2a24bb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Delete Unknown Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete an unknown context source registration subscription [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index fc647951..feaf4e57 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -26,7 +26,7 @@ Receive cSourceNotification Periodically And Initially On Subscription ... ${subscription_payload_file_path} ... ${subscription_id} Set Suite Variable ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Wait for notification # Wait for 15 seconds to check if another notification was sent Wait for notification timeout=${15} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index e806af3e..3c4532d9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -27,14 +27,14 @@ Receive cSourceNotification Initially On Subscription And Whenever There Is A Ch ... ${subscription_payload_file_path} ... ${subscription_id} Set Suite Variable ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} ... ${expected_context_source_registration_ids} ... newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} Wait for notification and validate it ... ${subscription_id} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 03b3d264..cded0e4b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -26,7 +26,7 @@ Receive cSourceNotification With Relevant Information ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} @{expected_notification_data_entities}= Create List Building Wait for notification and validate it diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index 0256572c..007a80c4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -26,7 +26,7 @@ Receive cSourceNotification With Compliant Structure ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index f2647ddd..71cc885d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -27,9 +27,9 @@ If A cSourceNotification Is Successfully Sent The Notification Member Shall Be U ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for notification - Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastSuccess Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index 839a6d0b..7e321bf0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -27,9 +27,9 @@ If A cSourceNotification Is Not Successfully Sent The Notification Member Shall ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification - Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index dbf64473..b0064666 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -32,13 +32,15 @@ Do Not Receive cSourceNotification If Subscription Status Is Not Active [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index 0621ea7e..87d358eb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -23,7 +23,7 @@ Receive cSourceNotification For Matching Context Source Registrations Providing [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index 8cbac3c7..c860c849 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -23,7 +23,7 @@ Receive cSourceNotification For No Longer Matching Context Source Registrations [Documentation] Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 0e040ee8..d347b1f7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Observa ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index 92b1867b..e2c586b4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -30,14 +30,14 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index fd6c74f1..0f858143 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Watched ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index 16272e2b..54d47f03 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Any wat ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index dd53acce..0ec48479 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Locatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index a20cef11..2da0eebd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Locatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index 2677278d..e680609d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -36,7 +36,9 @@ Receive cSourceNotification For Newly Matching Context Source Registrations [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations [Arguments] ${filepath} @{notification_csr_ids} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching Setup Initial Context Source Registrations And Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 2bc98649..d245dd81 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -20,9 +20,9 @@ ${expectation_file_path}= csourceSubscriptions/expectation Query Context Source Registration Subscriptions [Documentation] Check that you can query context source registration subscriptions [Tags] csrsub-query 5_11_5 - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} + ${response}= Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index f2bf0a32..1d1331d6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -34,8 +34,10 @@ Query All Subscriptions Query Context Source Registration Subscriptions With Limit Parameter [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved [Arguments] ${limit} ${expectation_subscription_number} - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} - Check Response Status Code Set To 200 + ${response}= Query Context Source Registration Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index be5675b3..5cbac889 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -33,11 +33,11 @@ Query All Subscriptions Query Context Source Registration Subscriptions With Limit And Page Parameters [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} - Query Context Source Registration Subscriptions + ${response}= Query Context Source Registration Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} ... page=${page} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index f4a172f6..5391ec10 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -22,9 +22,9 @@ Invalid Limit And Page Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters [Arguments] ${limit} ${page} - Query Context Source Registration Subscriptions limit=${limit} page=${page} - Check Response Status Code Set To 400 + ${response}= Query Context Source Registration Subscriptions limit=${limit} page=${page} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index ba1d842b..4990c31b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -19,8 +19,10 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr Retrieve Context Source Registration Subscription [Documentation] Check that you can retrieve a context source registration subscription [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index 8e4a6855..0387b7e8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Context Source Registration Subscription With An Invalid Id [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription invalidUri - Check Response Status Code Set To 400 + ${response}= Retrieve Context Source Registration Subscription invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index fb7d52ce..f25b20eb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Unknown Context Source Registration Subscription [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 9035fcaa..d3b9d6df 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -20,10 +20,12 @@ Update Context Source Registration Subscription [Documentation] Check that you can update a context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - Check Response Status Code Set To 204 + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} + Check Response Status Code 204 ${response.status_code} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Context Source Registration Subscription + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 32ba76ba..47c31636 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -15,9 +15,9 @@ Update Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot update a context source registration subscription with an invalid URI [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} - Check Response Status Code Set To 400 + ${response}= Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index 024b5593..e7617f1d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -15,11 +15,11 @@ Update Unknown Context Source Registration Subscription [Documentation] Check that you cannot update an unknown context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription + ${response}= Update Context Source Registration Subscription ... urn:ngsi-ld:Subscription:unknowSubscription ... ${subscription_update_fragment} - Check Response Status Code Set To 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index cc767440..9d21c33a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -28,17 +28,19 @@ Update Context Source Registration Subscription With Invalid Fragment [Documentation] Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - Check Response Status Code Set To 400 + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index 7d184f53..1a212652 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -19,14 +19,15 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s Update Context Source Registration Subscription With Invalid JSON Fragment [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) [Tags] csrsub-update 5_11_3 - Update Context Source Registration Subscription From File + ${response}= Update Context Source Registration Subscription From File ... ${subscription_id} ... ${subscription_update_fragment_file_path} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_INVALID_REQUEST} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/libraries/logUtils.py b/libraries/logUtils.py new file mode 100644 index 00000000..1de30abe --- /dev/null +++ b/libraries/logUtils.py @@ -0,0 +1,48 @@ +from __future__ import unicode_literals +from __future__ import division +from pygments import highlight, lexers, formatters +from json import dumps, JSONDecodeError, loads +from robot.api import logger +from robot.api.deco import keyword + + +@keyword(name="Output", tags=("I/O",)) +def output(response, console=True): + """*Request and response are output to terminal and file (in JSON).* + ``console``: If false, the JSON is not written to terminal. Default is true. + """ + + try: + if response.request.body is None: + request_body = response.request.body + else: + request_body = loads(response.request.body) + except JSONDecodeError: + request_body = response.request.body + + try: + response_body = response.json() + except JSONDecodeError: + response_body = None + + request_json = {'method': response.request.method, 'url': response.request.url, + 'headers': dict(response.request.headers), 'body': request_body} + response_json = {'url': response.url, 'headers': dict(response.headers), 'status_code': response.status_code, + 'reason': response.reason, 'body': response_body} + + pretty_request_json = dumps(request_json, indent=4, sort_keys=False, separators=(",", ": ")) + pretty_response_json = dumps(response_json, indent=4, sort_keys=False, separators=(",", ": ")) + + logger.info(pretty_request_json) + logger.info(pretty_response_json) + + if console: + pretty_request_json_colored = highlight( + pretty_request_json, lexers.JsonLexer(), formatters.TerminalFormatter() + ) + pretty_response_json_colored = highlight( + pretty_response_json, lexers.JsonLexer(), formatters.TerminalFormatter() + ) + + logger.console(pretty_request_json_colored) + logger.console(pretty_response_json_colored) diff --git a/requirements.txt b/requirements.txt index b20e1673..f6f16821 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,7 @@ # python3.10 project robotframework==6.0.2 -RESTinstance==1.3.0 -robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.5 robotframework-requests==0.9.4 deepdiff==6.3.0 robotframework-httpctrl==0.3.1 -robotframework-metrics==3.3.1 robotframework-tidy==4.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ef33eadb..863b2536 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -1,6 +1,6 @@ *** Settings *** Variables ./variables.py -Library REST ${url} +Library ${EXECDIR}/libraries/logUtils.py Library RequestsLibrary Library OperatingSystem Library Collections @@ -43,16 +43,15 @@ ${response} ${EMPTY} *** Keywords *** Delete Entity by Id Returning Response [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any + Output ${response} RETURN ${response} Delete Entity by Id [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any + Output ${response} + RETURN ${response} Query Entity [Arguments] @@ -83,11 +82,14 @@ Query Entity Set To Dictionary ${params} options=${options} END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} - ${request}= Output request - Output response + ${response}= GET + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} - RETURN ${request} ${response} + Output ${response} + RETURN ${response} Query Entities [Arguments] @@ -143,10 +145,13 @@ Query Entities Set To Dictionary ${params} geometry=${geometry} END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= GET + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Query Entities Via POST @@ -176,9 +181,12 @@ Query Entities Via POST IF '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} END - ${response}= REST.POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} + ... json=${params} + ... headers=${headers} + ... expected_status=any + Output ${response} RETURN ${response} Retrieve Entity by Id @@ -190,10 +198,10 @@ Retrieve Entity by Id ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} - Output request - Output response + ${response}= GET url=${url}/${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Entity Selecting Content Type [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -208,73 +216,48 @@ Create Entity Selecting Content Type ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... json=${entity} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Append Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... body=${fragment_payload} + ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... data=${file_content} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Append Entity Attributes With Parameters [Arguments] ${id} ${fragment_filename} ${content_type} ${options} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} - ... body=${fragment_payload} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} -Append Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} - ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${filename} - Create Session OneRequest ${url} +Update Entity Attributes + [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... params=options=${options} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Set Test Variable ${response} - -Update Entity Attributes Using Session - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ${response}= PATCH + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} - Set Test Variable ${response} - -Update Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... body=${fragment_payload} - ... headers=${headers} - Output request - Output response + Output ${response} RETURN ${response} Delete Entity Attributes @@ -293,11 +276,11 @@ Delete Entity Attributes Append To List ${params} deleteAll=${deleteAll} END ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE - ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} + ${response}= DELETE + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Partial Update Entity Attributes @@ -318,12 +301,12 @@ Partial Update Entity Attributes ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH - ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} - ... body=${fragment_payload} + ${response}= PATCH + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Retrieve Entity Types @@ -340,11 +323,14 @@ Retrieve Entity Types ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END IF ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/ + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Entity Type [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -358,11 +344,13 @@ Retrieve Entity Type ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - + ${response}= GET + ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Attributes [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} @@ -378,11 +366,14 @@ Retrieve Attributes ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END IF ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Attribute [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -396,11 +387,13 @@ Retrieve Attribute ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - + ${response}= GET + ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Context Source Registration With Return [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -413,57 +406,32 @@ Create Context Source Registration With Return ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} - ${request}= Output request - Output response - RETURN ${request} ${response} - -Create Context Source Registration Using Session - [Arguments] ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... data=${file_content} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... json=${payload} ... headers=${headers} ... expected_status=any - Output ${response.json()} + Output ${response} RETURN ${response} Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... body=${fragment} - ... headers=${headers} - ${request}= Output request - Output response - RETURN ${response} - -Update Context Source Registration Using Session - [Arguments] ${registration_id} ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session - ... OneRequest - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... data=${file_content} + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... json=${fragment} ... headers=${headers} ... expected_status=any - Output request - Output response + Output ${response} RETURN ${response} Delete Context Source Registration With Return [Arguments] ${registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... expected_status=any + Output ${response} RETURN ${response} Create Entity @@ -471,9 +439,13 @@ Create Entity ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... json=${entity} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Create Or Update Temporal Representation Of Entity Selecting Content Type [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} @@ -486,54 +458,37 @@ Create Or Update Temporal Representation Of Entity Selecting Content Type IF '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ - ... body=${temporal_entity_representation} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ + ... json=${temporal_entity_representation} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} -Create Temporal Representation Of Entity Selecting Content Type Using Session +Create Temporal Representation Of Entity Selecting Content Type [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} - Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} Set Test Variable ${response} + Output ${response} RETURN ${response} Append Attribute To Temporal Entity [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs - ... body=${fragment_payload} - ... headers=${headers} - Output request - Output response - RETURN ${response} - -Append Attribute To Temporal Entity Using Session - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} - Set Test Variable ${response} + Output ${response} RETURN ${response} Modify Attribute Instance From Temporal Entity @@ -551,12 +506,12 @@ Modify Attribute Instance From Temporal Entity ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.PATCH - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} - ... body=${fragment_payload} + ${response}= PATCH + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Delete Attribute From Temporal Entity @@ -581,26 +536,21 @@ Delete Attribute From Temporal Entity Append To List ${params} deleteAll=${deleteAll} END ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Delete Temporal Representation Of Entity With Returning Response [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... expected_status=any + Output ${response} RETURN ${response} -Delete Several Temporal Representations Of Entities - [Arguments] @{temporal_entity_representation_ids} - FOR ${temporal_entity_representation_id} IN @{temporal_entity_representation_ids} - Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} - END - Get Temporal Representation Of Entity [Arguments] ... ${temporal_entity_representation_id} @@ -621,12 +571,12 @@ Get Temporal Representation Of Entity IF ${options_length}>0 Set To Dictionary ${params} options=${options} END - ${response}= REST.GET - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... headers=${headers} - ... query=${params} - Output request - Output response + ... params=${params} + ... expected_status=any + Output ${response} RETURN ${response} Delete Attribute Instance From Temporal Entity @@ -637,11 +587,11 @@ Delete Attribute Instance From Temporal Entity ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.DELETE - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Update Temporal Representation Of Entity Selecting Content Type @@ -654,12 +604,12 @@ Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_fragment}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.PATCH - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} - ... body=${temporal_entity_fragment} + ${response}= PATCH + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} + ... json=${temporal_entity_fragment} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Batch Create Entities @@ -678,70 +628,77 @@ Batch Create Entities ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${BATCH_CREATE_ENDPOINT_PATH} + ... json=@{entities_to_be_created} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Upsert Entities [Arguments] @{entities_to_be_upserted} ${update_option}=replace &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} - ... body=@{entities_to_be_upserted} + ${response}= POST + ... url=${url}/${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... json=@{entities_to_be_upserted} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Update Entities [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} - ... body=@{entities_to_be_updated} + ${response}= POST + ... url=${url}/${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... json=@{entities_to_be_updated} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_DELETE_ENDPOINT_PATH} - ... body=@{entities_ids_to_be_deleted} + ${response}= POST + ... url=${url}/${BATCH_DELETE_ENDPOINT_PATH} + ... json=@{entities_ids_to_be_deleted} ... headers=${headers} - Output request - Output response + ... expected_status=any IF not ${teardown} Set Test Variable ${response} + Output ${response} + RETURN ${response} Request Entity From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Request Entities From File [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} - Create Session BatchRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... BatchRequest - ... ${endpoint_url} + ${response}= POST + ... url=${url}/${endpoint_url} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Temporal Representation Of Entity [Arguments] ${filename} ${temporal_entity_representation_id} @@ -752,12 +709,13 @@ Create Temporal Representation Of Entity ... ${temporal_entity_representation_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... body=${temporal_entity_representation} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... json=${temporal_entity_representation} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} + RETURN ${response} Retrieve Temporal Representation Of Entity [Arguments] @@ -794,13 +752,14 @@ Retrieve Temporal Representation Of Entity END IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - ${response}= REST.GET - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... headers=${headers} - ... query=${params} - Output request - Output response + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities [Arguments] @@ -862,10 +821,14 @@ Query Temporal Representation Of Entities END IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities Via Post [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} @@ -875,45 +838,47 @@ Query Temporal Representation Of Entities Via Post ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${query_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${query_file_name} - ${response}= REST.POST - ... ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query - ... body=${query_payload} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query + ... json=${query_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... expected_status=any + Output ${response} + RETURN ${response} Create Context Source Registration [Arguments] ${context_source_registration_payload} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... body=${context_source_registration_payload} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... json=${context_source_registration_payload} ... headers=${headers} - ${request}= Output request - Output response - - Set Suite Variable ${request} + ... expected_status=any Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration [Arguments] ${context_source_registration_id} ${update_fragment} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - ... body=${update_fragment} - Output request - Output response - + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... json=${update_fragment} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Context Source Registrations [Arguments] @@ -932,6 +897,7 @@ Query Context Source Registrations ... ${timeAt}=${EMPTY} ... ${limit}=${EMPTY} ... ${page}=${EMPTY} + ... ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -966,20 +932,22 @@ Query Context Source Registrations IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Context Source Registration [Arguments] ${context_source_registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output request - Output response - + ${response}= DELETE url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} Set Suite Variable ${response} + Output ${response} + RETURN ${response} Retrieve Context Source Registration [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -991,13 +959,13 @@ Retrieve Context Source Registration ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... headers=${headers} - Output request - Output response - + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Context Source Registration Subscription [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} @@ -1006,26 +974,25 @@ Create Context Source Registration Subscription IF '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... body=${subscription_payload} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription_payload} ... headers=${headers} - ${request}= Output request - Output response - - Set Suite Variable ${request} + ... expected_status=any Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration Subscription [Arguments] ${subscription_id} ${subscription_update_fragment} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... body=${subscription_update_fragment} - Output request - Output response - + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... json=${subscription_update_fragment} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Context Source Registration Subscription [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} @@ -1037,13 +1004,13 @@ Retrieve Context Source Registration Subscription ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... headers=${headers} - Output request - Output response - + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Context Source Registration Subscriptions [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} @@ -1059,34 +1026,33 @@ Query Context Source Registration Subscriptions IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} ... headers=${headers} - ... query=${params} - Output request - Output response - + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Context Source Registration Subscription [Arguments] ${subscription_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output request - Output response - + ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration Subscription From File [Arguments] ${subscription_id} ${file_path} ${file_content}= Get File ${EXECDIR}/data/${file_path} - Create Session CsrsUpdateRequest ${url} - ${response}= PATCH On Session - ... CsrsUpdateRequest - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... data=${file_content} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Subscription [Arguments] @@ -1106,9 +1072,12 @@ Create Subscription END ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription} + ... headers=${headers} + ... expected_status=any + Output ${response} RETURN ${response} Create Subscription From Subscription Payload @@ -1126,22 +1095,26 @@ Create Subscription From Subscription Payload ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription_payload} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Create Subscription From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} - Create Session SubscriptionCreateRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... SubscriptionCreateRequest - ... ${SUBSCRIPTION_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Update Subscription [Arguments] @@ -1160,13 +1133,13 @@ Update Subscription ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${subscription_update_fragment}= Load JSON From File ${EXECDIR}/data/${fragment_filename} - ${response}= REST.PATCH - ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... body=${subscription_update_fragment} + ${response}= PATCH + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... json=${subscription_update_fragment} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Update Subscription With Payload @@ -1180,21 +1153,20 @@ Update Subscription With Payload ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.PATCH - ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... body=${payload} + ${response}= PATCH + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... json=${payload} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Delete Subscription [Arguments] ${subscription_id} - ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - Output request - Output response + ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any Set Suite Variable ${response} + Output ${response} RETURN ${response} Query Subscriptions @@ -1213,11 +1185,14 @@ Query Subscriptions Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Subscription [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} @@ -1232,117 +1207,10 @@ Retrieve Subscription ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} - ${request}= Output request - Output response + ${response}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any Set Test Variable ${response} - RETURN ${request} ${response} - -Update Context Source Registration Subscription By Selecting Content Type - [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... body=${subscription_update_fragment} - ... headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Entity Types With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Entity Type With Return - [Arguments] ${type} ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Attributes With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Attribute With Return - [Arguments] ${attribute_name} ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - RETURN ${response} - -Create Context Source Registration Subscription With Return - [Arguments] ${subscription_payload} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... body=${subscription_payload} - ... headers=${headers} - ${request}= Output request Output ${response} - RETURN ${request} ${response} - -Batch Upsert Entities By Selecting Content Type - [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} - ... body=@{entities_to_be_upserted} - ... headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Batch Update Entities By Selecting Content Type - [Arguments] - ... @{entities_to_be_updated} - ... ${content_type}=${CONTENT_TYPE_LD_JSON} - ... ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} - ... body=@{entities_to_be_updated} - ... headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Batch Delete Entities By Selecting Content Type - [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_DELETE_ENDPOINT_PATH} - ... body=@{entities_ids_to_be_deleted} - ... headers=${headers} - Output request - Output response - IF not ${teardown} Set Test Variable ${response} - Set Test Variable ${response} + RETURN ${response} Query Context Source Registrations With Return [Arguments] @@ -1396,10 +1264,13 @@ Query Context Source Registrations With Return IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities With Return [Arguments] @@ -1461,7 +1332,10 @@ Query Temporal Representation Of Entities With Return END IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any + Output ${response} + RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 13fe117f..8692bdca 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -3,7 +3,6 @@ Library ${EXECDIR}/libraries/assertionUtils.py Library RequestsLibrary Library Collections Library JSONLibrary -Library REST Library String @@ -23,24 +22,22 @@ Check Response Status Code Should Be Equal ${expected_status_code} ${response_status_code} Check Response Status Code Set To - [Arguments] ${expected_status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${expected_status} + [Arguments] ${expected_status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${expected_status} Check RL Response Status Code Set To - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} - Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True + Lists Should Be Equal ${expected_entities_ids} ${response.json()} ignore_order=True Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} - Output ${response_body} - Output ${entity_payload} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_payload} ... ${response_body} @@ -49,28 +46,22 @@ Check Response Body Content Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} - Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + Should Be Equal ${response['Content-Type']} ${expected_content_type_content} Check Response Headers Link Not Empty [Arguments] ${response} - Should Not Be Empty ${response['headers']['Link']} + Should Not Be Empty ${response['Link']} # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to - [Arguments] ${expected_path} ${expected_entity_id} ${response} + [Arguments] ${expected_entity_id} ${response} - IF 'Location' in ${response['headers']} - Should Be Equal - ... ${expected_path}${expected_entity_id} - ... ${response['headers']['Location']} - ... ignore_order=True - END - IF 'location' in ${response['headers']} - Should Be Equal - ... ${expected_path}${expected_entity_id} - ... ${response['headers']['location']} + IF 'Location' in ${response} + Should Contain + ... ${response['Location']} + ... ${expected_entity_id} ... ignore_order=True END @@ -81,34 +72,29 @@ Check Response Headers ID Not Empty [Arguments] ${response} ${location_header}= Set Variable If - ... 'Location' in ${response['headers']} - ... ${response['headers']['Location']} - ... ${response['headers']['location']} + ... 'Location' in ${response} + ... ${response['Location']} ${id}= Fetch From Right ${location_header} / Should Not Be Empty ${id} RETURN ${id} Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} - Should Not Be Empty ${response['body']['${expected_attribute_name}']} + Should Not Be Empty ${response.json()['${expected_attribute_name}']} IF '${expected_attribute_value}'!='' - Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + Should Be Equal ${response.json()['${expected_attribute_name}']} ${expected_attribute_value} END -Check Response Body Details Containing Information Error - [Arguments] ${expected_error_message} - Should be Equal ${expected_error_message} ${response['body']['details']} - Check Response Body Containing Batch Operation Result [Arguments] ${expected_batch_operation_result} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors - @{response_errors}= Get From Dictionary ${response['body']} errors + @{response_errors}= Get From Dictionary ${response.json()} errors ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} ${response_errors_length}= Get Length ${response_errors} - Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True + Lists Should Be Equal ${expected_successful_entities_ids} ${response.json()['success']} ignore_order=True Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} FOR ${response_error} IN @{response_errors} List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} @@ -160,7 +146,7 @@ Check Response Body Containing EntityTemporal element ... ${temporal_entity_representation_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entity_representation} - ... ${response['body']} + ... ${response.json()} ... ${instance_id_regex_expr} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -178,7 +164,7 @@ Check Response Body Containing List Containing EntityTemporal elements END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entities_representation_payload} - ... ${response['body']} + ... ${response.json()} ... ${instance_id_regex_expr} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -190,7 +176,7 @@ Check Response Body Containing Subscription element ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -208,7 +194,7 @@ Check Response Body Containing List Containing Subscription elements ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -218,20 +204,23 @@ Check Response Body Containing List Containing Subscription elements Check Response Body Containing Number Of Entities [Arguments] ${expected_entity_type} ${expected_length} - ${response_body_length}= Get Length ${response['body']} - ${is_list}= Run Keyword Evaluate type(${response['body']})==list + ${response_body_length}= Get Length ${response.json()} + ${is_list}= Run Keyword Evaluate type(${response.json()})==list IF ${is_list} Should Be Equal ${response_body_length} ${expected_length} + ELSE + Should Be Equal ${1} ${expected_length} END - Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} FOR ${index} IN RANGE ${expected_length} IF ${is_list} - Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + Should Be Equal ${response.json()[${index}]['type']} ${expected_entity_type} END END - Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} + IF ${is_list} is ${FALSE} + Should Be Equal ${response.json()['type']} ${expected_entity_type} + END Check Response Body Containing Context Source Registration element [Arguments] ${expectation_filename} ${context_source_registration_id} @@ -243,7 +232,7 @@ Check Response Body Containing Context Source Registration element ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${context_source_registration} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -253,7 +242,7 @@ Check Response Body Containing EntityTypeList element ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_list_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -263,7 +252,7 @@ Check Response Body Containing EntityType element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -273,7 +262,7 @@ Check Response Body Containing EntityTypeInfo element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_info_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -283,7 +272,7 @@ Check Response Body Containing AttributeList element ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_list_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -293,7 +282,7 @@ Check Response Body Containing Attribute element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -311,7 +300,7 @@ Check Response Body Containing List Containing Context Source Registrations elem END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_context_source_registrations_payload} - ... ${response['body']} + ... ${response.json()} ... ${EMPTY} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -322,7 +311,7 @@ Check Response Body Type When Using Session Request Check Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} - Should Be Equal ${response['body']['type']} ${type} + Should Be Equal ${response['type']} ${type} Check Response Body Title When Using Session Request [Arguments] ${response} @@ -330,32 +319,22 @@ Check Response Body Title When Using Session Request Check Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} - Should Not Be Empty ${response['body']['title']} + Should Not Be Empty ${response['title']} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} - ${json_response_body}= Set Variable ${response.json()} + ${json_response_body}= Set Variable ${response} Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} - ${json_response_body}= Set Variable ${response.json()} + ${json_response_body}= Set Variable ${response} Should Not Be Empty ${json_response_body['title']} -Assert response status code - [Arguments] ${code} - Should Be Equal ${response}[status] ${code} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - ${status}= Convert To Integer ${expected_status} - Should Be Equal ${response['status']} ${status} - Log Status code validated - Check JSON Value In Response Body [Arguments] ${json_path_expr} ${value_to_check} - Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} + Should Be Equal As Strings ${response.json()${json_path_expr}} ${value_to_check} Check NotificationParams [Arguments] ${filename} ${expected_additional_members} @@ -364,12 +343,12 @@ Check NotificationParams ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_notification} - ... ${response['body']['notification']} + ... ${response.json()['notification']} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} - Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} + Should Not Be Empty ${response.json()['notification']['${expected_additional_member}']} END Check Pagination Prev And Next Headers @@ -377,43 +356,23 @@ Check Pagination Prev And Next Headers ${expected_links}= Create List ${prev_link} ${next_link} IF '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal - ... ${response['headers']['Link'].replace(" ", "").split(',')} + ... ${response.headers['Link'].replace(" ", "").split(',')} ... ${expected_links} ... ignore_order=True END IF '${prev_link}'!='' and '${next_link}'=='' - Should Be Equal ${response['headers']['Link']} ${prev_link} + Should Be Equal ${response.headers['Link']} ${prev_link} END IF '${prev_link}'=='' and '${next_link}'!='' - Should Be Equal ${response['headers']['Link']} ${next_link} + Should Be Equal ${response.headers['Link']} ${next_link} END -Check Response Body Containing One Subscription element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} - ${subscription}= Update Value To JSON ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${subscription} - ... ${response_body} - ... ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} - -Check Response Body Containing One Registration element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${registration}= Update Value To JSON ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${registration} - ... ${response_body} - ... ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} - Check Resource Set To [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_resource} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} ... ${group_by} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -423,13 +382,6 @@ Check Created Resource Set To Check Resource Set To ${created_resource} ${ignored_keys} -Check Subscription Failed - [Arguments] ${subscription} - - Should Be True ${sub} - - Check Resource Set To ${created_resource} ${ignored_keys} - Check Created Resources Set To [Arguments] ${expected_resources} ${ignored_keys}=${None} @@ -446,8 +398,8 @@ Check Updated Resources Set To Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id Check SUT Not Containing Resource - ${response_status}= convert to string ${response['status']} + ${response_status}= convert to string ${response.status_code} Should Be Equal ${response_status} 404 Check SUT Not Containing Resources - Should Be Empty ${response['body']} + Should Be Empty ${response.json()} diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index 7a16edde..1dab3303 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -5,5 +5,5 @@ Library String *** Keywords *** Fetch Id From Response Location Header - ${id}= Fetch From Right ${response['headers']['Location']} / + ${id}= Fetch From Right ${response.headers['Location']} / RETURN ${id} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 2a88bd8e..82ef9dc0 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -19,15 +19,6 @@ Wait for redirected request Wait For Request ${timeout} Reply By 200 -Wait for redirected failed request - [Arguments] ${timeout}=${5} - # HTTP server receives it and checks incoming request for correctness - # .. "Wait For Request" - # .... This call is blocked until HTTP request arrives or timeout. - # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 400 - Stop Context Source Mock Server # Terminate HTTP Server Stop Server -- GitLab From c4de824ddc3d8deda6baa6e850a24be4f80d3679 Mon Sep 17 00:00:00 2001 From: poujol Date: Thu, 1 Jun 2023 10:21:36 +0000 Subject: [PATCH 298/442] chore: always use arguments when using function --- README.md | 4 + TP/NGSI-LD/CommonBehaviours/044_02.robot | 8 +- .../027_01_01.robot | 1 - .../027_01_02.robot | 2 +- .../RetrieveAvailableAttributes/025_01.robot | 2 +- .../024_01_01.robot | 1 - .../024_01_02.robot | 2 +- .../RetrieveAvailableEntityTypes/022_01.robot | 2 +- .../026_01.robot | 2 +- .../023_01.robot | 2 +- .../Entity/QueryEntities/019_06.robot | 2 +- .../021_01.robot | 1 + .../021_02.robot | 1 + .../021_03.robot | 1 + .../021_04.robot | 1 + .../021_05.robot | 1 + .../021_06.robot | 1 + .../021_07.robot | 1 + .../021_08.robot | 1 + .../021_09.robot | 1 + .../021_10.robot | 1 - .../021_11.robot | 2 +- .../021_12.robot | 1 - .../021_13.robot | 1 + .../020_01.robot | 1 + .../020_02.robot | 1 + .../020_03.robot | 1 + .../020_04.robot | 1 + .../020_05.robot | 1 + .../020_08.robot | 1 - .../020_10.robot | 1 + .../CreateBatchOfEntities/003_01.robot | 4 +- .../CreateBatchOfEntities/003_02.robot | 5 +- .../CreateBatchOfEntities/003_04.robot | 6 +- .../CreateBatchOfEntities/003_05.robot | 4 +- .../CreateBatchOfEntities/003_07.robot | 6 +- .../DeleteBatchOfEntities/006_01.robot | 2 +- .../DeleteBatchOfEntities/006_02.robot | 4 +- .../UpdateBatchOfEntities/005_01.robot | 2 +- .../UpdateBatchOfEntities/005_02.robot | 2 +- .../UpdateBatchOfEntities/005_03.robot | 4 +- .../UpsertBatchOfEntities/004_01.robot | 4 +- .../UpsertBatchOfEntities/004_02.robot | 4 +- .../UpsertBatchOfEntities/004_03.robot | 2 +- .../UpsertBatchOfEntities/004_04.robot | 4 +- .../UpsertBatchOfEntities/004_05.robot | 4 +- .../Entities/CreateEntity/001_01.robot | 2 +- .../Entities/CreateEntity/001_04.robot | 6 +- .../Entities/CreateEntity/001_05.robot | 4 +- .../Entities/CreateEntity/001_07.robot | 6 +- .../Entities/DeleteEntity/002_01.robot | 2 +- .../AppendEntityAttributes/010_01.robot | 4 +- .../AppendEntityAttributes/010_03.robot | 1 - .../DeleteEntityAttribute/013_01.robot | 2 +- .../PartialAttributeUpdate/012_01.robot | 2 +- .../UpdateEntityAttributes/011_01.robot | 2 +- .../UpdateEntityAttributes/011_03.robot | 1 - .../007_01.robot | 5 +- .../009_01.robot | 2 +- .../008_01.robot | 5 +- .../AppendAttributes/014_01.robot | 5 +- .../DeleteAttribute/015_01.robot | 5 +- .../DeleteAttributeInstance/017_01.robot | 5 +- .../ModifyAttributeInstance/016_01.robot | 5 +- .../CreateSubscription/028_01.robot | 2 +- .../DeleteSubscription/032_03.robot | 2 +- .../QuerySubscriptions/031_01.robot | 1 + .../QuerySubscriptions/031_02.robot | 7 +- .../RetrieveSubscription/030_03.robot | 5 +- .../UpdateSubscription/029_03.robot | 1 - .../UpdateSubscription/029_04.robot | 1 - .../UpdateSubscription/029_05.robot | 2 + .../UpdateSubscription/029_06.robot | 2 +- .../UpdateSubscription/029_07.robot | 2 +- .../UpdateSubscription/029_08.robot | 2 +- .../UpdateSubscription/029_09.robot | 2 +- .../UpdateSubscription/029_10.robot | 2 +- .../UpdateSubscription/029_11.robot | 1 - .../033_01_01.robot | 2 +- .../033_01_02.robot | 2 +- .../033_01_03.robot | 2 +- .../033_04.robot | 3 +- .../033_05.robot | 7 +- .../033_07.robot | 3 +- .../035_01.robot | 2 +- .../037_01.robot | 1 + .../037_04.robot | 1 + .../037_05.robot | 1 + .../037_06.robot | 1 + .../037_07.robot | 1 + .../037_08.robot | 1 + .../037_09.robot | 1 + .../037_10.robot | 1 + .../037_11.robot | 7 +- .../036_03.robot | 1 + .../036_04.robot | 1 + .../036_05.robot | 1 + .../034_01.robot | 2 +- .../038_01.robot | 2 +- .../038_02.robot | 2 +- .../038_03.robot | 2 +- .../038_04.robot | 2 +- .../038_05.robot | 2 +- .../038_06.robot | 2 +- .../038_07.robot | 1 - .../042_01.robot | 2 +- .../NotificationBehaviour/047_05.robot | 5 +- .../NotificationBehaviour/047_06.robot | 5 +- .../041_01.robot | 1 + .../041_02.robot | 5 +- .../041_03.robot | 7 +- .../040_01.robot | 5 +- .../039_01.robot | 2 +- .../039_05.robot | 1 - libraries/assertionUtils.py | 6 +- libraries/logUtils.py | 3 +- resources/ApiUtils.resource | 34 ---- resources/AssertionUtils.resource | 169 +++++++++--------- schemas/error_response.schema.json | 7 - 119 files changed, 270 insertions(+), 238 deletions(-) delete mode 100644 schemas/error_response.schema.json diff --git a/README.md b/README.md index b4925e6f..3458ff56 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,10 @@ For more running instructions please consult [scripts/run_tests.sh](./scripts/ru ```$ python3 -m robot.testdoc TP/NGSI-LD api_docs/TestCases.html``` +## Tidy the Test Cases + +```$ python3 -m robot.tidy --recursive TP/NGSI-LD``` + # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index f8e87f4b..8f634d61 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -32,7 +32,7 @@ ${content_type}= application/json Check Response Status Code 201 ${response.status_code} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* Check Response Status Code 200 ${response.status_code} - Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Entity by Id Returning Response ${id} @@ -44,7 +44,7 @@ ${content_type}= application/json Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Subscription ${id} accept=*/* Check Response Status Code 200 ${response.status_code} - Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Subscription ${id} @@ -62,7 +62,7 @@ ${content_type}= application/json ... context=${ngsild_test_suite_context} ... accept=*/* Check Response Status Code 200 ${response.status_code} - Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} @@ -83,6 +83,6 @@ ${content_type}= application/json ... accept=*/* Check Response Status Code 200 ${response.status_code} Set Test Variable ${response} - Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Containing Content-Type set to ${content_type} ${response.headers} Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index 889a5c5e..fbb7439d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -26,7 +26,6 @@ Retrieve Detailed Representation Of Available Attribute Without Context Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index 1a2f0f77..0853f181 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -21,7 +21,7 @@ Retrieve Detailed Representation Of Available Attribute [Tags] ed-attr 5_7_10 ${response}= Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Attribute element ${expectation_file} + Check Response Body Containing Attribute element ${expectation_file} ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index c611457b..6c60bf12 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -29,7 +29,7 @@ Retrieve Available Attributes [Arguments] ${context} ${expectation_file} ${response}= Retrieve Attributes ${context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing AttributeList element ${expectation_file} + Check Response Body Containing AttributeList element ${expectation_file} ${response.json()} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index f45a563b..e782a8c9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -26,7 +26,6 @@ Retrieve Detailed Representation Of Available Entity Type Without Context Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index 33d7f30e..fbc36deb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -21,7 +21,7 @@ Retrieve Detailed Representation Of Available Entity Type [Tags] ed-type 5_7_7 ${response}= Retrieve Entity Type type=Building context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing EntityTypeInfo element ${expectation_file} + Check Response Body Containing EntityTypeInfo element ${expectation_file} ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 0089b75b..3f8cd47c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -31,7 +31,7 @@ Retrieve Available Entity Types [Arguments] ${context} ${expectation_file} ${response}= Retrieve Entity Types ${context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing EntityTypeList element ${expectation_file} + Check Response Body Containing EntityTypeList element ${expectation_file} ${response.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index ff3c6511..557cc53d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -29,7 +29,7 @@ Retrieve Details Of Available Attributes [Arguments] ${context} ${expectation_file} ${response}= Retrieve Attributes context=${context} details=${TRUE} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Attribute element ${expectation_file} + Check Response Body Containing Attribute element ${expectation_file} ${response.json()} Setup Initial Entities ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index b725e55a..c9b55e30 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -31,7 +31,7 @@ Retrieve Details Of Available Entity Types [Arguments] ${context} ${expectation_file} ${response}= Retrieve Entity Types context=${context} details=${TRUE} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing EntityType element ${expectation_file} + Check Response Body Containing EntityType element ${expectation_file} ${response.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 449cd3a9..fc5f3018 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -47,7 +47,7 @@ Query entities specifying a maximum number of results ... limit=${limit} Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Number Of Entities ${entity_type} ${2} + Check Response Body Containing Number Of Entities ${entity_type} ${2} ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 2501434a..3ed7c3af 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -42,6 +42,7 @@ Query the temporal evolution of entities Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index af1dd099..58cc6a91 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -35,6 +35,7 @@ Query the temporal evolution of certain attributes of entities Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 0fbed90c..81629935 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -34,6 +34,7 @@ Query the temporal evolution of the last N instances of entities attributes Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 30a92bf3..6bab8c04 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -33,6 +33,7 @@ Query the temporal evolution of entities using a context Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index 1d6c2d16..57300cf3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -32,6 +32,7 @@ Query the temporal evolution of entities matching the given type(s) Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 59e25190..5d94d9bf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -33,6 +33,7 @@ Query the temporal evolution of entities matching the given identifier(s) Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index b4075e65..4fca7480 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -34,6 +34,7 @@ Query the temporal evolution of entities matching the given id pattern Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 4d1efb4d..c49aaa1a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -34,6 +34,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 5269eb39..5a485e31 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -43,6 +43,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index 062f404f..13ee2575 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -31,7 +31,6 @@ Query the temporal evolution of entities matching the given NGSI-LD context sour Check Response Status Code 200 ${response.status_code} - *** Keywords *** Create Initial Context Source Registration Start Context Source Mock Server diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 5e0e25de..6880dde9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -37,7 +37,7 @@ Query the temporal evolution of entities with a limit to the number of entities ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Number Of Entities Vehicle ${limit} + Check Response Body Containing Number Of Entities Vehicle ${limit} ${response.json()} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index d52e17b8..459ed342 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -29,7 +29,6 @@ Query the temporal evolution of entities with an invalid request Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 54963f57..0bb09a1f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -37,6 +37,7 @@ Query the temporal evolution of entities using the entityOperations method Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} + ... ${response.json()} Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 95c4e17b..688ffda7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -24,6 +24,7 @@ Retrieve the temporal evolution of an entity Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 0d3d4f9b..db67528d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -26,6 +26,7 @@ Retrieve the temporal evolution of an entity using a context Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index b4d586e0..d6ffa927 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -28,6 +28,7 @@ Retrieve the temporal evolution of certain attributes of an entity Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index d1ecd7b6..5a2082f2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -38,6 +38,7 @@ Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 0a07a3ac..2b226d09 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -36,6 +36,7 @@ Retrieve the temporal evolution of the last N instances of entity attributes Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 35b573da..e457cb4c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -30,7 +30,6 @@ Retrieve the temporal evolution of non-existing entity attributes Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index d982aaa5..69e8d9f6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -28,6 +28,7 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index 3961c29c..d0ae37d4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -39,11 +39,11 @@ Batch Create Entity Scenarios @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code 201 ${response.status_code} - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${response}= Query Entities ... ${entities_to_be_queried} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Created Resources Set To ${entities_to_be_created} + Check Created Resources Set To ${entities_to_be_created} ${response.json()} ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index 383d98fd..f4461c66 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -30,7 +30,7 @@ Create a batch of two valid entities and one invalid entity ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} ${response}= Query Entities ... ${expected_entities_ids} @@ -38,12 +38,11 @@ Create a batch of two valid entities and one invalid entity ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} @{created_entities}= Create List ${first_entity} ${second_entity} - Check Created Resources Set To ${created_entities} + Check Created Resources Set To ${created_entities} ${response.json()} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} - *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index 58d817e6..f49cea34 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -24,9 +24,11 @@ Create a batch of one entity using a provided Link header with JSON content type Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this attribute - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Check Response Body Containing an Attribute set to + ... https://ngsi-ld-test-suite/context#almostFull + ... ${response.json()} @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index a16bb2ca..7e314ac1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -21,9 +21,9 @@ Create a batch of one entity using the default context with JSON content type Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull ${response.json()} @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index 00dc0dbc..f63251f1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -21,9 +21,11 @@ Create a batch of one entity using a JSON-LD @context obtained from the request Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Check Response Body Containing an Attribute set to + ... https://ngsi-ld-test-suite/context#almostFull + ... ${response.json()} @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 17b0c552..7d717d55 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -21,7 +21,7 @@ Delete a batch of entities Check Response Status Code 204 ${response.status_code} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check SUT Not Containing Resources + Check SUT Not Containing Resources ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index c408657c..6250b995 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -25,10 +25,10 @@ Delete a batch of non-existing and existing entities ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} - Check SUT Not Containing Resources + Check SUT Not Containing Resources ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index a6150c46..ab6cf54a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -49,7 +49,7 @@ Batch Update Entity Scenarios ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + Check Updated Resources Set To ${updated_entities} ${response.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index d307e90c..685a3c79 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -49,7 +49,7 @@ Batch Update Entity With NoOverwrite Option Scenarios ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + Check Updated Resources Set To ${updated_entities} ${response.json()} Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 51137694..afe3e325 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -34,7 +34,7 @@ Update a batch of non-existing and existing entities ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} ${second_created_entity}= Load Test Sample ... entities/${entity_payload_filename} @@ -49,7 +49,7 @@ Update a batch of non-existing and existing entities ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + Check Updated Resources Set To ${updated_entities} ${response.json()} ${response}= Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index a8b6abab..a7043f5a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -36,12 +36,12 @@ Batch Upsert Entity Scenarios ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code 201 ${response.status_code} - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} + Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index afcab510..19822b2c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -41,7 +41,7 @@ Batch Upsert Non-existing And Existing Entities Scenarios ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code 201 ${response.status_code} - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} @{upserted_entities_ids}= Create List ... ${new_entity_id} ... ${first_existing_entity_id} @@ -52,7 +52,7 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} + Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index de53092e..583cd1d8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -42,7 +42,7 @@ Batch Upsert Existing Entities Scenarios ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${entities_to_be_upserted} + Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 47681f62..5015d1fa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -39,7 +39,7 @@ Batch Upsert Entities With Update Option Scenarios ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update @{expected_entities_ids}= Create List ${new_entity_id} Check Response Status Code 201 ${response.status_code} - Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @@ -50,7 +50,7 @@ Batch Upsert Entities With Update Option Scenarios ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resources Set To ${updated_entities} + Check Updated Resources Set To ${updated_entities} ${response.json()} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index 678baa02..59b275c0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -29,7 +29,7 @@ Upsert a batch of two valid entities and one invalid entity ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} Check Response Status Code 207 ${response.status_code} - Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} ${response}= Query Entities ... ${expected_updated_entities_ids} @@ -37,5 +37,5 @@ Upsert a batch of two valid entities and one invalid entity ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} - Check Updated Resources Set To ${upserted_entities} + Check Updated Resources Set To ${upserted_entities} ${response.json()} ${response}= Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 4b83df49..3d17cc43 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -45,5 +45,5 @@ Create Entity Scenarios ... ${content_type} ... context=${ngsild_test_suite_context} END - Check Created Resource Set To ${created_entity} + Check Created Resource Set To ${created_entity} ${response.json()} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index bfbca10a..a8aa8108 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -23,8 +23,10 @@ Create one entity using a provided Link header with JSON content type ... context=${ngsild_test_suite_context} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Check Response Body Containing an Attribute set to + ... https://ngsi-ld-test-suite/context#almostFull + ... ${response.json()} ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index 4c44f76b..7a2ffb46 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -19,11 +19,11 @@ Create one entity using the default context with JSON content type ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull + Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull ${response.json()} ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index c2fda435..9f5445cc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -19,8 +19,10 @@ Create one entity using a JSON-LD @context obtained from the request payload ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity - Check Response Body Containing an Attribute set to almostFull + Check Response Body Containing an Attribute set to almostFull ${response.json()} ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term - Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull + Check Response Body Containing an Attribute set to + ... https://ngsi-ld-test-suite/context#almostFull + ... ${response.json()} ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 235d5953..38a00180 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -23,4 +23,4 @@ Delete an entity ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource + Check SUT Not Containing Resource ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 5f2d95f2..02ed006c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -57,7 +57,7 @@ Append Attributes Without Params ... ${entity_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${entity_expectation_payload} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} Append Attributes With Params @@ -89,5 +89,5 @@ Append Attributes With Params ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index f363e0a3..95e64907 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -24,6 +24,5 @@ Append entity attributes when the entity id is not known to the system Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 8e90be9d..25978e8c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -48,5 +48,5 @@ Delete Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index f62936e2..82ed9453 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -44,5 +44,5 @@ Update Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 9c1abaf8..2801cba5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -48,5 +48,5 @@ Update Attributes ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context - Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 2a355c98..144d5026 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -25,6 +25,5 @@ Update entity attributes when the entity id is not known to the system Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index d78353d6..e52305a8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -45,5 +45,8 @@ Create Temporal Entity ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Check Created Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Created Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index cd263d54..02051616 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -27,4 +27,4 @@ Delete a temporal representation of an entity with simple temporal properties ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} - Check SUT Not Containing Resource + Check SUT Not Containing Resource ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index 8e2dd36c..b04ba707 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -36,5 +36,8 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index b510e97a..4e6ea7f9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -36,5 +36,8 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 88c24a25..9b206409 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -51,5 +51,8 @@ Delete Attribute From A Temporal Entity ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index ccdb46d9..e3ef12a6 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -44,5 +44,8 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List instanceId @context - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index fc7f9636..19ad0a2c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -57,5 +57,8 @@ ${attributeId}= speed ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} ${ignored_attributes}= Create List instanceId @context modifiedAt - Check Updated Resource Set To ${temporal_entity_expectation_payload} ${ignored_attributes} + Check Updated Resource Set To + ... ${temporal_entity_expectation_payload} + ... ${response.json()} + ... ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index e5e8f6de..0df82096 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -26,5 +26,5 @@ Create Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Created Resource Set To ${expected_subscription} + Check Created Resource Set To ${expected_subscription} ${response.json()} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index 7a12cff9..ad4c8980 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -21,7 +21,7 @@ Delete Subscription ${response}= Delete Subscription ${subscription_id} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Subscription ${subscription_id} - Check SUT Not Containing Resource + Check SUT Not Containing Resource ${response.status_code} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index 757768a1..f5706541 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -30,6 +30,7 @@ Query Subscriptions Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index c8c763a1..7cb65072 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -39,8 +39,11 @@ Query Subscriptions With Limit And Page Parameters ... offset=${offset} ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} + Check Response Body Containing Number Of Entities + ... Subscription + ... ${expectation_subscription_number} + ... ${response.json()} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.headers} Setup Initial Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 9cfdf7c1..5689e01a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -21,7 +21,10 @@ Retrieve Subscription [Tags] sub-retrieve 5_8_3 ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expectation_file_path} + ... ${subscription_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index 7175df75..63869f67 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -30,7 +30,6 @@ Update Subscription With Invalid Fragment Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index 94a2b507..da9c634d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -30,7 +30,6 @@ Update Subscription With Null Mandatory Properties Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 3c571964..340d4fcd 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -31,10 +31,12 @@ Update Subscription With Term to Uri Expansion Check Response Body Containing Subscription element ... ${expected_subscription_payload_file_path} ... ${subscription_id} + ... ${response.json()} ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing Subscription element ... ${expected_expanded_subscription_payload_file_path} ... ${subscription_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index a3fcfb84..606ecfeb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -32,7 +32,7 @@ Update Subscription ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} ${ignored_attributes}= Create List ${status_regex_expr} - Check Updated Resource Set To ${subscription} ${ignored_attributes} + Check Updated Resource Set To ${subscription} ${response.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index 9c8ef145..6b1a4158 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -30,7 +30,7 @@ Activate Paused Subscription With isActive Member ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Check Response Body Containing an Attribute set to status ${response.json()} active Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index 9f07d0e5..ad62120e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -31,7 +31,7 @@ Activate Paused Subscription With isActive And ExpiresAt Members ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Check Response Body Containing an Attribute set to status ${response.json()} active Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 3b2b8fc6..024d6d12 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -25,7 +25,7 @@ Update Subscription Status To Paused ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status paused + Check Response Body Containing an Attribute set to status ${response.json()} paused *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index a82c2089..aeb29fa0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -36,7 +36,7 @@ Activate Expired Subscription ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Check Response Body Containing an Attribute set to status ${response.json()} active *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 64d5c3d0..480bc931 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -30,7 +30,6 @@ Update Subscription With ExpiresAt In The Past Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index a87d5cdb..51a25ad2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -25,5 +25,5 @@ Create Context Source Registration With Specific Date Expiration Date ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 29a3e5ef..87917bd3 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -26,5 +26,5 @@ Create Context Source Registration That Never Expires ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 611e8a09..1ba8d35c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -25,5 +25,5 @@ Create Context Source Registration Without A Sprecified ID ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${ignored_attributes} + Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index d820ecaf..0f0eb201 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -24,9 +24,10 @@ Create one context source registration using a provided Link header with JSON co ... ${ngsild_test_suite_context} Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building ${response.json()} ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building + ... ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index cbb25fc5..f486086c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -23,7 +23,10 @@ Create one context source registration using the default context with JSON conte ... ${CONTENT_TYPE_JSON} Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building + Check JSON Value In Response Body + ... ['information']['entities'][0]['type'] + ... ngsi-ld:default-context/Building + ... ${response.json()} ${response}= Retrieve Context Source Registration ${registration_id} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index 98ce13ab..77b28786 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -23,9 +23,10 @@ Create one context source registration using a JSON-LD @context obtained from th ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check JSON Value In Response Body ['information']['entities'][0]['type'] Building + Check JSON Value In Response Body ['information']['entities'][0]['type'] Building ${response.json()} ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building + ... ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 1572d996..bd7979a8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -23,4 +23,4 @@ Delete a context source registration by id ${response}= Delete Context Source Registration With Return ${registration_id} Check Response Status Code 204 ${response.status_code} ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} - Check SUT Not Containing Resource + Check SUT Not Containing Resource ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 785cab26..34484615 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -40,6 +40,7 @@ Query Context Source Registration Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index 25864bcb..200574a3 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -25,6 +25,7 @@ Query Context Source Registrations Without Context Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index b4e1c5d2..22b7a7ca 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -40,4 +40,5 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 7c8a00c3..7f803e34 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -37,6 +37,7 @@ Query Context Source Registration Matching Properties And Relationships Of Regis Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 49492e94..6cb09ceb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -39,6 +39,7 @@ Query Context Source Registration Matching Geoquery Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index 39a33d5a..b1fe80c5 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -25,6 +25,7 @@ Query Context Source Registration Without Temporal Query Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index 1173a309..f5170635 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -52,4 +52,5 @@ Query Context Source Registration Matching Temporal Query Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} [Teardown] Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index f8e8711c..0becb0ad 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -44,6 +44,7 @@ Query Context Source Registration With Query Params Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} + ... ${response.json()} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index e85b7ac9..4708063f 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -39,8 +39,11 @@ Query Context Source Registration With Limit And Page Parameters ... limit=${limit} ... page=${page} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} + Check Response Body Containing Number Of Entities + ... ContextSourceRegistration + ... ${expected_number} + ... ${response.json()} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.json()} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 53055cb1..a9500486 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -24,6 +24,7 @@ Retrieve Context Source Registration With Default Core Context Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 1a1f6757..3c968a87 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -26,6 +26,7 @@ Retrieve Context Source Registration Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 03d9fed5..37be8a91 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -35,6 +35,7 @@ Check JSON-LD resolution when retrieving a context source registration Check Response Body Containing Context Source Registration element ... ${expected_payload} ... ${context_source_registration_id} + ... ${response.json()} Setup Initial Context Source Registration ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 7ddf9977..3050f041 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -41,5 +41,5 @@ Update Context Source ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} @context - Check Updated Resource Set To ${registration_payload} ${ignored_attributes} + Check Updated Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 9dcaaa19..d96731cf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -27,7 +27,7 @@ Create Context Source Registration Subscription ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + Check Created Resource Set To ${subscription_payload} ${response.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 7acfe0ef..e54d7e86 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -28,7 +28,7 @@ Create Context Source Registration Subscription Without An Id ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${id_regex_expr} ${status_regex_expr} - Check Created Resource Set To ${subscription_payload} ${ignored_attributes} + Check Created Resource Set To ${subscription_payload} ${response.json()} ${ignored_attributes} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index 131e2dec..12673b28 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -23,7 +23,7 @@ Create Context Source Registration Subscription Without isActive Member Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Check Response Body Containing an Attribute set to status ${response.json()} active *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index da1e0f8e..25ba1341 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -23,7 +23,7 @@ Create Inactive Context Source Registration Subscription Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status paused + Check Response Body Containing an Attribute set to status ${response.json()} paused *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 6b560383..52b6a0eb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -27,7 +27,7 @@ Create Context Source Registration Subscription With expiresAt Member Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Sleep 15s ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status expired + Check Response Body Containing an Attribute set to status ${response.json()} expired *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index c719246c..3ccfc4de 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -25,7 +25,7 @@ Create Context Source Registration Subscription Without expiresAt Member # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough Sleep 10s ${response}= Retrieve context source registration subscription ${subscription_id} - Check Response Body Containing an Attribute set to status active + Check Response Body Containing an Attribute set to status ${response.json()} active *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index e930111c..12eec667 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -27,7 +27,6 @@ Create Existing Context Source Registration Subscription Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index 6a605539..c9e55421 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -22,7 +22,7 @@ Delete Context Source Registration Subscription ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} - Check SUT Not Containing Resource + Check SUT Not Containing Resource ${response.status_code} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index 71cc885d..8b679d27 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -31,7 +31,10 @@ If A cSourceNotification Is Successfully Sent The Notification Member Shall Be U Wait for notification ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastSuccess - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + Check NotificationParams + ... ${notification_expectation_file_path} + ... ${expected_notification_additional_members} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index 7e321bf0..a497ee95 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -31,7 +31,10 @@ If A cSourceNotification Is Not Successfully Sent The Notification Member Shall Wait for no notification ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastFailure - Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} + Check NotificationParams + ... ${notification_expectation_file_path} + ... ${expected_notification_additional_members} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index d245dd81..d5ee16d8 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -26,6 +26,7 @@ Query Context Source Registration Subscriptions Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 1d1331d6..64c0a027 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -38,7 +38,10 @@ Query Context Source Registration Subscriptions With Limit Parameter ... context=${ngsild_test_suite_context} ... limit=${limit} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} + Check Response Body Containing Number Of Entities + ... Subscription + ... ${expectation_subscription_number} + ... ${response.json()} Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index 5cbac889..f435b3ab 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -38,8 +38,11 @@ Query Context Source Registration Subscriptions With Limit And Page Parameters ... limit=${limit} ... page=${page} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} - Check Pagination Prev And Next Headers ${prev_link} ${next_link} + Check Response Body Containing Number Of Entities + ... Subscription + ... ${expectation_subscription_number} + ... ${response.json()} + Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.json()} Setup Initial Context Source Registration Subscriptions ${first_subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index 4990c31b..6f962046 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -23,7 +23,10 @@ Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} + Check Response Body Containing Subscription element + ... ${expectation_file_path} + ... ${subscription_id} + ... ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index d3b9d6df..7905fd7b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -29,7 +29,7 @@ Update Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - Check Updated Resource Set To ${subscription} + Check Updated Resource Set To ${subscription} ${response.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index 1a212652..55869fc9 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -29,7 +29,6 @@ Update Context Source Registration Subscription With Invalid JSON Fragment Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py index b9dde5a7..36fbf0d1 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -1,5 +1,6 @@ from deepdiff import DeepDiff + def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, group_by=None): """Function exposed as a keyword to compare two dictionaries :param expected: expected dictionary @@ -7,9 +8,10 @@ def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, gr :param exclude_regex_paths: list of regex paths of keys to be ignored :param group_by: a key to group the results, useful for lists of results """ - res = {} + if group_by is not None: - res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1, group_by=group_by) + res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1, + group_by=group_by) else: res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1) return res diff --git a/libraries/logUtils.py b/libraries/logUtils.py index 1de30abe..dec7fef5 100644 --- a/libraries/logUtils.py +++ b/libraries/logUtils.py @@ -9,7 +9,8 @@ from robot.api.deco import keyword @keyword(name="Output", tags=("I/O",)) def output(response, console=True): """*Request and response are output to terminal and file (in JSON).* - ``console``: If false, the JSON is not written to terminal. Default is true. + :param response: response to a request + :param console: If false, the JSON is not written to terminal. Default is true. """ try: diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 863b2536..da6ba285 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -87,7 +87,6 @@ Query Entity ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -150,7 +149,6 @@ Query Entities ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -199,7 +197,6 @@ Retrieve Entity by Id ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${response}= GET url=${url}/${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -328,7 +325,6 @@ Retrieve Entity Types ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -348,7 +344,6 @@ Retrieve Entity Type ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -371,7 +366,6 @@ Retrieve Attributes ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -391,7 +385,6 @@ Retrieve Attribute ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -475,7 +468,6 @@ Create Temporal Representation Of Entity Selecting Content Type ... data=${file_content} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -633,7 +625,6 @@ Batch Create Entities ... json=@{entities_to_be_created} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -645,7 +636,6 @@ Batch Upsert Entities ... json=@{entities_to_be_upserted} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -657,7 +647,6 @@ Batch Update Entities ... json=@{entities_to_be_updated} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -669,7 +658,6 @@ Batch Delete Entities ... json=@{entities_ids_to_be_deleted} ... headers=${headers} ... expected_status=any - IF not ${teardown} Set Test Variable ${response} Output ${response} RETURN ${response} @@ -682,7 +670,6 @@ Request Entity From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -696,7 +683,6 @@ Batch Request Entities From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -757,7 +743,6 @@ Retrieve Temporal Representation Of Entity ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -826,7 +811,6 @@ Query Temporal Representation Of Entities ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -843,7 +827,6 @@ Query Temporal Representation Of Entities Via Post ... json=${query_payload} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -865,7 +848,6 @@ Create Context Source Registration ... json=${context_source_registration_payload} ... headers=${headers} ... expected_status=any - Set Suite Variable ${response} Output ${response} RETURN ${response} @@ -876,7 +858,6 @@ Update Context Source Registration ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... json=${update_fragment} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -937,7 +918,6 @@ Query Context Source Registrations ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -945,7 +925,6 @@ Delete Context Source Registration [Arguments] ${context_source_registration_id} ${response}= DELETE url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Set Suite Variable ${response} Output ${response} RETURN ${response} @@ -963,7 +942,6 @@ Retrieve Context Source Registration ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -979,7 +957,6 @@ Create Context Source Registration Subscription ... json=${subscription_payload} ... headers=${headers} ... expected_status=any - Set Suite Variable ${response} Output ${response} RETURN ${response} @@ -990,7 +967,6 @@ Update Context Source Registration Subscription ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... json=${subscription_update_fragment} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1008,7 +984,6 @@ Retrieve Context Source Registration Subscription ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1031,7 +1006,6 @@ Query Context Source Registration Subscriptions ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1039,7 +1013,6 @@ Delete Context Source Registration Subscription [Arguments] ${subscription_id} ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Set Suite Variable ${response} Output ${response} RETURN ${response} @@ -1050,7 +1023,6 @@ Update Context Source Registration Subscription From File ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... data=${file_content} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1112,7 +1084,6 @@ Create Subscription From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1138,7 +1109,6 @@ Update Subscription ... json=${subscription_update_fragment} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1158,14 +1128,12 @@ Update Subscription With Payload ... json=${payload} ... headers=${headers} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} Delete Subscription [Arguments] ${subscription_id} ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any - Set Suite Variable ${response} Output ${response} RETURN ${response} @@ -1190,7 +1158,6 @@ Query Subscriptions ... headers=${headers} ... params=${params} ... expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} @@ -1208,7 +1175,6 @@ Retrieve Subscription END ${response}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Set Test Variable ${response} Output ${response} RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 8692bdca..c6dd0a89 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -21,18 +21,9 @@ Check Response Status Code ${response_status_code}= convert to string ${response_status_code} Should Be Equal ${expected_status_code} ${response_status_code} -Check Response Status Code Set To - [Arguments] ${expected_status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${expected_status} - -Check RL Response Status Code Set To - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} - Check Response Body Containing Array Of URIs set to - [Arguments] @{expected_entities_ids} - Lists Should Be Equal ${expected_entities_ids} ${response.json()} ignore_order=True + [Arguments] ${expected_entities_ids} ${response_body} + Lists Should Be Equal ${expected_entities_ids} ${response_body} ignore_order=True Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} @@ -45,22 +36,22 @@ Check Response Body Content Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Headers Containing Content-Type set to - [Arguments] ${response} ${expected_content_type_content} - Should Be Equal ${response['Content-Type']} ${expected_content_type_content} + [Arguments] ${expected_content_type_content} ${response_headers} + Should Be Equal ${response_headers['Content-Type']} ${expected_content_type_content} Check Response Headers Link Not Empty - [Arguments] ${response} - Should Not Be Empty ${response['Link']} + [Arguments] ${response_headers} + Should Not Be Empty ${response_headers['Link']} # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to - [Arguments] ${expected_entity_id} ${response} + [Arguments] ${expected_entity_id} ${response_headers} - IF 'Location' in ${response} + IF 'Location' in ${response_headers} Should Contain - ... ${response['Location']} + ... ${response_headers['Location']} ... ${expected_entity_id} ... ignore_order=True END @@ -69,32 +60,32 @@ Check Response Headers Containing URI set to # We check both Location and location headers Check Response Headers ID Not Empty - [Arguments] ${response} + [Arguments] ${response_headers} ${location_header}= Set Variable If - ... 'Location' in ${response} - ... ${response['Location']} + ... 'Location' in ${response_headers} + ... ${response_headers['Location']} ${id}= Fetch From Right ${location_header} / Should Not Be Empty ${id} RETURN ${id} Check Response Body Containing an Attribute set to - [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} - Should Not Be Empty ${response.json()['${expected_attribute_name}']} + [Arguments] ${expected_attribute_name} ${response_body} ${expected_attribute_value}=${EMPTY} + Should Not Be Empty ${response_body['${expected_attribute_name}']} IF '${expected_attribute_value}'!='' - Should Be Equal ${response.json()['${expected_attribute_name}']} ${expected_attribute_value} + Should Be Equal ${response_body['${expected_attribute_name}']} ${expected_attribute_value} END Check Response Body Containing Batch Operation Result - [Arguments] ${expected_batch_operation_result} + [Arguments] ${expected_batch_operation_result} ${response_body} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors - @{response_errors}= Get From Dictionary ${response.json()} errors + @{response_errors}= Get From Dictionary ${response_body} errors ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} ${response_errors_length}= Get Length ${response_errors} - Lists Should Be Equal ${expected_successful_entities_ids} ${response.json()['success']} ignore_order=True + Lists Should Be Equal ${expected_successful_entities_ids} ${response_body['success']} ignore_order=True Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} FOR ${response_error} IN @{response_errors} List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} @@ -137,7 +128,7 @@ Check Response Body Containing List Containing Entity Elements With Different Ty Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTemporal element - [Arguments] ${filename} ${temporal_entity_representation_id} + [Arguments] ${filename} ${temporal_entity_representation_id} ${response_body} ${temporal_entity_representation_payload}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${temporal_entity_representation}= Update Value To JSON @@ -146,12 +137,12 @@ Check Response Body Containing EntityTemporal element ... ${temporal_entity_representation_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entity_representation} - ... ${response.json()} + ... ${response_body} ... ${instance_id_regex_expr} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing EntityTemporal elements - [Arguments] ${filename} ${temporal_entities_representation_ids} + [Arguments] ${filename} ${temporal_entities_representation_ids} ${response_body} ${temporal_entities_representation_payload}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/expectations/${filename} ${index}= Set Variable 0 @@ -164,24 +155,24 @@ Check Response Body Containing List Containing EntityTemporal elements END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entities_representation_payload} - ... ${response.json()} + ... ${response_body} ... ${instance_id_regex_expr} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Subscription element - [Arguments] ${expectation_filename} ${subscription_id} + [Arguments] ${expectation_filename} ${subscription_id} ${response_body} ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Subscription elements - [Arguments] ${expectation_file_path} ${subscription_ids} + [Arguments] ${expectation_file_path} ${subscription_ids} ${response_body} ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 FOR ${subscription_id} IN @{subscription_ids} @@ -194,7 +185,7 @@ Check Response Body Containing List Containing Subscription elements ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -202,10 +193,10 @@ Check Response Body Containing List Containing Subscription elements # A check on the response body type is needed Check Response Body Containing Number Of Entities - [Arguments] ${expected_entity_type} ${expected_length} + [Arguments] ${expected_entity_type} ${expected_length} ${response_body} - ${response_body_length}= Get Length ${response.json()} - ${is_list}= Run Keyword Evaluate type(${response.json()})==list + ${response_body_length}= Get Length ${response_body} + ${is_list}= Run Keyword Evaluate type(${response_body})==list IF ${is_list} Should Be Equal ${response_body_length} ${expected_length} @@ -215,15 +206,15 @@ Check Response Body Containing Number Of Entities FOR ${index} IN RANGE ${expected_length} IF ${is_list} - Should Be Equal ${response.json()[${index}]['type']} ${expected_entity_type} + Should Be Equal ${response_body[${index}]['type']} ${expected_entity_type} END END IF ${is_list} is ${FALSE} - Should Be Equal ${response.json()['type']} ${expected_entity_type} + Should Be Equal ${response_body['type']} ${expected_entity_type} END Check Response Body Containing Context Source Registration element - [Arguments] ${expectation_filename} ${context_source_registration_id} + [Arguments] ${expectation_filename} ${context_source_registration_id} ${response_body} ${context_source_registration_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${context_source_registration}= Update Value To JSON ... ${context_source_registration_payload} @@ -232,62 +223,62 @@ Check Response Body Containing Context Source Registration element ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${context_source_registration} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeList element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${response_body} ${entity_type_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_list_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityType element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${response_body} ${entity_type_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing EntityTypeInfo element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${response_body} ${entity_type_info_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_info_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing AttributeList element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${response_body} ${attribute_list_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_list_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing Attribute element - [Arguments] ${expectation_filename} + [Arguments] ${expectation_filename} ${response_body} ${attribute_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_payload} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Containing List Containing Context Source Registrations elements - [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} + [Arguments] ${expectation_file_path} ${expected_context_source_registrations_ids} ${response_body} ${expected_context_source_registrations_payload}= Load JSON From File ... ${EXECDIR}/data/${expectation_file_path} ${index}= Set Variable 0 @@ -300,106 +291,108 @@ Check Response Body Containing List Containing Context Source Registrations elem END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_context_source_registrations_payload} - ... ${response.json()} + ... ${response_body} ... ${EMPTY} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Response Body Type When Using Session Request - [Arguments] ${response} ${type} - Should Be Equal ${response['type']} ${type} + [Arguments] ${response_body} ${type} + Should Be Equal ${response_body['type']} ${type} Check Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - Should Be Equal ${response['type']} ${type} + [Arguments] ${response_body} ${type} + Should Be Equal ${response_body['type']} ${type} Check Response Body Title When Using Session Request - [Arguments] ${response} - Should Not Be Empty ${response['title']} + [Arguments] ${response_body} + Should Not Be Empty ${response_body['title']} Check Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - Should Not Be Empty ${response['title']} + [Arguments] ${response_body} + Should Not Be Empty ${response_body['title']} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response} ${type} - ${json_response_body}= Set Variable ${response} + [Arguments] ${response_body} ${type} + ${json_response_body}= Set Variable ${response_body} Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response} - ${json_response_body}= Set Variable ${response} + [Arguments] ${response_body} + ${json_response_body}= Set Variable ${response_body} Should Not Be Empty ${json_response_body['title']} Check JSON Value In Response Body - [Arguments] ${json_path_expr} ${value_to_check} - Should Be Equal As Strings ${response.json()${json_path_expr}} ${value_to_check} + [Arguments] ${json_path_expr} ${value_to_check} ${response_body} + Should Be Equal As Strings ${response_body${json_path_expr}} ${value_to_check} Check NotificationParams - [Arguments] ${filename} ${expected_additional_members} + [Arguments] ${filename} ${expected_additional_members} ${response_body} ${expected_notification}= Load JSON From File ${EXECDIR}/data/${filename} ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_notification} - ... ${response.json()['notification']} + ... ${response_body['notification']} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} - Should Not Be Empty ${response.json()['notification']['${expected_additional_member}']} + Should Not Be Empty ${response_body['notification']['${expected_additional_member}']} END Check Pagination Prev And Next Headers - [Arguments] ${prev_link} ${next_link} + [Arguments] ${prev_link} ${next_link} ${response_headers} ${expected_links}= Create List ${prev_link} ${next_link} IF '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal - ... ${response.headers['Link'].replace(" ", "").split(',')} + ... ${response_headers['Link'].replace(" ", "").split(',')} ... ${expected_links} ... ignore_order=True END IF '${prev_link}'!='' and '${next_link}'=='' - Should Be Equal ${response.headers['Link']} ${prev_link} + Should Be Equal ${response_headers['Link']} ${prev_link} END IF '${prev_link}'=='' and '${next_link}'!='' - Should Be Equal ${response.headers['Link']} ${next_link} + Should Be Equal ${response_headers['Link']} ${next_link} END Check Resource Set To - [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} + [Arguments] ${expected_resource} ${response_body} ${ignored_keys}=${None} ${group_by}=${None} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_resource} - ... ${response.json()} + ... ${response_body} ... ${ignored_keys} ... ${group_by} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} Check Created Resource Set To - [Arguments] ${created_resource} ${ignored_keys}=${None} + [Arguments] ${created_resource} ${response_body} ${ignored_keys}=${None} - Check Resource Set To ${created_resource} ${ignored_keys} + Check Resource Set To ${created_resource} ${response_body} ${ignored_keys} Check Created Resources Set To - [Arguments] ${expected_resources} ${ignored_keys}=${None} + [Arguments] ${expected_resources} ${response_body} ${ignored_keys}=${None} - Check Resource Set To ${expected_resources} ${ignored_keys} group_by=id + Check Resource Set To ${expected_resources} ${response_body} ${ignored_keys} group_by=id Check Updated Resource Set To - [Arguments] ${updated_resource} ${ignored_keys}=${None} + [Arguments] ${updated_resource} ${response_body} ${ignored_keys}=${None} - Check Resource Set To ${updated_resource} ${ignored_keys} + Check Resource Set To ${updated_resource} ${response_body} ${ignored_keys} Check Updated Resources Set To - [Arguments] ${updated_resources} ${ignored_keys}=${None} + [Arguments] ${updated_resources} ${response_body} ${ignored_keys}=${None} - Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id + Check Resource Set To ${updated_resources} ${response_body} ${ignored_keys} group_by=id Check SUT Not Containing Resource - ${response_status}= convert to string ${response.status_code} - Should Be Equal ${response_status} 404 + [Arguments] ${response_status} + ${response_status_string}= convert to string ${response_status} + Should Be Equal ${response_status_string} 404 Check SUT Not Containing Resources - Should Be Empty ${response.json()} + [Arguments] ${response_body} + Should Be Empty ${response_body} diff --git a/schemas/error_response.schema.json b/schemas/error_response.schema.json deleted file mode 100644 index 56b64635..00000000 --- a/schemas/error_response.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "required": [ - "detail", - "type", - "title" - ] -} -- GitLab From 635d2c5747a07e696ff541804f4e1219f091afba Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 6 May 2023 09:33:27 +0200 Subject: [PATCH 299/442] chore: review all set up and teardown with a common behaviour --- .../RetrieveAvailableAttributes/025_01.robot | 6 +++--- .../RetrieveAvailableEntityTypes/022_01.robot | 8 ++++---- .../026_01.robot | 6 +++--- .../023_01.robot | 8 ++++---- .../Entity/QueryEntities/019_01_01.robot | 8 ++++++-- .../Entity/QueryEntities/019_01_02.robot | 8 ++++++-- .../Entity/QueryEntities/019_01_03.robot | 7 +++++-- .../Entity/QueryEntities/019_01_04.robot | 11 ++++++++++- .../Entity/QueryEntities/019_01_05.robot | 7 +++++-- .../Entity/QueryEntities/019_02_01.robot | 13 +++++++++++-- .../Entity/QueryEntities/019_02_02.robot | 8 ++++++-- .../Entity/QueryEntities/019_02_03.robot | 7 +++++-- .../Entity/QueryEntities/019_02_04.robot | 7 +++++-- .../Entity/QueryEntities/019_02_05.robot | 7 +++++-- .../Entity/QueryEntities/019_03_01.robot | 7 +++++-- .../Entity/QueryEntities/019_03_02.robot | 7 +++++-- .../Entity/QueryEntities/019_03_03.robot | 7 +++++-- .../Entity/QueryEntities/019_03_04.robot | 7 +++++-- .../Entity/QueryEntities/019_03_05.robot | 7 +++++-- .../Consumption/Entity/QueryEntities/019_04.robot | 8 ++++++-- .../Consumption/Entity/QueryEntities/019_05.robot | 8 ++++++-- .../Consumption/Entity/QueryEntities/019_06.robot | 8 ++++++-- .../Entity/RetrieveEntity/018_01_01.robot | 9 ++++++++- .../Entity/RetrieveEntity/018_01_02.robot | 9 ++++++++- .../Entity/RetrieveEntity/018_01_03.robot | 9 ++++++++- .../Entity/RetrieveEntity/018_03_02.robot | 9 ++++++++- .../Consumption/Entity/RetrieveEntity/018_04.robot | 8 ++++++++ .../Consumption/Entity/RetrieveEntity/018_05.robot | 9 ++++++++- .../Consumption/Entity/RetrieveEntity/018_06.robot | 6 +++--- .../QueryTemporalEvolutionOfEntities/021_01.robot | 10 +++++----- .../QueryTemporalEvolutionOfEntities/021_09.robot | 8 ++++---- .../QueryTemporalEvolutionOfEntities/021_11.robot | 10 +++++----- .../QueryTemporalEvolutionOfEntities/021_13.robot | 8 ++++---- .../RetrieveTemporalEvolutionOfEntity/020_04.robot | 6 +++--- .../RetrieveTemporalEvolutionOfEntity/020_05.robot | 6 +++--- .../RetrieveTemporalEvolutionOfEntity/020_09.robot | 6 +++--- .../CreateBatchOfEntities/003_01.robot | 6 +++++- .../CreateBatchOfEntities/003_02.robot | 9 +++++++-- .../CreateBatchOfEntities/003_04.robot | 7 +++++++ .../CreateBatchOfEntities/003_05.robot | 7 +++++++ .../CreateBatchOfEntities/003_07.robot | 7 +++++++ .../UpdateBatchOfEntities/005_01.robot | 6 +++--- .../UpdateBatchOfEntities/005_02.robot | 6 +++--- .../UpdateBatchOfEntities/005_03.robot | 6 +++++- .../UpsertBatchOfEntities/004_01.robot | 5 +++++ .../UpsertBatchOfEntities/004_02.robot | 11 ++++++----- .../UpsertBatchOfEntities/004_03.robot | 6 +++--- .../UpsertBatchOfEntities/004_04.robot | 9 +++++---- .../Provision/Entities/CreateEntity/001_01.robot | 6 +++++- .../Provision/Entities/CreateEntity/001_03.robot | 9 ++++++++- .../AppendEntityAttributes/010_03.robot | 6 +++++- .../DeleteEntityAttribute/013_01.robot | 6 +++++- .../DeleteEntityAttribute/013_02.robot | 9 ++++++--- .../DeleteEntityAttribute/013_03.robot | 7 +++---- .../PartialAttributeUpdate/012_01.robot | 6 +++++- .../PartialAttributeUpdate/012_02.robot | 9 ++++++--- .../PartialAttributeUpdate/012_03.robot | 11 +++++++---- .../UpdateEntityAttributes/011_01.robot | 6 +++++- .../UpdateEntityAttributes/011_03.robot | 7 +++++-- .../007_01.robot | 6 +++++- .../008_01.robot | 9 ++++++++- .../AppendAttributes/014_01.robot | 9 ++++++++- .../AppendAttributes/014_03.robot | 9 ++++++++- .../DeleteAttribute/015_01.robot | 6 +++++- .../DeleteAttribute/015_02.robot | 6 +++--- .../DeleteAttribute/015_03.robot | 11 +++++++---- .../DeleteAttributeInstance/017_01.robot | 8 +++++++- .../DeleteAttributeInstance/017_02.robot | 8 ++++---- .../DeleteAttributeInstance/017_03.robot | 13 ++++++++----- .../ModifyAttributeInstance/016_01.robot | 8 +++++++- .../ModifyAttributeInstance/016_02.robot | 8 ++++---- .../ModifyAttributeInstance/016_03.robot | 8 ++++---- .../Subscription/CreateSubscription/028_01.robot | 7 ++++++- .../Subscription/CreateSubscription/028_03.robot | 6 +++++- .../Subscription/CreateSubscription/028_04.robot | 7 ++++++- .../Subscription/QuerySubscriptions/031_02.robot | 10 +++++----- .../CreateContextSourceRegistration/033_01_01.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_01_02.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_01_03.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_03.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_04.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_05.robot | 9 ++++++++- .../CreateContextSourceRegistration/033_07.robot | 9 ++++++++- .../DeleteContextSourceRegistration/035_02.robot | 5 +++++ .../QueryContextSourceRegistrations/037_01.robot | 8 ++++---- .../QueryContextSourceRegistrations/037_05.robot | 5 ++++- .../QueryContextSourceRegistrations/037_06.robot | 6 +++--- .../QueryContextSourceRegistrations/037_07.robot | 6 +++--- .../QueryContextSourceRegistrations/037_09.robot | 5 ++++- .../QueryContextSourceRegistrations/037_10.robot | 10 +++++----- .../QueryContextSourceRegistrations/037_11.robot | 10 +++++----- .../RetrieveContextSourceRegistration/036_05.robot | 6 +++--- .../UpdateContextSourceRegistration/034_01.robot | 6 +++++- .../UpdateContextSourceRegistration/034_03.robot | 9 ++++++++- .../NotificationBehaviour/047_11.robot | 11 +++++------ .../NotificationBehaviour/047_16.robot | 10 +++++----- .../041_02.robot | 6 +++--- .../041_03.robot | 10 +++++----- .../039_04.robot | 6 +++--- resources/AssertionUtils.resource | 8 ++++++++ 100 files changed, 556 insertions(+), 223 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 6c60bf12..28be18f1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve Available Attributes @@ -38,7 +38,7 @@ Setup Initial Entities ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} Delete Initial Entities Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 3f8cd47c..1dfeced9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve Available Entity Types @@ -46,8 +46,8 @@ Setup Initial Entities ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} + Set Test Variable ${second_entity_id} Delete Initial Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index 557cc53d..409aeb39 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve Details Of Available Attributes @@ -38,7 +38,7 @@ Setup Initial Entities ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} Delete Initial Entities Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index c9b55e30..e75e1f36 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve Details Of Available Entity Types @@ -46,8 +46,8 @@ Setup Initial Entities ... ${second_entity_id} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} + Set Test Variable ${second_entity_id} Delete Initial Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index d09a2f72..c5e99b57 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,18 +20,21 @@ Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} @@ -46,12 +51,11 @@ Query several entities based on ids ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index 5656a2ff..c6b3284a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -24,18 +26,21 @@ Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${building_entity_id} ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${vehicle_entity_id} ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + Set Suite Variable ${parking_entity_id} ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} @@ -49,12 +54,11 @@ Query several entities based on the entities types ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} Delete Entity by Id Returning Response ${building_entity_id} Delete Entity by Id Returning Response ${vehicle_entity_id} Delete Entity by Id Returning Response ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index fbd38643..f14f2d82 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -40,11 +44,10 @@ Query several entities based on the given id pattern ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 064080b4..e4a4b8ed 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -21,12 +23,14 @@ Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename2} ... ${second_entity_id} @@ -38,6 +42,12 @@ Query several entities based on attribute names ... ${attribute_subcategory} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing List Containing Entity elements + ... ${expectation_filename} + ... ${entities_ids_to_be_compared} + ... ${response.json()} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} @@ -48,6 +58,5 @@ Query several entities based on attribute names *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 84abf539..fe67c7db 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -42,11 +46,10 @@ Query several entities based on a list of properties ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index dbb050fb..4121d010 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,18 +20,26 @@ Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} @@ -46,12 +56,11 @@ Query several entities via POST Interaction based on ids ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index edf911ad..e258d448 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -24,18 +26,21 @@ Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${building_entity_id} ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${vehicle_entity_id} ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + Set Suite Variable ${parking_entity_id} ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} @@ -49,12 +54,11 @@ Query several entities via POST Interaction based on the entities types ... ${expectation_filename} ... ${entity_types_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} Delete Entity by Id Returning Response ${building_entity_id} Delete Entity by Id Returning Response ${vehicle_entity_id} Delete Entity by Id Returning Response ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 6643c88e..3e99510f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -40,11 +44,10 @@ Query several entities via POST Interaction based on the given id pattern ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 90fbe9b1..12dc6cbc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -41,11 +45,10 @@ Query several entities via POST Interaction based on attribute names ... ${expectation_filename} ... ${entities_ids_to_be_retrieved} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 9b5473cf..0a9f36bf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -40,11 +44,10 @@ Query several entities via POST Interaction based on a list of properties ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index 23f067ac..4a67b778 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -40,11 +44,10 @@ Query entities based on incorrect ids ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index e324a597..d6b7d2f4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -20,12 +22,14 @@ Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${building_entity_id} ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${vehicle_entity_id} ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} @@ -41,11 +45,10 @@ Query entities based on incorrect entity types ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${building_entity_id} ${vehicle_entity_id} Delete Entity by Id Returning Response ${building_entity_id} Delete Entity by Id Returning Response ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 64d4749a..1a204195 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,12 +20,14 @@ Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -38,11 +42,10 @@ Query several entities based on incorrect id pattern ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 3e1334d6..2b545522 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,12 +21,14 @@ Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -37,11 +41,10 @@ Query several entities based on incorrect attribute names ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index a3bc3987..190d8a8a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -21,12 +23,14 @@ Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} @@ -45,11 +49,10 @@ Query entitites when the request has a wrong geometryProperty ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index fdf6a3b9..6d84cd57 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,18 +21,21 @@ Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} @@ -48,12 +53,11 @@ Query entities in a simplified representation ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 65a42cff..f2f0e280 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,18 +21,21 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} @@ -48,12 +53,11 @@ Get an entity by id that can be returned in a geoJSON format ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index fc5f3018..f2bd2ebd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,18 +20,21 @@ Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} @@ -48,12 +53,11 @@ Query entities specifying a maximum number of results Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Number Of Entities ${entity_type} ${2} ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} + *** Keywords *** Delete Entities - [Arguments] ${first_entity_id} ${second_entity_id} ${third_entity_id} Delete Entity by Id Returning Response ${first_entity_id} Delete Entity by Id Returning Response ${second_entity_id} Delete Entity by Id Returning Response ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index aa405bc9..78fe5637 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -17,6 +19,7 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld [Documentation] Check that you can get an entity by id [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -25,4 +28,8 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index b7fbc456..9140d75b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,6 +21,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego [Documentation] Check that you can query some attributes from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -34,4 +37,8 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego ... attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index a8fa27b2..f255e10c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,6 +20,7 @@ ${geometry_property}= location [Documentation] Check that you can query the geometry property from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -29,4 +32,8 @@ ${geometry_property}= location ... geoproperty=${geometry_property} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 1e3d05d1..4878648e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -17,6 +19,7 @@ Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -32,4 +35,8 @@ Get an entity if an attribute is not known to the system ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 75c6fd20..6d092052 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -18,6 +20,7 @@ Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -30,3 +33,8 @@ Get an entity in a simplified representation Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 45cfc1e8..57caabf5 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -19,6 +21,7 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -27,4 +30,8 @@ Get an entity by id that can be returned in a geoJSON format ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + + +*** Keywords *** +Delete Created Entity + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 00915f13..574aeb46 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entity -Suite Teardown Delete Created Entity +Test Setup Setup Initial Entity +Test Teardown Delete Created Entity Test Template Check JSON-LD Resolution When retrieving an entity @@ -41,7 +41,7 @@ Setup Initial Entity ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} Delete Created Entity Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 3ed7c3af..8e7af978 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Query the temporal evolution of entities @@ -55,9 +55,9 @@ Setup Initial Entities ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} - Set Suite Variable ${third_temporal_entity_representation_id} + Set Test Variable ${first_temporal_entity_representation_id} + Set Test Variable ${second_temporal_entity_representation_id} + Set Test Variable ${third_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 5a485e31..bc439716 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query @@ -54,8 +54,8 @@ Setup Initial Entities Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + Set Test Variable ${first_temporal_entity_representation_id} + Set Test Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 6880dde9..c5021908 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Query the temporal evolution of entities with a limit to the number of entities to be retrieved @@ -52,9 +52,9 @@ Setup Initial Entities Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${third_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} - Set Suite Variable ${third_temporal_entity_representation_id} + Set Test Variable ${first_temporal_entity_representation_id} + Set Test Variable ${second_temporal_entity_representation_id} + Set Test Variable ${third_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 0bb09a1f..a16d151d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Query the temporal evolution of entities using the entityOperations method @@ -48,8 +48,8 @@ Setup Initial Entities Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} - Set Suite Variable ${first_temporal_entity_representation_id} - Set Suite Variable ${second_temporal_entity_representation_id} + Set Test Variable ${first_temporal_entity_representation_id} + Set Test Variable ${second_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 5a2082f2..e7dff655 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query @@ -43,7 +43,7 @@ Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 2b226d09..6789badc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve the temporal evolution of the last N instances of entity attributes @@ -41,7 +41,7 @@ Retrieve the temporal evolution of the last N instances of entity attributes Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index c536d78b..809f9461 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Retrieve the temporal evolution of an entity with an invalid request content @@ -42,7 +42,7 @@ Retrieve the temporal evolution of an entity with an invalid request content Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index d0ae37d4..e47d2862 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entities Test Template Batch Create Entity Scenarios @@ -37,6 +38,7 @@ Batch Create Entity Scenarios @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${response}= Batch Create Entities @{entities_to_be_created} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Set Test Variable @{expected_entities_ids} ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} @@ -46,4 +48,6 @@ Batch Create Entity Scenarios ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Created Resources Set To ${entities_to_be_created} ${response.json()} - ${response}= Batch Delete Entities @{expected_entities_ids} + +Delete Initial Entities + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index f4461c66..df636156 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variables *** @@ -17,7 +18,9 @@ Create a batch of two valid entities and one invalid entity [Documentation] Check that you can create a batch of two valid entities and one invalid entity [Tags] be-create 5_6_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} # TODO: Use Load Test Sample keyword instead ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} @@ -39,8 +42,6 @@ Create a batch of two valid entities and one invalid entity ... accept=${CONTENT_TYPE_LD_JSON} @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} ${response.json()} - @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} *** Keywords *** @@ -48,3 +49,7 @@ Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id} + +Delete Initial Entities + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index f49cea34..4c0bbceb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -15,6 +17,7 @@ Create a batch of one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @@ -30,5 +33,9 @@ Create a batch of one entity using a provided Link header with JSON content type Check Response Body Containing an Attribute set to ... https://ngsi-ld-test-suite/context#almostFull ... ${response.json()} + + +*** Keywords *** +Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index 7e314ac1..33ab8280 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -15,6 +17,7 @@ Create a batch of one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} @@ -25,5 +28,9 @@ Create a batch of one entity using the default context with JSON content type ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull ${response.json()} + + +*** Keywords *** +Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index f63251f1..4f8c24fb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entities + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -15,6 +17,7 @@ Create a batch of one entity using a JSON-LD @context obtained from the request [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] be-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} @@ -27,5 +30,9 @@ Create a batch of one entity using a JSON-LD @context obtained from the request Check Response Body Containing an Attribute set to ... https://ngsi-ld-test-suite/context#almostFull ... ${response.json()} + + +*** Keywords *** +Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${entity_id} ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index ab6cf54a..f6483c89 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -56,9 +56,9 @@ Setup Initial Entities ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_payload_filename} ${first_entity_id} Create Entity ${entity_payload_filename} ${second_entity_id} - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} + Set Test Variable ${second_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 685a3c79..99d1e0d9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -56,9 +56,9 @@ Setup Initial Entities ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${entity_payload_filename} ${first_entity_id} Create Entity ${entity_payload_filename} ${second_entity_id} - Set Suite Variable ${first_entity_id} - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} + Set Test Variable ${second_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index afe3e325..3bc7f37c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -6,6 +6,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variables *** @@ -29,6 +30,7 @@ Update a batch of non-existing and existing entities @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} ${response}= Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + Set Suite Variable @{expected_successful_entities_ids} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} @@ -50,7 +52,6 @@ Update a batch of non-existing and existing entities ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} ${response.json()} - ${response}= Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** @@ -61,3 +62,6 @@ Setup Initial Entities Create Entity ${entity_payload_filename} ${second_existing_entity_id} Set Suite Variable ${first_existing_entity_id} Set Suite Variable ${second_existing_entity_id} + +Delete Initial Entities + Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index a7043f5a..f85bb2c1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entities Test Template Batch Upsert Entity Scenarios @@ -35,6 +36,7 @@ Batch Upsert Entity Scenarios @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Set Test Variable @{expected_entities_ids} Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to ${expected_entities_ids} ${response.json()} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} @@ -45,3 +47,6 @@ Batch Upsert Entity Scenarios ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} ${response}= Batch Delete Entities @{expected_entities_ids} + +Delete Initial Entities + Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index 19822b2c..ae1b57d1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -31,6 +31,7 @@ Batch Upsert Non-existing And Existing Entities Scenarios [Documentation] Check that you can upsert a batch of non-existing and existing entities [Arguments] ${filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${new_entity_id} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @@ -53,17 +54,17 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} ${response.json()} - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} - Set Suite Variable ${first_existing_entity_id} - Set Suite Variable ${second_existing_entity_id} + Set Test Variable ${first_existing_entity_id} + Set Test Variable ${second_existing_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + Batch Delete Entities @{entities_ids_to_be_deleted} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 583cd1d8..15a69521 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -49,9 +49,9 @@ Setup Initial Entities ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} - Set Suite Variable ${first_existing_entity_id} - Set Suite Variable ${second_existing_entity_id} + Set Test Variable ${first_existing_entity_id} + Set Test Variable ${second_existing_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${first_existing_entity_id} ${second_existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 5015d1fa..ce6c2000 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -32,6 +32,7 @@ Batch Upsert Entities With Update Option Scenarios [Documentation] Check that you can upsert a batch of entities with update option [Arguments] ${filename} ${update_fragment_filename} ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${new_entity_id} ${new_entity}= Load Entity ${filename} ${new_entity_id} ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} @@ -51,14 +52,14 @@ Batch Upsert Entities With Update Option Scenarios ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} ${response.json()} - @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity ${existing_entity_payload_filename} ${existing_entity_id} - Set Suite Variable ${existing_entity_id} + Set Test Variable ${existing_entity_id} Delete Initial Entities @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} teardown=True + Batch Delete Entities @{entities_ids_to_be_deleted} + @{entities_ids_to_be_deleted}= Create List ${new_entity_id} + Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 3d17cc43..4305ae59 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entity Test Template Create Entity Scenarios @@ -29,6 +30,7 @@ Create Entity Scenarios [Tags] e-create 5_6_1 [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -46,4 +48,6 @@ Create Entity Scenarios ... context=${ngsild_test_suite_context} END Check Created Resource Set To ${created_entity} ${response.json()} - [Teardown] Delete Entity by Id ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index c100cba8..c99dbf73 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entity + *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: @@ -17,6 +19,7 @@ Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -31,4 +34,8 @@ Create one valid entity and one invalid entity ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id ${entity_id} + + +*** Keywords *** +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index 95e64907..4d78ea05 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entities + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -16,6 +18,7 @@ Append entity attributes when the entity id is not known to the system [Documentation] Check that you cannot append entity attributes if the entity id is not known to the system [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${entity_id} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to @@ -25,4 +28,5 @@ Append entity attributes when the entity id is not known to the system *** Keywords *** - [Teardown] Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 25978e8c..e0835f62 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entities Test Template Delete Attributes @@ -30,6 +31,7 @@ Delete Attributes [Tags] ea-delete 5_6_5 [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -49,4 +51,6 @@ Delete Attributes ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 5a665fbe..2aba5e75 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Delete Attributes @@ -36,8 +37,10 @@ Delete Attributes Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} + Set Test Variable ${valid_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index d41856d2..975a3ba8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities -Suite Teardown Delete Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Delete Attributes @@ -32,11 +32,10 @@ Delete Attributes [Arguments] ${entity_id} ${attribute_id} ${datasetId} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Entity by Id Returning Response ${entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} + Set Test Variable ${valid_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index 82ed9453..44ebeccd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entities Test Template Update Attributes @@ -27,6 +28,7 @@ Update Attributes [Tags] ea-partial-update 5_6_4 [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -45,4 +47,6 @@ Update Attributes ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 626ec9ba..ac541919 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Update Attributes @@ -48,8 +49,10 @@ Update Attributes ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} + Set Test Variable ${valid_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index cc3175e2..13dfe7f1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Entities +Test Setup Setup Initial Entities +Test Teardown Delete Initial Entities Test Template Partial Update Attributes @@ -47,10 +48,12 @@ Partial Update Attributes ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_entity_id} + Set Test Variable ${valid_entity_id} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${not_found_entity_id} + Set Test Variable ${not_found_entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${valid_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index 2801cba5..bece8550 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Initial Entities Test Template Update Attributes @@ -32,6 +33,7 @@ Update Attributes ... ${expectation_response_filename} ... ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} @@ -49,4 +51,6 @@ Update Attributes ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Entity by Id Returning Response ${entity_id} + +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 144d5026..9fe8b4b1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Entities + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -16,7 +18,7 @@ Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Test Variable ${entity_id} + Set Suite Variable ${entity_id} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to @@ -26,4 +28,5 @@ Update entity attributes when the entity id is not known to the system *** Keywords *** - [Teardown] Delete Entity by Id Returning Response ${entity_id} +Delete Initial Entities + Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index e52305a8..8ab2e248 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Temporal Entity Test Template Create Temporal Entity @@ -25,6 +26,7 @@ Create Temporal Entity [Tags] te-create 5_6_11 [Arguments] ${filename} ${expectation_filename} ${content_type} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -49,4 +51,6 @@ Create Temporal Entity ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index b04ba707..3bef8b4f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -18,6 +20,7 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j [Documentation] Check that you can update a temporal representation of an entity with simple temporal properties [Tags] te-update 5_6_11 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -40,4 +43,8 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +*** Keywords *** +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 4e6ea7f9..bee4c7e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -18,6 +20,7 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe [Documentation] Check that you can add a simple temporal attribute to a temporal representation of an entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -40,4 +43,8 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +*** Keywords *** +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index c1d3a16a..9a21c5aa 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -18,6 +20,7 @@ Add Attribute To Temporal Entity [Documentation] Check that an error is raised if you add an attribute to a non-existent entity [Tags] tea-append 5_6_12 ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Suite Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -29,4 +32,8 @@ Add Attribute To Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +*** Keywords *** +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 9b206409..fa70be39 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Temporal Entity Test Template Delete Attribute From A Temporal Entity @@ -30,6 +31,7 @@ Delete Attribute From A Temporal Entity [Tags] tea-delete 5_6_13 [Arguments] ${deleteAll} ${datasetId} ${expectation_filename} ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -55,4 +57,6 @@ Delete Attribute From A Temporal Entity ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index def7efd2..54fbb57e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity +Test Setup Create Temporal Entity +Test Teardown Delete Temporal Entity Test Template Delete attribute from temporal entity with unknow entity/attribute id @@ -49,7 +49,7 @@ Create Temporal Entity ... ${filename} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - Set Suite Variable ${valid_temporal_entity_id} + Set Test Variable ${valid_temporal_entity_id} Delete Temporal Entity Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 7ae8d891..6d77421f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id +Test Setup Create Id +Test Teardown Delete Temporal Entity Test Template Delete Attribute @@ -44,10 +45,12 @@ Delete Attribute ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} Create Id ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${valid_temporal_entity_id} - Set Suite Variable ${unknown_temporal_entity_id} + Set Test Variable ${valid_temporal_entity_id} + Set Test Variable ${unknown_temporal_entity_id} + +Delete Temporal Entity + Delete Temporal Representation Of Entity ${valid_temporal_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index e3ef12a6..c09b96af 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Temporal Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -48,4 +50,8 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +*** Keywords *** +Delete Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 6909b2a6..e155542e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Temporal Entity -Suite Teardown Delete Temporal Entity +Test Setup Create Temporal Entity +Test Teardown Delete Temporal Entity Test Template Delete attribute instance @@ -44,7 +44,7 @@ Delete attribute instance Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -56,7 +56,7 @@ Create Temporal Entity ... sysAttrs ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} + Set Test Variable ${valid_instanceId} Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 8629a98d..480d92d3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -5,7 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id +Test Setup Create Id +Test Teardown Delete Intitial Temporal Representation Of Entity Test Template Delete Attribute Instance @@ -36,22 +37,24 @@ Delete Attribute Instance ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} Check Response Status Code ${status_code} ${response.status_code} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${unknown_temporal_entity_id} + Set Test Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} + Set Test Variable ${valid_instanceId} + +Delete Intitial Temporal Representation Of Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index 19ad0a2c..0b9a64f4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Intitial Temporal Representation Of Entity + *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: @@ -61,4 +63,8 @@ ${attributeId}= speed ... ${temporal_entity_expectation_payload} ... ${response.json()} ... ${ignored_attributes} - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} + + +*** Keywords *** +Delete Intitial Temporal Representation Of Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index 0fd7114a..7933a5b7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity +Test Setup Create Id +Test Teardown Delete Temporal Entity Test Template Modify Attribute Instance Temporal Entity @@ -48,7 +48,7 @@ Modify Attribute Instance Temporal Entity Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${temporal_entity_representation_id} + Set Test Variable ${temporal_entity_representation_id} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${filename} @@ -60,7 +60,7 @@ Create Id ... sysAttrs ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} + Set Test Variable ${valid_instanceId} Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 0433ba9d..34bc191c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Create Id -Suite Teardown Delete Temporal Entity +Test Setup Create Id +Test Teardown Delete Temporal Entity Test Template Modify Attribute Instance Temporal Entity @@ -49,14 +49,14 @@ Create Id ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - Set Suite Variable ${unknown_temporal_entity_id} + Set Test Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} - Set Suite Variable ${valid_instanceId} + Set Test Variable ${valid_instanceId} Delete Temporal Entity Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 0df82096..7b2569d2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Subscriptions + *** Variables *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: @@ -17,6 +19,7 @@ Create Subscription [Documentation] Check that you can create a subscription [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} @@ -27,4 +30,6 @@ Create Subscription ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} Check Created Resource Set To ${expected_subscription} ${response.json()} - [Teardown] Delete Subscription ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index 906c79f2..4a85209c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Subscriptions Test Template Create Subscription With Invalid/Empty Id @@ -23,6 +24,7 @@ Create Subscription With Invalid/Empty Id [Documentation] Check that you cannot create a subscription with an invalid/empty id [Tags] sub-create 5_8_1 [Arguments] ${subscription_id} + Set Suite Variable ${subscription_id} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} @@ -32,4 +34,6 @@ Create Subscription With Invalid/Empty Id ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Subscription ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index 379e27e8..8af0f6e3 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Initial Subscriptions + *** Variables *** ${subscription_id_prefix}= urn:ngsi-ld:Subscription: @@ -16,6 +18,7 @@ Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} @@ -29,4 +32,6 @@ Create a subscription with an id known to the system ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Subscription ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 7cb65072..bf56923c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Subscriptions -Suite Teardown Delete Initial Subscriptions +Test Setup Setup Initial Subscriptions +Test Teardown Delete Initial Subscriptions Test Template Query Subscriptions With Limit And Page Parameters @@ -61,9 +61,9 @@ Setup Initial Subscriptions ... ${third_subscription_id} ... ${third_subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + Set Test Variable ${first_subscription_id} + Set Test Variable ${second_subscription_id} + Set Test Variable ${third_subscription_id} Delete Initial Subscriptions Delete Subscription ${first_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 51a25ad2..b2b2aba7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create Context Source Registration With Specific Date Expiration Date [Documentation] Check that you can create a context source registration with specific ID and expiration date [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} @@ -26,4 +29,8 @@ Create Context Source Registration With Specific Date Expiration Date ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index 87917bd3..2f6edc24 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create Context Source Registration That Never Expires [Documentation] Check that you can create a context source registration that never expires [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} @@ -27,4 +30,8 @@ Create Context Source Registration That Never Expires ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 1ba8d35c..3af5ee3b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -19,6 +21,7 @@ Create Context Source Registration Without A Sprecified ID ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response.status_code} ${registration_id}= Check Response Headers ID Not Empty ${response.headers} + Set Suite Variable ${registration_id} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Retrieve Context Source Registration ... ${registration_id} @@ -26,4 +29,8 @@ Create Context Source Registration Without A Sprecified ID ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index a035d142..ead33a06 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create a context source registration that already exists [Documentation] Check that you cannot create a context source registration that already exists [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${updated_payload} @@ -23,4 +26,8 @@ Create a context source registration that already exists ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index 0f0eb201..7a4ac3e6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create one context source registration using a provided Link header with JSON co [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return @@ -30,4 +33,8 @@ Create one context source registration using a provided Link header with JSON co ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building ... ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index f486086c..a22690bf 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create one context source registration using the default context with JSON conte [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return @@ -29,4 +32,8 @@ Create one context source registration using the default context with JSON conte ... ${response.json()} ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index 77b28786..7af118db 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Create one context source registration using a JSON-LD @context obtained from th [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] csr-create 6_3_5 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return @@ -29,4 +32,8 @@ Create one context source registration using a JSON-LD @context obtained from th ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building ... ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index 67753a4d..b2990bd1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Created Context Source Registrations Test Template Delete Context Source @@ -26,6 +27,7 @@ Delete Context Source [Tags] csr-delete [Arguments] ${invalid_registration_id} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${updated_payload} @@ -34,3 +36,6 @@ Delete Context Source Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 34484615..31f846be 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Test Setup Setup Initial Context Source Registrations +Test Teardown Delete Created Context Source Registrations Test Template Query Context Source Registration @@ -53,8 +53,8 @@ Setup Initial Context Source Registrations ... ${second_context_source_registration_id} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} + Set Test Variable ${first_context_source_registration_id} + Set Test Variable ${second_context_source_registration_id} Delete Created Context Source Registrations Delete Context Source Registration ${first_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index 22b7a7ca..97e3074b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Created Context Source Registration Test Template Query Context Source Registration Matching EntityInfo of RegistrationInfo @@ -41,4 +42,6 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo ... ${expectation_file_path} ... ${expected_context_source_registration_ids} ... ${response.json()} - [Teardown] Delete Context Source Registration ${context_source_registration_id} + +Delete Created Context Source Registration + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 7f803e34..770221b1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Test Setup Setup Initial Context Source Registration +Test Teardown Delete Created Context Source Registration Test Template Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo @@ -45,7 +45,7 @@ Setup Initial Context Source Registration ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} + Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 6cb09ceb..59b26236 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Test Setup Setup Initial Context Source Registration +Test Teardown Delete Created Context Source Registration Test Template Query Context Source Registration Matching Geoquery @@ -47,7 +47,7 @@ Setup Initial Context Source Registration ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} + Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index f5170635..8108216d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Created Context Source Registrations Test Template Query Context Source Registration Matching Temporal Query @@ -53,4 +54,6 @@ Query Context Source Registration Matching Temporal Query ... ${expectation_file_path} ... ${expected_context_source_registration_ids} ... ${response.json()} - [Teardown] Delete Context Source Registration ${context_source_registration_id} + +Delete Created Context Source Registrations + Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index 0becb0ad..b82e5b1c 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Test Setup Setup Initial Context Source Registrations +Test Teardown Delete Created Context Source Registrations Test Template Query Context Source Registration With Query Params @@ -62,9 +62,9 @@ Setup Initial Context Source Registrations Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} Create Context Source Registration ${third_context_source_registration_payload} - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} - Set Suite Variable ${third_context_source_registration_id} + Set Test Variable ${first_context_source_registration_id} + Set Test Variable ${second_context_source_registration_id} + Set Test Variable ${third_context_source_registration_id} Delete Created Context Source Registrations Delete Context Source Registration ${first_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index 4708063f..285bdf69 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registrations -Suite Teardown Delete Created Context Source Registrations +Test Setup Setup Initial Context Source Registrations +Test Teardown Delete Created Context Source Registrations Test Template Query Context Source Registration With Limit And Page Parameters @@ -61,9 +61,9 @@ Setup Initial Context Source Registrations Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} Create Context Source Registration ${third_context_source_registration_payload} - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} - Set Suite Variable ${third_context_source_registration_id} + Set Test Variable ${first_context_source_registration_id} + Set Test Variable ${second_context_source_registration_id} + Set Test Variable ${third_context_source_registration_id} Delete Created Context Source Registrations Delete Context Source Registration ${first_context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 37be8a91..87a9e9a7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration -Suite Teardown Delete Created Context Source Registration +Test Setup Setup Initial Context Source Registration +Test Teardown Delete Created Context Source Registration Test Template Check JSON-LD resolution when retrieving a context source registration @@ -43,7 +43,7 @@ Setup Initial Context Source Registration ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Create Context Source Registration ${context_source_registration_payload} - Set Suite Variable ${context_source_registration_id} + Set Test Variable ${context_source_registration_id} Delete Created Context Source Registration Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 3050f041..97c3c5d8 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Test Teardown Delete Updated Context Source Registration Test Template Update Context Source @@ -25,6 +26,7 @@ Update Context Source [Tags] csr-update [Arguments] ${filename} ${update_filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Test Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} @@ -42,4 +44,6 @@ Update Context Source ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} @context Check Updated Resource Set To ${registration_payload} ${response.json()} ${ignored_attributes} - [Teardown] Delete Context Source Registration ${registration_id} + +Delete Updated Context Source Registration + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index 89d5e80b..519e3bbf 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Suite Teardown Delete Updated Context Source Registration + *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -16,6 +18,7 @@ Update a context source registration by id if the id is not known to the system [Documentation] Check that you cannot update a context source registration by id if the id is not known to the system [Tags] csr-update ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + Set Suite Variable ${registration_id} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return @@ -24,4 +27,8 @@ Update a context source registration by id if the id is not known to the system ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Delete Context Source Registration ${registration_id} + + +*** Keywords *** +Delete Updated Context Source Registration + Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index e2c586b4..df5f1481 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -7,7 +7,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource Suite Setup Start Local Server -Suite Teardown Delete Created Context Source Registrations +Suite Teardown Stop Local Server +Test Teardown Delete Created Context Source Registrations Test Template Receive cSourceNotification For Matching Context Source Registrations On Management Interval @@ -29,23 +30,21 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem [Documentation] Check if a context source registration subscription defines temporalQ member with timeproperty createdAt or modifiedAt, the temporal query is matched against the managementInterval of matching context source registrations [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + Set Suite Variable ${subscription_id} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} - Set Suite Variable ${subscription_id} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} + Set Suite Variable ${context_source_registration_id} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} - Set Suite Variable ${context_source_registration_id} ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} ... ${expected_context_source_registration_ids} ... newlyMatching - # Moved here since each test case creates a subscription - [Teardown] Delete Context Source Registration Subscription ${subscription_id} Delete Created Context Source Registrations - Stop Local Server + Delete Context Source Registration Subscription ${subscription_id} Delete Context Source Registration ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index e680609d..d7760fcd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/NotificationUtils.resource -Suite Setup Setup Initial Context Source Registrations And Subscriptions -Suite Teardown Delete Created Context Source Registrations And Subscriptions +Test Setup Setup Initial Context Source Registrations And Subscriptions +Test Teardown Delete Created Context Source Registrations And Subscriptions Test Template Receive cSourceNotification For Newly Matching Context Source Registrations @@ -58,9 +58,9 @@ Setup Initial Context Source Registrations And Subscriptions Create Context Source Registration Subscription ${subscription_payload} Create Context Source Registration ${first_context_source_registration_payload} Create Context Source Registration ${second_context_source_registration_payload} - Set Suite Variable ${subscription_id} - Set Suite Variable ${first_context_source_registration_id} - Set Suite Variable ${second_context_source_registration_id} + Set Test Variable ${subscription_id} + Set Test Variable ${first_context_source_registration_id} + Set Test Variable ${second_context_source_registration_id} Delete Created Context Source Registrations And Subscriptions Stop Local Server diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index 64c0a027..5635ce39 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Created Context Source Registration Subscriptions Test Template Query Context Source Registration Subscriptions With Limit Parameter @@ -61,7 +61,7 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${third_subscription_payload} Set Suite Variable ${first_subscription_id} Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + Set Test Variable ${third_subscription_id} Delete Created Context Source Registration Subscriptions Delete Context Source Registration Subscription ${first_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index f435b3ab..5eb55de7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Created Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Created Context Source Registration Subscriptions Test Template Query Context Source Registration Subscriptions With Limit And Page Parameters @@ -60,9 +60,9 @@ Setup Initial Context Source Registration Subscriptions Create Context Source Registration Subscription ${first_subscription_payload} Create Context Source Registration Subscription ${second_subscription_payload} Create Context Source Registration Subscription ${third_subscription_payload} - Set Suite Variable ${first_subscription_id} - Set Suite Variable ${second_subscription_id} - Set Suite Variable ${third_subscription_id} + Test Suite Variable ${first_subscription_id} + Test Suite Variable ${second_subscription_id} + Test Suite Variable ${third_subscription_id} Delete Created Context Source Registration Subscriptions Delete Context Source Registration Subscription ${first_subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index 9d21c33a..750e03f3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Suite Setup Setup Initial Context Source Registration Subscriptions -Suite Teardown Delete Initial Context Source Registration Subscriptions +Test Setup Setup Initial Context Source Registration Subscriptions +Test Teardown Delete Initial Context Source Registration Subscriptions Test Template Update Context Source Registration Subscription With Invalid Fragment @@ -41,7 +41,7 @@ Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} ${response}= Create Context Source Registration Subscription ${subscription_payload} - Set Suite Variable ${subscription_id} + Set Test Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions Delete Context Source Registration Subscription ${subscription_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c6dd0a89..7bb0f037 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -26,6 +26,14 @@ Check Response Body Containing Array Of URIs set to Lists Should Be Equal ${expected_entities_ids} ${response_body} ignore_order=True Check Response Body Content + [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} + ${comparison_result}= Compare Dictionaries Ignoring Keys + ... ${entity_payload} + ... ${response_body} + ... ${all_ignored_paths} + Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} -- GitLab From 7475ef0720bd7677d7c9c48a05f2b8f4d202b823 Mon Sep 17 00:00:00 2001 From: gpoujol Date: Thu, 1 Jun 2023 15:53:47 +0200 Subject: [PATCH 300/442] fix: forgot to use argument for one function, reformat some file and fix some errors --- .../Consumption/Entity/QueryEntities/019_01_01.robot | 1 - .../Consumption/Entity/QueryEntities/019_01_02.robot | 1 - .../Consumption/Entity/QueryEntities/019_01_03.robot | 1 - .../Consumption/Entity/QueryEntities/019_01_04.robot | 1 - .../Consumption/Entity/QueryEntities/019_01_05.robot | 1 - .../Consumption/Entity/QueryEntities/019_02_01.robot | 1 - .../Consumption/Entity/QueryEntities/019_02_02.robot | 1 - .../Consumption/Entity/QueryEntities/019_02_03.robot | 1 - .../Consumption/Entity/QueryEntities/019_02_04.robot | 1 - .../Consumption/Entity/QueryEntities/019_02_05.robot | 1 - .../Consumption/Entity/QueryEntities/019_03_01.robot | 1 - .../Consumption/Entity/QueryEntities/019_03_02.robot | 1 - .../Consumption/Entity/QueryEntities/019_03_03.robot | 1 - .../Consumption/Entity/QueryEntities/019_03_04.robot | 1 - .../Consumption/Entity/QueryEntities/019_03_05.robot | 1 - .../Consumption/Entity/QueryEntities/019_04.robot | 1 - .../Consumption/Entity/QueryEntities/019_05.robot | 1 - .../Consumption/Entity/QueryEntities/019_06.robot | 1 - .../Subscription/CreateSubscription/028_01.robot | 2 ++ .../Subscription/CreateSubscription/028_04.robot | 2 ++ .../038_02.robot | 2 +- resources/AssertionUtils.resource | 8 -------- resources/HttpUtils.resource | 3 ++- 23 files changed, 7 insertions(+), 28 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index c5e99b57..ed65fa40 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -53,7 +53,6 @@ Query several entities based on ids ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index c6b3284a..c2f7962c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -56,7 +56,6 @@ Query several entities based on the entities types ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${building_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index f14f2d82..72a618ae 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -46,7 +46,6 @@ Query several entities based on the given id pattern ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index e4a4b8ed..272a1ee7 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -53,7 +53,6 @@ Query several entities based on attribute names ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} - [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index fe67c7db..99cc51c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -48,7 +48,6 @@ Query several entities based on a list of properties ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index 4121d010..cc7199b4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -58,7 +58,6 @@ Query several entities via POST Interaction based on ids ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index e258d448..8c512bbc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -56,7 +56,6 @@ Query several entities via POST Interaction based on the entities types ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${building_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 3e99510f..a1721f0f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -46,7 +46,6 @@ Query several entities via POST Interaction based on the given id pattern ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index 12dc6cbc..24f80776 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -47,7 +47,6 @@ Query several entities via POST Interaction based on attribute names ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 0a9f36bf..341131df 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -46,7 +46,6 @@ Query several entities via POST Interaction based on a list of properties ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index 4a67b778..1dfa4dc1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -46,7 +46,6 @@ Query entities based on incorrect ids Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index d6b7d2f4..dec550f8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -47,7 +47,6 @@ Query entities based on incorrect entity types Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${building_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 1a204195..f676b05f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -44,7 +44,6 @@ Query several entities based on incorrect id pattern Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 2b545522..56c089cb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -43,7 +43,6 @@ Query several entities based on incorrect attribute names Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 190d8a8a..4c037f03 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -51,7 +51,6 @@ Query entitites when the request has a wrong geometryProperty Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index 6d84cd57..84fc6886 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -55,7 +55,6 @@ Query entities in a simplified representation ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index f2f0e280..9b34595b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -55,7 +55,6 @@ Get an entity by id that can be returned in a geoJSON format ... ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index f2bd2ebd..610ec02e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -55,7 +55,6 @@ Query entities specifying a maximum number of results Check Response Body Containing Number Of Entities ${entity_type} ${2} ${response.json()} - *** Keywords *** Delete Entities Delete Entity by Id Returning Response ${first_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 7b2569d2..d932dbce 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -31,5 +31,7 @@ Create Subscription ... context=${ngsild_test_suite_context} Check Created Resource Set To ${expected_subscription} ${response.json()} + +*** Keywords *** Delete Initial Subscriptions Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index 8af0f6e3..b37fbad1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -33,5 +33,7 @@ Create a subscription with an id known to the system ... ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + +*** Keywords *** Delete Initial Subscriptions Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index e54d7e86..5caf4ed3 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -19,7 +19,7 @@ Create Context Source Registration Subscription Without An Id [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${response}= Create Context Source Registration Subscription ${subscription_payload} - ${subscription_id}= Fetch Id From Response Location Header + ${subscription_id}= Fetch Id From Response Location Header ${response.headers} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Set Suite Variable ${subscription_id} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 7bb0f037..c6dd0a89 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -26,14 +26,6 @@ Check Response Body Containing Array Of URIs set to Lists Should Be Equal ${expected_entities_ids} ${response_body} ignore_order=True Check Response Body Content - [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} - ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} - ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${entity_payload} - ... ${response_body} - ... ${all_ignored_paths} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index 1dab3303..8c68b6a0 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -5,5 +5,6 @@ Library String *** Keywords *** Fetch Id From Response Location Header - ${id}= Fetch From Right ${response.headers['Location']} / + [Arguments] ${response_headers} + ${id}= Fetch From Right ${response_headers['Location']} / RETURN ${id} -- GitLab From bc6e8d0105bb9d07ab7af3cb15e894132c2fce44 Mon Sep 17 00:00:00 2001 From: poujol Date: Fri, 30 Jun 2023 16:31:31 +0000 Subject: [PATCH 301/442] feat: improve expected/actual payload when comparing data in checks --- README.md | 13 ++++ libraries/assertionUtils.py | 31 ++++++++ libraries/logUtils.py | 22 ++---- requirements.txt | 1 + resources/ApiUtils.resource | 122 +++++++++++++++--------------- resources/AssertionUtils.resource | 5 +- 6 files changed, 117 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index 3458ff56..a8c5dc5d 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,19 @@ Launch the tests with the following command: For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh). +## Redirect console output to have + +To have the whole messages it is necessary to modify the width of the test execution output with the option --consolewidth (-W). The default width is 78 characters. + +```$ robot --consolewidth 150 .``` + +The messages in the console are clear and without noise, only the strictly necessary (request and response to the CB and a nice message which shows the difference between two documents when they are). +However, it can be difficult to follow all the messages in the console when there is a lot of testing and a lot of CB calls. +This is why a command to redirect the console output to a file can be used. +You must add a chevron at the end of the test launch command followed by the file name. + +```$ robot . > 'results.log``` + ## Generate a documentation for the support keywords ```$ python3 -m robot.libdoc resources/ApiUtils.resource api_docs/ApiUtils.html``` diff --git a/libraries/assertionUtils.py b/libraries/assertionUtils.py index 36fbf0d1..e0ac15dc 100644 --- a/libraries/assertionUtils.py +++ b/libraries/assertionUtils.py @@ -1,4 +1,14 @@ +from dataclasses import dataclass from deepdiff import DeepDiff +from prettydiff import get_annotated_lines_from_diff, diff_json, Flag +from robot.api import logger + + +@dataclass +class Theme: + added: str + removed: str + reset: str def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, group_by=None): @@ -14,4 +24,25 @@ def compare_dictionaries_ignoring_keys(expected, actual, exclude_regex_paths, gr group_by=group_by) else: res = DeepDiff(expected, actual, exclude_regex_paths=exclude_regex_paths, ignore_order=True, verbose_level=1) + + if len(res) > 0: + output_pretty_diff(expected, actual, Theme(added="", removed="", reset="")) return res + + +def output_pretty_diff(a, b, theme, indent_size: int = 2, console=False): + logger.info("Dictionary comparison failed with -> ", also_console=True) + lines = get_annotated_lines_from_diff(diff_json(a, b)) + + msg = "" + for line in lines: + if Flag.ADDED in line.flags: + flags = f"{theme.added}+ " + elif Flag.REMOVED in line.flags: + flags = f"{theme.removed}- " + else: + flags = f"{theme.reset} " + + msg = msg + flags + " " * (indent_size * line.indent) + line.s + "\n" + + logger.info(msg, also_console=True) diff --git a/libraries/logUtils.py b/libraries/logUtils.py index dec7fef5..9254bc59 100644 --- a/libraries/logUtils.py +++ b/libraries/logUtils.py @@ -1,15 +1,15 @@ from __future__ import unicode_literals from __future__ import division -from pygments import highlight, lexers, formatters from json import dumps, JSONDecodeError, loads from robot.api import logger from robot.api.deco import keyword @keyword(name="Output", tags=("I/O",)) -def output(response, console=True): +def output(response, description, console=True): """*Request and response are output to terminal and file (in JSON).* :param response: response to a request + :param description: explains what request is being made :param console: If false, the JSON is not written to terminal. Default is true. """ @@ -34,16 +34,8 @@ def output(response, console=True): pretty_request_json = dumps(request_json, indent=4, sort_keys=False, separators=(",", ": ")) pretty_response_json = dumps(response_json, indent=4, sort_keys=False, separators=(",", ": ")) - logger.info(pretty_request_json) - logger.info(pretty_response_json) - - if console: - pretty_request_json_colored = highlight( - pretty_request_json, lexers.JsonLexer(), formatters.TerminalFormatter() - ) - pretty_response_json_colored = highlight( - pretty_response_json, lexers.JsonLexer(), formatters.TerminalFormatter() - ) - - logger.console(pretty_request_json_colored) - logger.console(pretty_response_json_colored) + logger.info("\n" + description, also_console=True) + logger.info("Request ->", also_console=True) + logger.info(pretty_request_json, also_console=True) + logger.info("Response ->", also_console=True) + logger.info(pretty_response_json, also_console=True) diff --git a/requirements.txt b/requirements.txt index f6f16821..03455a4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ robotframework==6.0.2 robotframework-jsonlibrary==0.5 robotframework-requests==0.9.4 deepdiff==6.3.0 +prettydiff==0.1.0 robotframework-httpctrl==0.3.1 robotframework-tidy==4.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index da6ba285..377a9c85 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -44,13 +44,13 @@ ${response} ${EMPTY} Delete Entity by Id Returning Response [Arguments] ${id} ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any - Output ${response} + Output ${response} Delete Entity by Id Returning Response RETURN ${response} Delete Entity by Id [Arguments] ${id} ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any - Output ${response} + Output ${response} Delete Entity by Id RETURN ${response} Query Entity @@ -87,7 +87,7 @@ Query Entity ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Entity RETURN ${response} Query Entities @@ -149,7 +149,7 @@ Query Entities ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Entities RETURN ${response} Query Entities Via POST @@ -184,7 +184,7 @@ Query Entities Via POST ... json=${params} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Query Entities Via POST RETURN ${response} Retrieve Entity by Id @@ -197,7 +197,7 @@ Retrieve Entity by Id ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${response}= GET url=${url}/${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Output ${response} + Output ${response} Retrieve Entity by Id RETURN ${response} Create Entity Selecting Content Type @@ -218,7 +218,7 @@ Create Entity Selecting Content Type ... json=${entity} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Entity Selecting Content Type RETURN ${response} Append Entity Attributes @@ -230,7 +230,7 @@ Append Entity Attributes ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Append Entity Attributes RETURN ${response} Append Entity Attributes With Parameters @@ -242,7 +242,7 @@ Append Entity Attributes With Parameters ... json=${fragment_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Append Entity Attributes With Parameters RETURN ${response} Update Entity Attributes @@ -254,7 +254,7 @@ Update Entity Attributes ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Update Entity Attributes RETURN ${response} Delete Entity Attributes @@ -277,7 +277,7 @@ Delete Entity Attributes ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Delete Entity Attributes RETURN ${response} Partial Update Entity Attributes @@ -303,7 +303,7 @@ Partial Update Entity Attributes ... json=${fragment_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Partial Update Entity Attributes RETURN ${response} Retrieve Entity Types @@ -325,7 +325,7 @@ Retrieve Entity Types ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Retrieve Entity Types RETURN ${response} Retrieve Entity Type @@ -344,7 +344,7 @@ Retrieve Entity Type ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Retrieve Entity Type RETURN ${response} Retrieve Attributes @@ -366,7 +366,7 @@ Retrieve Attributes ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Retrieve Attributes RETURN ${response} Retrieve Attribute @@ -385,7 +385,7 @@ Retrieve Attribute ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Retrieve Attribute RETURN ${response} Create Context Source Registration With Return @@ -404,7 +404,7 @@ Create Context Source Registration With Return ... json=${payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Context Source Registration RETURN ${response} Update Context Source Registration With Return @@ -416,7 +416,7 @@ Update Context Source Registration With Return ... json=${fragment} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Update Context Source Registration RETURN ${response} Delete Context Source Registration With Return @@ -424,7 +424,7 @@ Delete Context Source Registration With Return ${response}= DELETE ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} ... expected_status=any - Output ${response} + Output ${response} Delete Context Source Registration RETURN ${response} Create Entity @@ -437,7 +437,7 @@ Create Entity ... json=${entity} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Entity RETURN ${response} Create Or Update Temporal Representation Of Entity Selecting Content Type @@ -456,7 +456,7 @@ Create Or Update Temporal Representation Of Entity Selecting Content Type ... json=${temporal_entity_representation} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Or Update Temporal Representation Of Entity Selecting Content Type RETURN ${response} Create Temporal Representation Of Entity Selecting Content Type @@ -468,7 +468,7 @@ Create Temporal Representation Of Entity Selecting Content Type ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Temporal Representation Of Entity Selecting Content Type RETURN ${response} Append Attribute To Temporal Entity @@ -480,7 +480,7 @@ Append Attribute To Temporal Entity ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Append Attribute To Temporal Entity RETURN ${response} Modify Attribute Instance From Temporal Entity @@ -503,7 +503,7 @@ Modify Attribute Instance From Temporal Entity ... json=${fragment_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Modify Attribute Instance From Temporal Entity RETURN ${response} Delete Attribute From Temporal Entity @@ -532,7 +532,7 @@ Delete Attribute From Temporal Entity ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Delete Attribute From Temporal Entity RETURN ${response} Delete Temporal Representation Of Entity With Returning Response @@ -540,7 +540,7 @@ Delete Temporal Representation Of Entity With Returning Response ${response}= DELETE ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... expected_status=any - Output ${response} + Output ${response} Delete Temporal Representation Of Entity RETURN ${response} Get Temporal Representation Of Entity @@ -568,7 +568,7 @@ Get Temporal Representation Of Entity ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Get Temporal Representation Of Entity RETURN ${response} Delete Attribute Instance From Temporal Entity @@ -583,7 +583,7 @@ Delete Attribute Instance From Temporal Entity ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Delete Attribute Instance From Temporal Entity RETURN ${response} Update Temporal Representation Of Entity Selecting Content Type @@ -601,7 +601,7 @@ Update Temporal Representation Of Entity Selecting Content Type ... json=${temporal_entity_fragment} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Update Temporal Representation Of Entity Selecting Content Type RETURN ${response} Batch Create Entities @@ -625,7 +625,7 @@ Batch Create Entities ... json=@{entities_to_be_created} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Batch Create Entities RETURN ${response} Batch Upsert Entities @@ -636,7 +636,7 @@ Batch Upsert Entities ... json=@{entities_to_be_upserted} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Batch Upsert Entities RETURN ${response} Batch Update Entities @@ -647,7 +647,7 @@ Batch Update Entities ... json=@{entities_to_be_updated} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Batch Update Entities RETURN ${response} Batch Delete Entities @@ -658,7 +658,7 @@ Batch Delete Entities ... json=@{entities_ids_to_be_deleted} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Batch Delete Entities RETURN ${response} Request Entity From File @@ -670,7 +670,7 @@ Request Entity From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Request Entity From File RETURN ${response} Batch Request Entities From File @@ -683,7 +683,7 @@ Batch Request Entities From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Batch Request Entities From File RETURN ${response} Create Temporal Representation Of Entity @@ -700,7 +700,7 @@ Create Temporal Representation Of Entity ... json=${temporal_entity_representation} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Temporal Representation Of Entity RETURN ${response} Retrieve Temporal Representation Of Entity @@ -743,7 +743,7 @@ Retrieve Temporal Representation Of Entity ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Retrieve Temporal Representation Of Entity RETURN ${response} Query Temporal Representation Of Entities @@ -811,7 +811,7 @@ Query Temporal Representation Of Entities ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Temporal Representation Of Entities RETURN ${response} Query Temporal Representation Of Entities Via Post @@ -827,7 +827,7 @@ Query Temporal Representation Of Entities Via Post ... json=${query_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Query Temporal Representation Of Entities Via Post RETURN ${response} Delete Temporal Representation Of Entity @@ -836,7 +836,7 @@ Delete Temporal Representation Of Entity ${response}= DELETE ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... expected_status=any - Output ${response} + Output ${response} Delete Temporal Representation Of Entity RETURN ${response} Create Context Source Registration @@ -848,7 +848,7 @@ Create Context Source Registration ... json=${context_source_registration_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Context Source Registration RETURN ${response} Update Context Source Registration @@ -858,7 +858,7 @@ Update Context Source Registration ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... json=${update_fragment} ... expected_status=any - Output ${response} + Output ${response} Update Context Source Registration RETURN ${response} Query Context Source Registrations @@ -918,14 +918,14 @@ Query Context Source Registrations ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Context Source Registrations RETURN ${response} Delete Context Source Registration [Arguments] ${context_source_registration_id} ${response}= DELETE url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output ${response} + Output ${response} Delete Context Source Registration RETURN ${response} Retrieve Context Source Registration @@ -942,7 +942,7 @@ Retrieve Context Source Registration ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Retrieve Context Source Registration RETURN ${response} Create Context Source Registration Subscription @@ -957,7 +957,7 @@ Create Context Source Registration Subscription ... json=${subscription_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Context Source Registration Subscription RETURN ${response} Update Context Source Registration Subscription @@ -967,7 +967,7 @@ Update Context Source Registration Subscription ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... json=${subscription_update_fragment} ... expected_status=any - Output ${response} + Output ${response} Update Context Source Registration Subscription RETURN ${response} Retrieve Context Source Registration Subscription @@ -984,7 +984,7 @@ Retrieve Context Source Registration Subscription ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Retrieve Context Source Registration Subscription RETURN ${response} Query Context Source Registration Subscriptions @@ -1006,14 +1006,14 @@ Query Context Source Registration Subscriptions ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Context Source Registration Subscriptions RETURN ${response} Delete Context Source Registration Subscription [Arguments] ${subscription_id} ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output ${response} + Output ${response} Delete Context Source Registration Subscription RETURN ${response} Update Context Source Registration Subscription From File @@ -1023,7 +1023,7 @@ Update Context Source Registration Subscription From File ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... data=${file_content} ... expected_status=any - Output ${response} + Output ${response} Update Context Source Registration Subscription From File RETURN ${response} Create Subscription @@ -1049,7 +1049,7 @@ Create Subscription ... json=${subscription} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Subscription RETURN ${response} Create Subscription From Subscription Payload @@ -1072,7 +1072,7 @@ Create Subscription From Subscription Payload ... json=${subscription_payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Subscription From Subscription Payload RETURN ${response} Create Subscription From File @@ -1084,7 +1084,7 @@ Create Subscription From File ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Create Subscription From File RETURN ${response} Update Subscription @@ -1109,7 +1109,7 @@ Update Subscription ... json=${subscription_update_fragment} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Update Subscription RETURN ${response} Update Subscription With Payload @@ -1128,13 +1128,13 @@ Update Subscription With Payload ... json=${payload} ... headers=${headers} ... expected_status=any - Output ${response} + Output ${response} Update Subscription With Payload RETURN ${response} Delete Subscription [Arguments] ${subscription_id} ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any - Output ${response} + Output ${response} Delete Subscription RETURN ${response} Query Subscriptions @@ -1158,7 +1158,7 @@ Query Subscriptions ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Subscriptions RETURN ${response} Retrieve Subscription @@ -1175,7 +1175,7 @@ Retrieve Subscription END ${response}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any - Output ${response} + Output ${response} Retrieve Subscription RETURN ${response} Query Context Source Registrations With Return @@ -1235,7 +1235,7 @@ Query Context Source Registrations With Return ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Context Source Registrations RETURN ${response} Query Temporal Representation Of Entities With Return @@ -1303,5 +1303,5 @@ Query Temporal Representation Of Entities With Return ... headers=${headers} ... params=${params} ... expected_status=any - Output ${response} + Output ${response} Query Temporal Representation Of Entities RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index c6dd0a89..52faa52c 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -19,7 +19,10 @@ ${status_regex_expr}= root\\['status'\\] Check Response Status Code [Arguments] ${expected_status_code} ${response_status_code} ${response_status_code}= convert to string ${response_status_code} - Should Be Equal ${expected_status_code} ${response_status_code} + Should Be Equal + ... ${expected_status_code} + ... ${response_status_code} + ... HTTP status code comparison failed with (expected, actual) -> Check Response Body Containing Array Of URIs set to [Arguments] ${expected_entities_ids} ${response_body} -- GitLab From 428ac458bd80e1f97a2bd11e7ff88b7c2b4dcdea Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 19 Jul 2023 12:34:25 +0200 Subject: [PATCH 302/442] fix: invalid fragment when doing a partial attribute update --- .../fragmentEntities/vehicle-brandname-fragment.json | 6 ++---- .../fragmentEntities/vehicle-brandname-fragment.jsonld | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.json b/data/entities/fragmentEntities/vehicle-brandname-fragment.json index cfa70d67..d513c213 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.json +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.json @@ -1,6 +1,4 @@ { - "brandName": { - "type": "Property", - "value": "BMW" - } + "type": "Property", + "value": "BMW" } \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index f9a73524..83729e51 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -1,7 +1,5 @@ { - "brandName": { - "type": "Property", - "value": "BMW" - }, + "type": "Property", + "value": "BMW", "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } \ No newline at end of file -- GitLab From 19a14aaedaa161e8d7efb425efd9bcee1c8d5c3a Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 3 Aug 2023 06:54:22 +0200 Subject: [PATCH 303/442] fix(043): call batch entity delete with list of ids to delete --- TP/NGSI-LD/CommonBehaviours/043.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 62b9ef0a..9e079072 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -69,13 +69,14 @@ ${registration_filename}= csourceRegistrations/context-source-registration ${first_entity}= Load Entity ${building_filename} ${first_entity_id} ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + @{entities_ids_to_be_created}= Create List ${first_entity_id} ${second_entity_id} ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} - [Teardown] Batch Delete Entities @{entities_to_be_created} + [Teardown] Batch Delete Entities @{entities_ids_to_be_created} 043_05 Create context source registration [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration) -- GitLab From aac966e6fc18386fdf1ca4bb6a59a23e812d4ccf Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 8 Aug 2023 08:03:53 +0200 Subject: [PATCH 304/442] chore: remove unused test data files --- ...t-source-registration-update-sample.jsonld | 6 - data/entities/building-minimal.jsonld | 8 -- data/entities/building-no-attributes.jsonld | 11 -- data/entities/building-relationship.jsonld | 12 -- .../vehicle-parking-sample-expectation.json | 54 -------- .../vehicle-empty-fragment.jsonld | 2 - ...subscription-building-entities-sample.json | 15 --- ...epresentation-021-11-01-expectation.jsonld | 78 ------------ ...epresentation-021-11-02-expectation.jsonld | 116 ------------------ ...fied-temporal-representation-sample.jsonld | 21 ---- ...cle-temporal-invalid-context-sample.jsonld | 41 ------- ...presentation-without-context-sample.jsonld | 38 ------ 12 files changed, 402 deletions(-) delete mode 100644 data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld delete mode 100644 data/entities/building-minimal.jsonld delete mode 100644 data/entities/building-no-attributes.jsonld delete mode 100644 data/entities/building-relationship.jsonld delete mode 100644 data/entities/expectations/vehicle-parking-sample-expectation.json delete mode 100644 data/entities/fragmentEntities/vehicle-empty-fragment.jsonld delete mode 100644 data/subscriptions/fragments/subscription-building-entities-sample.json delete mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld delete mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld delete mode 100644 data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld delete mode 100644 data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld delete mode 100644 data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld diff --git a/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld b/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld deleted file mode 100644 index 795d209e..00000000 --- a/data/csourceRegistrations/fragments/context-source-registration-update-sample.jsonld +++ /dev/null @@ -1,6 +0,0 @@ -{ - "endpoint":"http://my.new.csource.org:1026", - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/building-minimal.jsonld b/data/entities/building-minimal.jsonld deleted file mode 100644 index 3de15791..00000000 --- a/data/entities/building-minimal.jsonld +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/building-no-attributes.jsonld b/data/entities/building-no-attributes.jsonld deleted file mode 100644 index 42c0f2af..00000000 --- a/data/entities/building-no-attributes.jsonld +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/building-relationship.jsonld b/data/entities/building-relationship.jsonld deleted file mode 100644 index d2151f1e..00000000 --- a/data/entities/building-relationship.jsonld +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", - "type": "Building", - "locatedAt": { - "type": "Relationship", - "object": "urn:ngsi-ld:City:Paris" - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" - ] -} \ No newline at end of file diff --git a/data/entities/expectations/vehicle-parking-sample-expectation.json b/data/entities/expectations/vehicle-parking-sample-expectation.json deleted file mode 100644 index 0205a53f..00000000 --- a/data/entities/expectations/vehicle-parking-sample-expectation.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "urn:ngsi-ld:OffStreetParking:randomUUID", - "type": "https://ngsi-ld-test-suite/context#OffStreetParking", - "availableSpotNumber": { - "type": "Property", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Camera:C1" - }, - "reliability": { - "type": "Property", - "value": 0.7 - }, - "value": 121, - "observedAt": "2017-07-29T12:05:02Z" - }, - "totalSpotNumber": { - "type": "Property", - "value": 200 - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -8.5, - 41.2 - ] - } - }, - "name": { - "type": "Property", - "value": "Downtown One" - } - }, - { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Vehicle", - "https://ngsi-ld-test-suite/context#brandName": { - "type": "Property", - "value": "Mercedes" - }, - "isParked": { - "type": "Relationship", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - }, - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z" - } - } -] \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-empty-fragment.jsonld b/data/entities/fragmentEntities/vehicle-empty-fragment.jsonld deleted file mode 100644 index 7a73a41b..00000000 --- a/data/entities/fragmentEntities/vehicle-empty-fragment.jsonld +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/data/subscriptions/fragments/subscription-building-entities-sample.json b/data/subscriptions/fragments/subscription-building-entities-sample.json deleted file mode 100644 index b6630a1f..00000000 --- a/data/subscriptions/fragments/subscription-building-entities-sample.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type":"Subscription", - "entities":[ - { - "type":"Building" - } - ], - "notification":{ - "format":"keyValues", - "endpoint":{ - "uri":"http://my.endpoint.org/notify", - "accept":"application/json" - } - } -} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld deleted file mode 100644 index 5044fa08..00000000 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-01-expectation.jsonld +++ /dev/null @@ -1,78 +0,0 @@ -[ - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - } - ] - }, - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "fuelLevel":[ - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ] - } -] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld deleted file mode 100644 index e48ad9d2..00000000 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-11-02-expectation.jsonld +++ /dev/null @@ -1,116 +0,0 @@ -[ - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - } - ] - }, - { - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "fuelLevel":[ - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ] - }, - { - "id":"urn:ngsi-ld:Bus:randomUUID", - "type":"Bus", - "fuelLevel":[ - { - "type":"Property", - "value":210, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":145, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":124, - "observedAt":"2020-08-01T14:07:00Z" - } - ], - "speed":[ - { - "type":"Property", - "value":45, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":25, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:07:00Z" - } - ] - } -] \ No newline at end of file diff --git a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld deleted file mode 100644 index 8ffa880f..00000000 --- a/data/temporalEntities/vehicle-simplified-temporal-representation-sample.jsonld +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { - "type": "Property", - "values": [ - ["Volvo",""] - ] - }, - "speed": { - "type": "Property", - "values": [ - [120,"2018-08-01T12:03:00Z"], - [80,"2018-08-01T12:05:00Z"], - [100,"2018-08-01T12:07:00Z"] - ] - }, - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] -} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld deleted file mode 100644 index 33659f6b..00000000 --- a/data/temporalEntities/vehicle-temporal-invalid-context-sample.jsonld +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ], - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" - } - ], - "@context":[ - "invalidcontext" - ] -} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld deleted file mode 100644 index b50a1eab..00000000 --- a/data/temporalEntities/vehicle-temporal-representation-without-context-sample.jsonld +++ /dev/null @@ -1,38 +0,0 @@ -{ - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type":"Vehicle", - "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-09-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-09-01T12:07:00Z" - } - ], - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-09-01T14:07:00Z" - } - ] -} \ No newline at end of file -- GitLab From ecb8a41881aa9502c7bd28d2f765803de21f2b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20L=C3=B3pez=20Aguilar?= Date: Mon, 28 Aug 2023 15:09:07 +0200 Subject: [PATCH 305/442] First version of the ErrorListener --- .gitignore | 2 +- libraries/ErrorListener.py | 53 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 8 +++--- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 libraries/ErrorListener.py diff --git a/.gitignore b/.gitignore index 5393a5e1..d4b2af99 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ resources/__pycache__ results *.pyc *.http -.vscode/ \ No newline at end of file +.vscode/ diff --git a/libraries/ErrorListener.py b/libraries/ErrorListener.py new file mode 100644 index 00000000..6cd09f11 --- /dev/null +++ b/libraries/ErrorListener.py @@ -0,0 +1,53 @@ +from os.path import join +from os import getcwd +from re import compile, match, MULTILINE + + +class ErrorListener: + ROBOT_LISTENER_API_VERSION = 2 + + def __init__(self, filename='errors.log'): + self.cwd = getcwd() + out_path = join('results', filename) + self.max_length = 150 + self.outfile = open(out_path, 'w') + self.tests = str() + self.suite_name = str() + self.rx_dict = { + 'variables': compile('^\${.*$|^\&{.*$|^\@{.*'), + 'http_verbs': compile('^GET.*(Request|Response).*$|' + '^HEAD.*(Request|Response).*$|' + '^POST.*(Request|Response).*$|' + '^PUT.*(Request|Response).*$|' + '^DELETE.*(Request|Response).*$|' + '^CONNECT.*(Request|Response).*$|' + '^OPTIONS.*(Request|Response).*$|' + '^TRACE.*(Request|Response).*$|' + '^PATCH.*(Request|Response).*$', MULTILINE) + } + + def start_suite(self, name, attrs): + self.suite_name = attrs['source'].replace(self.cwd, '')[1:].replace('.robot', '').replace('/', ".") + self.outfile.write(f'{"=" * self.max_length}\n') + self.outfile.write(f'{self.suite_name} :: {attrs["doc"]}\n') + self.outfile.write(f'{"=" * self.max_length}\n') + + def start_test(self, name, attrs): + self.tests = f"{name} :: {attrs['doc']}\n" + + def end_test(self, name, attrs): + if attrs['status'] != 'PASS': + self.outfile.write(self.tests) + self.outfile.write(f'| FAIL |\n{attrs["message"]}\n') + self.outfile.write(f'{"-" * self.max_length}\n') + + def end_suite(self, name, attrs): + self.outfile.write(f'{self.suite_name} :: {attrs["doc"]}... | {attrs["status"]} |\n{attrs["statistics"]}\n') + + def log_message(self, msg): + if (not match(pattern=self.rx_dict['variables'], string=msg['message']) and + not match(pattern=self.rx_dict['http_verbs'], string=msg['message'])): + self.outfile.write(f'{msg["message"]}\n') + + def close(self): + self.outfile.close() diff --git a/requirements.txt b/requirements.txt index 03455a4f..686ff92b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ # python3.10 project -robotframework==6.0.2 +robotframework==6.1.1 robotframework-jsonlibrary==0.5 -robotframework-requests==0.9.4 -deepdiff==6.3.0 +robotframework-requests==0.9.5 +deepdiff==6.3.1 prettydiff==0.1.0 robotframework-httpctrl==0.3.1 -robotframework-tidy==4.2.1 +robotframework-tidy==4.5.0 -- GitLab From 432f92f97b88f41788c0ab1ab690abc1930bfd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20L=C3=B3pez=20Aguilar?= Date: Mon, 28 Aug 2023 16:53:56 +0200 Subject: [PATCH 306/442] Update the content and adding PyCharm Execution Configurations --- .../Run_All_tests_with_Listener.xml | 19 +++++++++++++++++++ .../Run_Current_Test_Suite.xml | 17 +++++++++++++++++ .../Run_Current_Test_Suite_with_Listener.xml | 19 +++++++++++++++++++ resources/variables.py | 2 +- scripts/run_tests.sh | 14 ++++++++++---- 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .idea/runConfigurations/Run_All_tests_with_Listener.xml create mode 100644 .idea/runConfigurations/Run_Current_Test_Suite.xml create mode 100644 .idea/runConfigurations/Run_Current_Test_Suite_with_Listener.xml diff --git a/.idea/runConfigurations/Run_All_tests_with_Listener.xml b/.idea/runConfigurations/Run_All_tests_with_Listener.xml new file mode 100644 index 00000000..dbf173a6 --- /dev/null +++ b/.idea/runConfigurations/Run_All_tests_with_Listener.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run_Current_Test_Suite.xml b/.idea/runConfigurations/Run_Current_Test_Suite.xml new file mode 100644 index 00000000..43a559bb --- /dev/null +++ b/.idea/runConfigurations/Run_Current_Test_Suite.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run_Current_Test_Suite_with_Listener.xml b/.idea/runConfigurations/Run_Current_Test_Suite_with_Listener.xml new file mode 100644 index 00000000..538e85be --- /dev/null +++ b/.idea/runConfigurations/Run_Current_Test_Suite_with_Listener.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/resources/variables.py b/resources/variables.py index f0c933b8..017b8eb2 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,4 +1,4 @@ -url = 'localhost:8080/ngsi-ld/v1' +url = 'http://localhost:8080/ngsi-ld/v1' ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' notification_server_host = '0.0.0.0' notification_server_port = 8085 diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 6216528f..f5f3432a 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -9,19 +9,25 @@ robot --variable url:"URL_HERE" --outputdir ./results . # run by specific tag(s) robot --include mandatory --outputdir ./results . -# run all the tests for context information +# run all the test suites for context information robot --outputdir ./results ./TP/NGSI-LD/ContextInformation -# run a specific test case +# run a specific test suite robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot robot --outputdir ./results --suite 001_01 . -# run specific test case +# run specific test suite robot --outputdir ./results -t "SuccessCases_MinimalEntity" robot --outputdir ./results -t "SuccessCases_MinimalEntity" ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot -# rerun failed tests +# rerun failed test cases robot --rerunfailedsuites ./results/output.xml --outputdir ./results . # stop the suite after a failed test robot --exitonfailure --outputdir ./results . + +# run specific test suite and generate errors.log file with the output only of the failed test cases +robot --listener libraries/ErrorListener.py --outputdir ./results ./TP/NGSI-LD/CommonBehaviours/043.robot + +# run all test suites and generate errors.log file with the output only of the failed test cases +robot --listener libraries/ErrorListener.py --outputdir ./results . -- GitLab From 036be6c0150b143bc87971111de5c3489c58bb31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20L=C3=B3pez=20Aguilar?= Date: Mon, 28 Aug 2023 16:55:44 +0200 Subject: [PATCH 307/442] Rename Pycharm Execution Configuration --- ..._with_Listener.xml => Run_All_Test_Suites_with_Listener.xml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .idea/runConfigurations/{Run_All_tests_with_Listener.xml => Run_All_Test_Suites_with_Listener.xml} (79%) diff --git a/.idea/runConfigurations/Run_All_tests_with_Listener.xml b/.idea/runConfigurations/Run_All_Test_Suites_with_Listener.xml similarity index 79% rename from .idea/runConfigurations/Run_All_tests_with_Listener.xml rename to .idea/runConfigurations/Run_All_Test_Suites_with_Listener.xml index dbf173a6..b718676e 100644 --- a/.idea/runConfigurations/Run_All_tests_with_Listener.xml +++ b/.idea/runConfigurations/Run_All_Test_Suites_with_Listener.xml @@ -1,5 +1,5 @@ - +