diff --git a/.idea/runConfigurations/Check_Format.xml b/.idea/runConfigurations/Check_Format.xml new file mode 100644 index 0000000000000000000000000000000000000000..dbdb34d8daf196e7ba0cad1efeeea6ec1718d3fd --- /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 0000000000000000000000000000000000000000..e5c737c29a87c0b93ba74906361ab82566eab6bc --- /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 0000000000000000000000000000000000000000..54f26c88965d325bd01566ec7a4ef2d16de86169 --- /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 3c0126f67e6b7635268eff42393d99249717b138..5c314cd01fb1f2c4dfe21093a41f7b9694eebc80 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 d3b2f18bcb2e946cb937aee3394adf0874374fcf..3643488adeca45020f32cc0900f8efc7be846988 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 6101bbdbfd18b6a6de2c9e4afa020c5a55b8e614..32b3ecf94c7da3bb6010bad0e681711fd58a8537 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 0793a1715b058835739da4070cf54947a3fd6421..475f650890ae640b7b068fad20a94be2e6165f1c 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 efc916b2d7242d3dd8e362a04e8d51d7cd9200a8..f0b6139347ba4cb93ff67267c062b66b28a86792 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 a46c31c43d5414e09942d79db9ddbed2a3a49193..1f8b1b7ea3b37e680b3e346609aef5b0efabb463 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 f8b63f4989688fd072f9569c4c6849c298332e9f..20f32c376cb2068392657a4a27b9bd4af5a176c8 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 f4cf0a399d2bf0ffdf1ed63345ba5739c133d441..cf01a3124055072551cb948de2532d43c66c58b6 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 1cf3cc6c32d652ff1344a170abc830b8f3f9c701..c2fb70836544878b54107f035bdd613cb22c8b49 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 be48c9dd7e9043551f8b8fe078a80112c33285f5..17bb74b3ee7ef7b9ed3618ba70f884d9b57c29ce 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 850b8d6fc9a9f7eb4d7b9c3d982cabcca312bf79..2ba0b2bf52f229c4f01efb1d446576197034e8e4 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 fe9979339576f142cbb10dbc352607fcc3c631e6..761260d91325193659882abb4d8400f7b6ac5a68 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 e3a33a8e348acc9f166585ee143e769c12383c33..22b2d42a478d06d09c2b411872083bcdba194683 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 e6df2a5c022d4b96de95fee8c48f687ce5b018b6..77ac8a2d6f00314b0ae66ad3424b0701c53fb44f 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 b03c52f33183a07c62fce4a88f6c41a7e430b64b..3f76ca0e3feeb41b08326c2d74c1427e8c7dd91c 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 ddecc8f56acbbb960adf475faef90be0ed393516..6a44b0d9cf373f5f24c88461034d4becab7cc12e 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 1bbc2efd58b8e2fb6b21530a6fce196e2822cd2d..a33dd671fd6a21bc336227303f129dc8988d2991 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 9e10a94af2bf427d860ab97245b5e8eca347f627..e4dece98b0fd5994b4168c78ead7da2958a08a42 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 65ac38842c03b2345704ad7fbacd2a66ed48a824..1cdc121f3338f860c40c89512c271b1cc6df35aa 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 9a8d7ab3e226e8f643a0dd7a66391a0166e37ea1..754d15c24a01810b7ab5904a3a69f3424dfcc7e1 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 f194aab7ae0600a30a12b03564047ee843a568ca..f27065ef50d6474e4e4917df00b6a3670ae24f0e 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 f5a903a517b833d75239d041f9d7d128739904ca..854ba8a4b7266648e9c19be6c13a5a20284a9961 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 38397fdf82eb570bd627a0552c7cb158cf05af4b..32450318c67bbb8aab58abd339bdb3ae097fafe9 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 04edd2e6cb3e18e75d4b2c5b3292c3def1dfdf31..bc09646de39b302c7df3140e1947ddbc89f8a751 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 8a7c482822c502c4859be2f56771cf6fd300d88d..b4d9dfe6ccee771c64f86161974194f6dbbf303e 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 b1fe076540174065a8cdbdfd965c84e33c78fafd..1538368d06bd709f75e68b6ab869d7b91949a4a4 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 4e9e3e3d34c4a367c94f9c4daa51fe7da141f6ee..c6e8d8d253ebd59caead8b67df9375c62a1ea0f8 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 9c86bba127612a4d74ff36d7a48201d7eeb5dd4a..2ab80b97e25a94b28620df61022c83bbb784f2a3 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 db5abf461218edd51aa2614f61acf740475f3266..12ab098d9448bf8a037fd3793727b0231c5ff678 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 f603c3f1d4e5768f6ea7dabc314ea88da1ec0d74..1f1255e1bd6d7ae9af21de2aa79bc44db99ac56c 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 4dd311ff499772d360415882c57aa3041229af45..9cb3a2af30373ea2f8f0544a2b664135736f7a7d 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 9fa6c4eb4e184bd7d9856fe72974af498f895804..b903862fe4b5bfa7da28c411dfb9736574bbe4b4 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 7ac6e809e58fdf6f4ab180a355ba887f85480608..7d239a2989dd51aa6e7d6a14c3fbfd5e3ec89a68 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 f1d81a931782558cd7a95f53e6a93d7edb9c02ec..981201953ea247704fdbcde7450a187699704562 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 a4badafb0bed5eb87d71dd67fa1a14dff20ae292..88ea67fa7f3543126d374746a8f847ddd87e41a2 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 ba2888ba41aa41aa2a14a2df70cee6a14274116e..2b311a5ac9bcb69c59dd93b33506b2a67eb47cd9 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 e03d9525b122bf5c918a0ad658bc88e782b25699..2ba3ed123cce86f364158791abbd88c8a742cda0 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 50e533571b77ede52465d79fd648690c913a1462..56ef5bb58717ffb9cbb99eef76c60cbf747a8be3 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 01e547bb908feed0ac27999c992c9b47e4e7e534..630c67548202fa5dbfa5350851599a1490fbea56 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 1b623a6e9c43ee406f6cc068267ece8d652efe92..1370d9c267cc5407263f3c20290a82d9275f757a 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 828c3b0dc388065e168e99f9a11b0791c6b7c2b6..5d5eb85468e69e7d4b28a834c9a0ecdaa74d94c5 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 5854b0897c6b89628a225274ebdcdf651d4a0017..40246d08d5690a78ba8206decec09d748887ec6e 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 4835e721253a36543d7fabb6e105b17ce3a29a6f..1d280eb4cc05dd9448230bfef95fcd6057f707db 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 c9ddf4eaed11f0534bfdc06904c979985a41753f..73695a9d335256450d463d46f266f457909fef4b 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 8e4ae663797da5f0fd8456685be707a89639e675..b48e938e62d48dfd128dac580a5a077556d787da 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 91ec8bba7306aeb1fa1c4353cd5c4988ec61b5c4..8ad92735c4a182958b213ce340556ebca70c5cb2 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 aaaa9549ade53ab467734654cf5d28c1503bc0b9..f6809bec705c40053f2be8d2021e80fe3147d364 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 a7109959f17f20b0dd325761b77abad0d4b07121..67c5a413901369abbb24148fe003530846b87711 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 4c55cf96550f3a650d601b5c9109b5e3e8fd64a3..c6ef14aab6bd94c76d16807c7abc98dedd3fc611 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 aab99ae5ef1abb66ea05220548950d6f4140c817..8ea5288c7c9a725310c517eeafecceac65e28b8d 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 a2fde19fb21ba079f17d76a994602b51fdbc439b..7d2f24abc85814252fe50f50782a1b05c80b0244 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 ea947e1dd23c5131657b0b63d8c5815d6ecd4d19..544dc92366e0018500464cafd6ef6d3108fefc06 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 7f557d0642c96ec0415d2ffb7f55b35c231a70ba..2b30e80d132b4ac833fd97588fda421264905849 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 8aea5ab25e9eb28fc18487db070a98994b37cead..dfed8f790d6d42587b888267bfd42d776f93b5d6 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 7bd851b6ca502513e6d5a54eba2f60ad31ba9d7d..2f86519491ebbf246bd1772ef4c9460879f59dc5 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 357363c8ac742e574fa26bb4d366afae3525fdf7..884d204629467d3e43c3de77784e442a73b13373 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 6f72293b0adff73c806e3eec62e07df273b1a039..bd965bf3ea091d3e1d7a824c85766832a6a54ca3 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 bc1818099e4e14936fb4d91e7b6d3b3d10447344..16ad9623536e1db9b0388607a7faa681dd1e9701 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 558a569eabdaadaa9e1e7c36b8193bb95f3658b0..8e5789b99c36e8e74beca4412e49e2b2778ff091 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 16a2ec54e186ae499f263708972825d6019c2cd1..274a150b103c9c36d690d4f8241220b0f7c5e691 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 7354c0af2c04a165daa3730b9fd502106a4548f9..7cfec33b03446734c91a33ffb075df1fce5e57ae 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 762b54f183c8e3be01884a0fd037e550bc2c7c8f..1d44b0f567600f0a10caacb0f276db5dfda1857b 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 11ece9f551eeea72478032602ac4466f7af8d363..a56bd8420893ec847c174095f69d74850ff39041 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 24c23044a9312e291b6e6576cd9b1fc19247357e..b8b5ce555e4f29ef4185a7cdc74cd6a2b1664eb4 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 3a8e53a5f633bf31f726511d36f73f346663ba5c..0cea8d05626f0f3f50e88d425b5db5cd99160fbe 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 6e57f39b4489af11151330d0bd0d99500cd4545c..d79401efa586468a50f64cc5e9202cdf3a2458e9 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 f5533c2572c72930a5bff68099c8d5595a5a286e..9f0e90eb6cad8986c0202ce724496a9c1bca1413 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 e60bc441a46f847e162dbc335f93f5afd82e606d..afbc5db4f8b838f9c1df9f03a7f337f138b9c33f 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 1a5475224b9181af8bf267f87748ee16be02317d..f78f2faa9b127bbd75626530a1013d8393d628d0 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 292e09ad4f661b0d037aa768c3cb31915fc85d29..de13670195da702ed33e61cfe3144a536a50a764 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 3c8855f2e2125c01116fef5436c48c9d713db289..538c0f8d8b6d50c11e9426e2f6b27f0585aa49fc 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 29ba557fa4a37fff50bda2935026f9809f3b985f..9aa8dc7a5fc4e93d0e2bc2db524a0a6979d0bf3f 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 e9f550f63e4cc67dbe8ed4b441d30fb57705c2bb..9926817d38cd97d58e002489539e711e2860c2de 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 6db7bf66ff3f1af05bdfcc8874b4513c34cb08aa..53810f46e5b366012693bda426467251f4b689c1 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 b305333c1502487f8707f8e8da8d38385e335ed7..917b08130db839b088006fe3e3377e687c47e09c 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 f37b0f36f8ecc1bd2249e70cd662742709e14806..abe62e7e2e329b335ea5f64b14e1e20a939f8350 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 bf013682ac4d50a7d1fd41dc656cb0712dd7c10d..c36cc59e4103db84921bf7081b3ef03f69adec2b 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 6895358873a31606a67b7afbc2ed8ebf573261dd..9cd6e877d9057bd3f3c5f92ddda3d69b6b4aed29 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 264a45f0f263a287ddafb4eb8e69d09048af45d2..005e8145fe58fe93f7a212733d697def093d7007 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 77275037a04a4d0b3805371b74df2c661cf20b6e..9cfe8864d25223bfe844027e250ffcea3c1af97c 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 d7944d3e66a6061f48c472431d5e4f9b891021da..e00b0a4e9ed0ab5289028491a4897bfbc2793414 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 5eceefe3d65c0ce43a818800203180caaff4e03f..7901378ad2b8c290d8c9fcb3a350392caf8b2988 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 47992d03325603f50989165e0ec132d04855ddfb..b41d692cbcdcbe803e2d600ace29a8354826bcd1 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 a79bec7b311810ae9ee34fffb4b2730b633f61db..882bab4d32fd18100a3a569169501a54c2580ea5 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 0bd4d44bd167100d2c02a4d07461e3cef7870b81..9673baf0bbd7a9415fda34cbfc245a02d4416563 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 dbcfb12ec806a6d49b14b9749b71b401cf62c508..b66d407e9a1b1bf2a3550d9a2eb54ac9d0add0f9 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 584c2a75c10369b1cae256009543668c1b564c4b..1b8c9cc360fd0330750ca693c2e0dd45307f12ba 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 950f90ac1a379a4a30d59f84314e83e2773c4969..a2a680ab45cf78dfd2c52f75639d4aec70addf23 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 a02843a974730a3a354b37e75316c68d3b3d3641..061bdd725e6c7b8d81ddc05f5196a3a9597d2b67 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 e0fac02b558b53f49ba9653e6238ec76e12ef198..c5dc19819535f317e20e1dead500af9a2fb955d4 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 beefc9dddb1c94edbedec97d06559c191a40976b..3c5d816c53f4827c00de598b16266a7ddf432c90 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 e586dc5d2064a81e2e47417736e1be3a17e69a95..826c69405c74e8723f5990612d8ded687d1d127f 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 eaec816c5959769ffb0229c3f3092da43b6b9d48..5b39952ddb652a909ca00347e190a0d3632c2ef4 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 ed53efb77b9b43777ffc0c8a1c892beff16f0422..4e40f111e5b2bbef43d6ea90cee5dc7d2b70cd9c 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 1de14b95279d44a33fa83778b5bbc6ad3f9f2aa5..51efb05e10a94b1ea76265ef3c6c7d0e3dcd4e20 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 04a0f4dd2273fccdd667130f06199fb584a6e88f..e48f067a39093b6fc09dd9473fd6f96a065a7d2e 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 0ba8c5ac43ba18f9961d89450463f001ae975892..1a5a555fb6513112be1d6e39146808c0729d77ed 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 56ca59e899b4160b1b7b78de618fcb40509af063..a3b5e07363b80ce499afc249a8c46eb45de94bb4 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 9ff21f86fe1e8a139865ea596c781119bad589c9..fc9f8d101d43d4cfa8d4f3ac9366ad4e9b74e3c8 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 fbb6af912f3271f11b5923198ea3f708335b88f2..345f90e04bf5454bee9d56d496f7c1e87cd4e08b 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 a0ba000b47c994e5a51c438d064755a868eb9f7b..79a09e95f6c1fb91f71e3dcf1544c34b08caecb9 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 3421a072fed8d8cdd4971911b1cb5ee3baeed343..caecdd7d5c083132df99bf6b1bd17131aae3d24f 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 9837ae4257bd107e15aac8d56a58b334718db2b8..3dd3b1ca722b741fbef756ea62b27c73ea01940d 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 2ef3f055ac74ce7d256b59127778824960655a65..094b3eaa338fe1e3da3dd2f451637224083f8a48 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 34e3bd8f0f892055d2de06a3a30d8572fdb79de8..9d2c56c440e77c0ac2105c51ab857c0bc19e9e81 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 3c697912884e57595e1eb29c6e2ea2cd8db446b2..e8117d22ca8a5478cc906d04e06cc60a7f9a4aec 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 d9652e385b76470f6c0b1b78d3621b65ab8850eb..2195665d550bee04107c75feb71e73b5ca6548f9 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 dee5e2f4fba4213ed7cdb6376600ecab27373a54..5eda275eefc2cf16eaa24a84d10a32a86f260124 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 c4a76f103863797006af02db932a882234a27d8f..af12e56be4d9e9c24272e21b47ef62844f6158a6 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 9041bebca136ff44cb5e862a69c11ebf17c760ea..c786688cb5b9b18a895a290db81cc671389d7184 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 8ba03764fda2cbc22075feb3f6b69ce911bc9754..4fed63275665db7d9a101a853b97dc249abda897 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 caa982203be52c4d007db2f09c66f0af4023d958..409b05bef7d9b46c06f7b159814330c003b94eb7 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 465aff0843efb4dd556f95413fdced3997b8195e..53d971444fc5aef51b899166954b9af53720b653 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 f8e9fa2d59fb834765f0cadbd505adec9087ab54..d03e836896149910a92acc66c59d6792208f295b 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 5c78f4bc80f16d91b904bf43a48105b85076444a..c9c0300328433522677b7a816f4b0906af8942a7 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 826558e26d5bf25b78a8435a20c25f18cf4afcc2..5f2a3cf75091070486a939aa1d2700d109f99e5f 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 9285749cdd599e99cb6a1d898d7ca31036912395..c2042366e567f31431a3ff27e0265ce4236d44c0 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 ca86bcfa8bc3f77c66ddefb6669ad0198b8df934..7331164d77ca958247f093c41826859d42d10c2e 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 f8a5d78866dbe2cbe5709333c77f33b25e362104..3360b67706be723f1fab23cbf549c7d419030c63 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 9b14db1255e28520b804ef512757a7123fbcbf5d..2f50f7caca6d20c22e7a166c958ce653b8a84bbd 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 6ab2e152b6e85dd7a0d8e55b08f9222ee1eea588..94a7fd93b1c5ddf5c6765674e5a1d6a24d4b83f7 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 36c975e348761a6794a4b5cd2a19ab8b4eaaaa7a..f6d074b49201a41478202b8905c85b965664dfca 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 5a13f3cb2248e9c0881be4bf2d7b7059f5a9ac58..918a4a957bd6be2dfb7b23487890b277b89cb769 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 b0b0ed18b8cf304a84935c73fc26aef744c71fe1..ccfbb73a75fe2e4dcd5bb76fa1c66facf2e1cbff 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 3f71940b69241c08650d55fe722b9106dccc29a7..79f7aea06ff5df3db5ac6e65cc8198ab55eca641 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 4aadafe9e2df894edbe8ce47151ac52b22bec06b..59d1a5236be0a8cbe15d6f6634f5e209ec178689 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 f75abc6c64572fb6ddb83b98577586b7762eafda..10f330e259238cf958cdb14a814898fd0d1048fc 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 2bfdfe95b705d1ae4028e68c59c063ca303cdb40..133be6183e7867702c5fb3a3989c944a518d2b31 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 168d40401b0d0ad5a74fc9b9298c89287c920bd6..9c805e2dac6d51020d652407240d705ff9469664 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 3670536a968784bb26e4d3db6fcaf300cb278fb1..24f69dd4e875c5a23972806eeafdc8c6961ee80c 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 a4a848a273b2d82ef1d05e7d05b0dc1b37c3f074..6fdab2c6ef2612c663743d2572a358be8cf35325 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 92b40f77f2fccfdd9050489936238af92e16a660..b2d0a297204bec1bd5a7feac05844c2e481bb865 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 d6ab2b2de22d0ba784e2f53ca02a53ec799d4daa..6683c91bc9a95d4a746d29cd6821bdc27f6a87bc 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 38ac89bbc37bb1d74bff7a855219a6b3c4a1e9cf..4c86e30a0e8d355d48f485f88da7704ec8da38f4 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 b46d3c8e1733b2c6b83746765ca9920f13154d26..930dbf02b5dbb660cb7f8f3b5ff416778fb8f567 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 4b7f1243889ea804d247d6cd4dfa364bb8428a63..f6ded38ab2070388ec1173685b4765d7fa704dd4 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 dc79f31e48dfee8dbb35aa4bcd4c48f42e92bb1c..c366b8b6d304db561173d1a06aa49e45cff1aa62 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 df35844b52611b4efa7279044aea87f5f4cbe00e..0a9bc524f99fa771a9375e879f9b4d3551b42ede 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 cb761040e049c7485bb3b88653530cae60eb3f55..bef47b8a21cd9d98bf023e87dc5084863aa7987a 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 a027eb050ab5df0cc78eac2ebbfe6e1ca1f4e570..bd71d44bdcd7a8b0d4b3724716ef0a9468ea6da3 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 a2e79d68520338a2f7cfa1ed2322537d5d8f08c1..83d3bcdb2fd2a63b1b2528a4a702025b0c2e2f8b 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 ed4ca9b7222b6b51395469ca9cdbe761e5039c1b..d47618f98ea601dcb6001c9eb70c5a9f32590a74 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 7409fd3a88a1485ba47f7b65d782655c6f02d466..a6c1e60703a92cecb34527d9bf8c33eb27fb1f4e 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 365dc57fdd58ac5642f679b25a076d200b912e6c..0c52a261e1ed35efca5268ab68d5ed69f7bb7c3d 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 52c9357cb8059a2e4844b60c6d72bfaa017e09b3..94f38d3fe6683a3d40c0a9bc89cfdfb0330c7a66 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 04828132a5227729c3badfca08a07f0b245e8a89..8b91cbdb3438caccc71abc302ee87eb0bc585271 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 f17154bc820ead28ff4f79b2dce3bd84a6454f61..3867b044062628a9d1ed905c5dafa79c34d627ac 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 d32c1f9e62a7dc9569ad8a92752b521675a3ecfe..44160ead46c212be4c0ea70c932ec47b4a693b66 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 aa250ef3ae0ab27986c7a918e16d5930894e5447..d3e136714bdd93b514645dc1a40b23ecdccdae91 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 4b6b5cff0ca0a221795c195cfc0694df032e92c6..b4601190d516b420b255e01f1f20268674be878f 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 afd183c17ad29bd35f01e561a6ecb00e6dbdacf5..124aac46945910f01d32d8652609faf15a6f85ef 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 ab108f6bf5fede6b3986e5c9a5d3efe2ff289f16..3cd655f2739f8818b270b83a94719c46060a68f8 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 29d834237773d9f18369e5bf13fbd1b046ce04a1..5527f34a24f1f10802f706f9edd34825dbfb144d 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 3eef32690b58ffe69fb37c83f89a69c40a9586d1..07f3e914756de110c423214f8865bebe305e4753 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 65925913da8a683ccfae63fdab4da4affa76b97f..95f0908865b9257c95e01ba3c0722d16c0d0c2a3 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 7fa6d39698b4cbee6ce160484e5272d751430c30..b3e29e80303c810e6319e6dcd7aee77cb5aaf60f 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 738478a0bbba1612764f6aa51da12b4e54867d24..6f036a32aed6c17d46e94d437a579eba680f66e4 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 844a3d6b51a24ba985de800c2821ade8d1139f5e..de3acfcb5e2b0a1b1aab17d0a7df48753e2e29fe 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 dfcec456f5ac3365a73c3582f1dcc848166caea6..86093c7c3d5de2d1b27c697ad9e6870f1ec50cb3 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 6d292ebeccaf15d510dfce29312e79963d9df1b2..c9c78770e239d3253d0edf6830c50cb392316f67 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 57b56ab283470a83036c3f957026600f36feba4f..0208b26798cd89c8ccd60a3bf12b0779d87e6b17 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 babf73b236efea47256ecf98ba6384822b24bf7a..af036480a8bf7f2f11a0cd3c46d6f3af942ebc4c 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 aa0b67ee4b54a628c3f852c5c966da840bb935b3..fa850b10379ee64600d398cf475e495f95bf0c4c 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 51ef9d3f080cb56b7c681f621fb8dbd81bb81263..20d491299f06c4d1108a35332aabf59ef3a1910d 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 050ff8c7aff178e8c6a3ddf5e120851b36c37229..1d09768a54ccfbacbccdeb2acac0d31835559604 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 40044f5b6b446ca4752a3511d4b1fa17cfa0d212..5540ede2351f89ebbc0af042bf878f4ed672b26d 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 d844d583334d75f9eceb1ccc24fb2ed5a9102aa8..69c9629ed2577f00f3be3ae07a5d3780a7f03f5b 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 f3adc17d2dd7319557e17603d57f2ee7a6b5d91e..d996cff6780bd2a88beef659de22a4ee7a6258b3 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 ae60a499efa7247ea0ddf6d1d02620c41e3d8a82..11abfe098190bb92e6cf5ef71b01a1920a79745e 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 19e2d2e1a38adade27bdbc9cc66c6436471ede3e..92f24839fff5ae2ed08f43ca1672d0cc013408f5 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 0508f6a6adb6927f70c3bd54f7fdee996dabfd8e..8f0667b5c4d0cc83f5ae4c5518cda9f560221dcb 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 bc129106a00c021f0ec1cfc33358d6b96de5f682..bc2c7303b722a745fe7574a2e8c737b0de577210 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 1a73a52aea9920584a6b3aa485330043f6f33649..bf8c0eaa9ca0a0fb91e19b88a1117784465bdc65 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 badb665c9fc8ec1eb919921d3cbd7d69566c9bab..78a6639b2699da76fcbb6131ee6541e5ee8cec54 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 c4ce12561bed00b14cb4e063829913826a7755d2..dcbb5536326d99c8edf0bcdc78b2306da3bb8151 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 6562b0ab5fa5c87413eedc5e647c76e747ab279e..6a305cd16b8b7ad6e92a911d44226d7acd9e9114 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 a789f920b48b5416b9cbe9842808e84ea68f715b..90b94a8e558a9d23f5ef641513b4cc2763e57c0f 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 59679a2af07a8e7697238325ce0901aa9a24549b..b16395d0666d11f3ce6a96657ae23a7bb30dd758 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 eec164b4316e5efcd3c1a412bef8ecbe3ff646c5..c6a0411b83e20986fb75ff7e8c4ed730e78c5957 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 699983e82bc30f1c0560b3c140161b53e1ff985d..a6ef7d32b37cccf70f2a6c3119d619f18d48b921 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 e209fd5ed41bfc330d95d150bc57074117921f22..09b5854a1be2b3094a32d39734b10412ee22b541 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 c1891a09960c81792563840755621c96a8377d78..86577045652720af5d72f4e0d6af8f1496696f2d 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 477257c2583cdbfdfe8e9b6f2de443a87f5969dd..9b0e6584174ba34a9ed9e851a2795344bf11a6c9 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 cb677f7882e62ba04db5a17e1a977513444e116f..b6be3201e2a0676728e483ddd9aefaca58045be3 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 8eb4542ac812477099b3f4f1de7d530cc4389a35..a272c716585eed65c7ac0c8ecd9555ca5370c564 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 162af3ea533c64d684c4d3caf6131d6486381235..0820e8382852b6fe25a73e6e6bdc3975d8bb50e8 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 f6114f1390da74c92e194e41d2142aa37bc81ad0..9a11fd2c36143cd5e1753e4ad7b456b9aee245bf 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 af0bebcbd63bd0dee440ea13d272369ac2fb22ac..2300feb78da3d472d95b6823a0d23ebe49abe567 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 fa24e09502416a2d04139f2eee569614b9431b3a..29718acbab421fccd0c885b8fdc4f711fc0460f6 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 746a359679b0ceb0be80e10841651cddbb81c913..b35280c73e9a726ced59cbd00033b36c78cd2257 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 d4c124e967214026e566b8b081c040156497c79e..536e6f296a5ae50c0349f4ddf13b6c3d79d5619a 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 07350f657d0fc4e9f06c0f5897e43fb0d96c2ac7..3794117dfc3cda379fdda7757e7a272457a2ff57 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 4122014ea973c3311cd90ca229d3e4ca935ac709..a2d3a3dce1dcfbdddd2ce578df853376f96d9f48 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 2e950e8493a09466c0c895c768c4e03deef1dc89..0d3f3d52873b1488865434c42ac0a5a29932ee4b 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 54a67562d253803a80f72820a2aec4bfc139c368..7e0772f6093d41591a2f1b047102ba213a3d4471 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 26d24cfc11909f1721393c77e87b5efc906f0e88..867c92fc8b427e2866ec57c2ac6c4911a23ed1c2 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 03f9b0da01b1de15cc942ff242ad66cd565ac020..c0db5c404d7fc98e1b462d29d8c9a8a4a753d072 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 d0979d82e3b66cd399c0450931e72ab7a09a5caa..bd157e830070a70b0b32fc91088c2f646619cc0d 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 7226e5bb60adcc1ceb4be807fd420521a1dfc030..f9f7a674f1d5ac0e0d47b780e89bd34a6a50bb28 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 d742a5f01b383808ff1463543b9814241486437f..3fb74d2856e39a67e15eb13e70409ef0e24a4e06 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 71bf9923e8857bb477ac5894d4db56414ce6a8e0..210f79f944f1e3a91b03c1f172ce99d9c6768ccb 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 0b2665b71591f0009563d9df7c17a8183b3261c0..b6eab9b2c76bcd64427ce35f3facb260bf6d9df4 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 a01812e0807c2df6be07add23180f08e051c6463..dbcfbc4c13d466ef950d68f113cfc7e992ccbd48 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 4285348a8237f2683aa64b2320ecaf6a74f58130..1c62b9ba972f1be6a502e3a25d36cfaacd9f36db 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 c261b10f33142923995d96c56e2c565f81bb6a33..9b4e70a61ed2741bec322f709666c298977eec47 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 54ee1c56394f24379afc34f4945fa26b9e0e574e..544a978504c384ca79fb285dbaf44b78bfdcf6e2 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 3a02989b1d5062192b041247a92fbba97795a30e..d9d8adee4520e7a0f0df68d6a2e3858802f43a84 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 0984a56d6c991402630334f164e033d4a3675e41..918cfcbdcbbc87885f8a313501ab0829272c6259 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 1530113e399ab8906ca6d98f505e7f4d31abcbaf..e28f93e14b40dd4c4ad79af9f507f4cb1bbc3430 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 be7c7c39287af773a5c65a39e23d959dfb2fef96..e5b30eae2ede1b287a4ced2d32aab3b7a237eefa 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 20f9e3f023d1be0fc2f8039b129d93d0f87c9884..ff640433766076529a8dfccefb816fb7f51e0fd1 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 a5074ed128f4a71528e809e11e5022180f620279..fc6479516c1e990ed87161a1943f2aaa12bfee8d 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 8501a50cba716afbcba34e07b6fce6c4b3ab0299..e806af3e64e64fc283e4a67f93aba1a2c00bf64c 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 920193e01ec30fa3277a1f647c015235a00c457f..03b3d264ecc3399b3af53595f41dd18df596c89e 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 3c2a98e0f6f8dcd866cf57c8189b6f89cb7a3a93..0256572cf873820ff437f92303a3d5f713e4beb8 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 da8d40eb484faeeb0459b1baa411dcdf4b0ed409..f2647ddd3cc7b6310fdcd080fc3e146825e688d7 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 e5b04b3a957c961d7a49892d0186bc85490b0a51..839a6d0b72a2f114e7296f541bac6c9a4c93f959 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 84499db9d992f007f180d982a07705cd735ea528..dbf64473c0a1109f2e4a5b48b9c43e616109ccb6 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 a895d1e2e9292ba701573017844343a1fc3eaa99..0621ea7ed8f178f25dd486655307be58a9132352 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 c0c2df16f1119a56448a171d55a3831a13a6275e..8cbac3c7b38ba5b36ad59c959502915dcd21df8c 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 02c52d3b127209f947e7edf1d489b0b83d3588b3..0e040ee8f7e45cf5a6e0dbd685889ad3a70c5107 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 e529cd25df42ca14212316e9f9bda4b8899ea606..92b1867b6f51ab9a017bb14923347c379d627c54 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 c2fded9cb12735d7bc27dc2a3a3dc4d164306a49..fd6c74f13f5b3d95e1b311605488749cfb03bc85 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 e7d7e2a26240b8ea71e3c15eb0f03cb7c061d04e..16272e2b42353877dedd0adbbef56f6f3cb6eeb3 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 7e4aeedfdac75489ef9d4a44adc4ba2f052a3ede..dd53acce8d1fc77f7a88e7b8f9e13c720269cfc2 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 a25bbe7641171a58a20747a59b06fd432828cb6c..a20cef110ddf40506b0639b81e9896ab1ddf8765 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 68aec84dea2508b374d47bdf30b0b26569c7cfc8..2677278daf2872d37b1a080ae05a853913a23861 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 714a83e954d14720b7fffdb6635c93b63cfeef61..2bc9864909534754005c8b30eb96302033691311 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 b4a5dbfb6c568fdb119eb8b22b7c1be2661acb67..f2bf0a328195aa77d3b614c63fd411440922c810 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 e799c423f0e44d3993ea371869684fbadc822376..be5675b3ad499048a93d00c8fed6ec8c83f94592 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 8aaba995b020d090289a5f6d0b4a58261be76ca4..f4a172f6df33911c026abc83eab51ff19236e0fb 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 0537a5bb186146c073286e95da145b060c8ea2bf..ba1d842bf022b7d4a98e459e12fcdbc3d0918383 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 758c6eb5f5ded2e7de5dd078dd608530b96db117..8e4a6855497cf3145bf0684b498f8ce2cdd320ca 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 d55be566ebb4b1904732fd9a1ad2aa563d823df4..fb7d52ceae5326d90af244dc21243b1366a84d1d 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 0af8a54910775d18309513258a6403036132047b..9035fcaa49c901f3eca6b1e77140c9e87ba22b1e 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 2875f366ad2b2f50bce67eb52f09943655346c33..32ba76ba0a72d9076acdca983b0e5139deb51982 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 f8c67b837bc42346e541e0b1e123415409237994..024b5593bdc692efcfc5e2bcc17647a86de9c5cb 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 25e3cffccc79bf6dd4caf5e93b9aba2b934d9cec..cc767440863758ac1f05e81fd3ea7db05c00b27a 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 19696f85c603b234efdbc4da0a84308d1f9156af..7d184f53fc201aca9323fcc36e41e19ba951f3d9 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 0000000000000000000000000000000000000000..4e4f899eef26fe570dbe1c7120198c8a51339e34 --- /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 516a6e77e61a536014fb1c577cc88ddb247db116..b20e167320dca8a77f7715c9d824aa453eee748e 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 fe594ea9202ca112f016bea79d10a3ea584aded5..ef33eadbc200874205a82694e4fff568b898b3eb 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 5f60fae0a8cca47ba49d51fa5a727ce8d141dee4..13fe117f59406608c7e739d660380527cbfd11c1 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 ea8c64a8b94971b84d7da4cf09217f680f54249e..7a16eddedc618642fbfe5969bda3604d15d45112 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 0617a81647b23e091a9f61985a23cea233ce79f1..52cd696931d7a5acba3124d1699cd64355bd7572 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 8290f67d6af5208d01701a6f4737d58bab585eb9..2a88bd8e76879ad93d453e3c56f5bd3237d136e9 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 43af2820d4e8a2fb4faa163226bf5332ef2dbf15..ac978eba7c3750acf5fdfda54341033f953ee81f 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